QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#533837 | #3965. King of cans | Yarema# | AC ✓ | 0ms | 3720kb | C++20 | 753b | 2024-08-26 15:24:14 | 2024-08-26 15:24:14 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int x, y;
cin >> x >> y;
int ans = 0;
if (y & 1)
y--;
while (true)
{
int three = min(y, 32);
int s3 = three * 3;
if (100 - s3 <= x * 2)
{
ans++;
y -= three;
x -= (100 - s3) / 2;
}
else
break;
}
cout << ans << '\n';
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3668kb
input:
50 0
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
5 30
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
49 1
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
0 100
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
4 64
output:
2
result:
ok single line: '2'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
4 63
output:
1
result:
ok single line: '1'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
3 64
output:
1
result:
ok single line: '1'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
49 0
output:
0
result:
ok single line: '0'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
40 7
output:
0
result:
ok single line: '0'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
5684 4439
output:
246
result:
ok single line: '246'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
249 371
output:
16
result:
ok single line: '16'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
199 75
output:
6
result:
ok single line: '6'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
2 150
output:
1
result:
ok single line: '1'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
251 8
output:
5
result:
ok single line: '5'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
41 27
output:
1
result:
ok single line: '1'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
76 113
output:
4
result:
ok single line: '4'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
52 154
output:
5
result:
ok single line: '5'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
137 30
output:
3
result:
ok single line: '3'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
173 94
output:
6
result:
ok single line: '6'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
63 0
output:
1
result:
ok single line: '1'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
2571 845
output:
76
result:
ok single line: '76'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
147 108
output:
6
result:
ok single line: '6'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
3 22
output:
0
result:
ok single line: '0'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
120 63
output:
4
result:
ok single line: '4'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
102 81
output:
4
result:
ok single line: '4'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
14 32
output:
1
result:
ok single line: '1'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
104 6
output:
2
result:
ok single line: '2'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
25 90
output:
3
result:
ok single line: '3'
Test #29:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
96 23
output:
2
result:
ok single line: '2'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
63 32
output:
2
result:
ok single line: '2'
Test #31:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
66 30
output:
2
result:
ok single line: '2'
Test #32:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
1443 697
output:
49
result:
ok single line: '49'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
52 73
output:
3
result:
ok single line: '3'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
927 743
output:
40
result:
ok single line: '40'
Test #35:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
131 750
output:
25
result:
ok single line: '25'
Test #36:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
342 354
output:
17
result:
ok single line: '17'
Test #37:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
426 498
output:
23
result:
ok single line: '23'
Test #38:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
101 456
output:
15
result:
ok single line: '15'
Test #39:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
153 358
output:
13
result:
ok single line: '13'