Skip to content

Commit dd2a508

Browse files
authored
Merge pull request #316 from xirc/atcoder/abc053
AtCoder/ABC053
2 parents cccd4e6 + c3d2bc0 commit dd2a508

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed

atcoder/abc053/A/main.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
using ll = long long;
5+
6+
int main() {
7+
ios_base::sync_with_stdio(false);
8+
cin.tie(0); cout.tie(0);
9+
10+
int x;
11+
cin >> x;
12+
if (x < 1200) {
13+
cout << "ABC" << endl;
14+
} else {
15+
cout << "ARC" << endl;
16+
}
17+
18+
return 0;
19+
}

atcoder/abc053/B/main.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
using ll = long long;
5+
6+
int main() {
7+
ios_base::sync_with_stdio(false);
8+
cin.tie(0); cout.tie(0);
9+
10+
string s;
11+
cin >> s;
12+
int l = s.find_first_of('A');
13+
int r = s.find_last_of('Z');
14+
cout << (r - l + 1) << endl;
15+
16+
return 0;
17+
}

atcoder/abc053/C/main.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
using ll = long long;
5+
6+
int main() {
7+
ios_base::sync_with_stdio(false);
8+
cin.tie(0); cout.tie(0);
9+
10+
ll x;
11+
cin >> x;
12+
ll p = x / 11;
13+
ll q = x % 11;
14+
if (q == 0) {
15+
cout << 2 * p << endl;
16+
} else if (q <= 6) {
17+
cout << 2 * p + 1 << endl;
18+
} else {
19+
cout << 2 * p + 2 << endl;
20+
}
21+
22+
return 0;
23+
}

atcoder/abc053/D/main.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
using ll = long long;
5+
6+
int N;
7+
vector<int> A;
8+
9+
int solve() {
10+
unordered_set<int> s;
11+
for (auto a : A) {
12+
s.insert(a);
13+
}
14+
int K = s.size();
15+
if (K % 2 == 0) return K - 1;
16+
else return K;
17+
}
18+
19+
int main() {
20+
ios_base::sync_with_stdio(false);
21+
cin.tie(0); cout.tie(0);
22+
23+
cin >> N;
24+
A.assign(N, 0);
25+
for (int i = 0; i < N; ++i) {
26+
cin >> A[i];
27+
}
28+
cout << solve() << endl;
29+
30+
return 0;
31+
}

0 commit comments

Comments
 (0)