Skip to content

Commit 08b8f22

Browse files
committed
Edu Codeforces round 97
1 parent 940d959 commit 08b8f22

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

Codeforces/1437A.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include <bits/stdc++.h>
2+
3+
#define MX 1e4+5
4+
5+
using namespace std;
6+
7+
typedef pair<int, int> pii;
8+
typedef vector<int> vi;
9+
typedef vector<pii> vii;
10+
11+
12+
void test_case() {
13+
14+
int x, y;
15+
cin >> x >> y;
16+
cout << (2 * x > y ? "YES\n" : "NO\n");
17+
}
18+
19+
20+
int main() {
21+
22+
int T;
23+
cin >> T;
24+
25+
while(T--) {
26+
test_case();
27+
}
28+
29+
return 0;
30+
}

Codeforces/1437B.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include <bits/stdc++.h>
2+
3+
#define MX 1e4+5
4+
5+
using namespace std;
6+
7+
typedef pair<int, int> pii;
8+
typedef vector<int> vi;
9+
typedef vector<pii> vii;
10+
11+
12+
void test_case() {
13+
14+
int n;
15+
cin >> n;
16+
17+
string s;
18+
cin >> s;
19+
20+
int cnt = 0;
21+
for(int i = 0; i < n - 1; i++)
22+
if(s[i] == s[i+1])
23+
cnt++;
24+
cout << (cnt + 1) / 2 << "\n";
25+
}
26+
27+
28+
int main() {
29+
30+
int T;
31+
cin >> T;
32+
33+
while(T--) {
34+
test_case();
35+
}
36+
37+
return 0;
38+
}

0 commit comments

Comments
 (0)