Skip to content

Commit 7860903

Browse files
committed
[#10] Add abc200
1 parent 145b2b9 commit 7860903

File tree

4 files changed

+113
-0
lines changed

4 files changed

+113
-0
lines changed

ABC_200_A.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <iostream>
2+
#include <cmath>
3+
using namespace std;
4+
5+
int main() {
6+
double n;
7+
cin >> n;
8+
cout << (int)ceil(n/100) << endl;
9+
}

ABC_200_B.cpp

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
long long n, k;
6+
cin >> n >> k;
7+
8+
while (k--)
9+
{
10+
if (n % 200 == 0)
11+
{
12+
n /= 200;
13+
}
14+
else
15+
{
16+
n *= 1000;
17+
n += 200;
18+
}
19+
}
20+
21+
cout << n << endl;
22+
}

ABC_200_C.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
long long cnt[200];
5+
6+
int main() {
7+
int n;
8+
cin >> n;
9+
10+
for (int i = 0; i < n; i++)
11+
{
12+
int a;
13+
cin >> a;
14+
15+
cnt[a % 200]++;
16+
}
17+
18+
long long result = 0;
19+
for (int i = 0; i < 200; i++)
20+
{
21+
result += (cnt[i] * (cnt[i] - 1)) / 2;
22+
}
23+
cout << result << endl;
24+
}

ABC_200_D.cpp

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#include <iostream>
2+
#include <vector>
3+
using namespace std;
4+
5+
int n;
6+
int a[200];
7+
vector<int> remains[200];
8+
9+
int main() {
10+
cin >> n;
11+
12+
for (int i = 0; i < n; i++)
13+
{
14+
cin >> a[i];
15+
a[i] %= 200;
16+
}
17+
18+
vector<int> b[200];
19+
20+
for (int i = 1; i <= (1 << min(8, n)); i++)
21+
{
22+
vector<int> temp;
23+
long long tempSum = 0;
24+
25+
for (int j = 0; j < min(n, 8); j++)
26+
{
27+
if (i & (1 << j))
28+
{
29+
temp.push_back(j + 1);
30+
tempSum = (tempSum + a[j]) % 200;
31+
}
32+
}
33+
34+
if (b[tempSum].size() == 0)
35+
{
36+
b[tempSum] = temp;
37+
}
38+
else
39+
{
40+
cout << "Yes" << endl;
41+
cout << b[tempSum].size() << ' ';
42+
for (int i = 0; i < b[tempSum].size(); i++)
43+
{
44+
cout << b[tempSum][i] << ' ';
45+
}
46+
cout << endl;
47+
cout << temp.size() << ' ';
48+
for (int i = 0; i < temp.size(); i++)
49+
{
50+
cout << temp[i] << ' ';
51+
}
52+
cout << endl;
53+
return 0;
54+
}
55+
}
56+
57+
cout << "No" << endl;
58+
}

0 commit comments

Comments
 (0)