QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#23815 | #2967. Snowball Fight | maze# | WA | 3ms | 3844kb | C++14 | 1.2kb | 2022-03-19 16:05:55 | 2022-04-30 04:11:03 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
pll in[3];
bool cmp(pll a, pll b)
{
return a.first > b.first;
}
int main()
{
for (ll i = 0; i < 3; i++)
{
ll x;
scanf("%lld", &x);
in[i] = make_pair(x, i);
}
sort(in, in + 3, cmp);
if (in[0].first >= in[1].first * 2 + in[2].first * 2)
{
printf("%c %d\n", in[0].second + 'A', in[0].first + 1 - in[1].first * 2 - in[2].first * 2);
return 0;
}
ll x = in[0].first - 2 * in[1].first + in[2].first;
if ((x % 3 + 3) % 3 == 0 || (x % 3 + 3) % 3 == 2)
{
puts("Rubble!");
}
else
{
if (x > 0)
{
in[0].first -= (in[1].first - in[2].first) * 2;
in[1].first = in[2].first;
ll ans = ((x - 1) / 3 + 2 * in[0].first + in[0].second + 1) % 3;
printf("%c %d\n", ans + 'A', 1);
}
else
{
ll ans = (2 * in[2].first + in[2].second + 2) % 3;
printf("%c %d\n", ans + 'A', 1);
}
// printf("%lld\n", (abs((x - 1) / 3) + 2 * in[0].first + in[0].second + 1));
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3784kb
input:
10 3 1
output:
A 3
result:
ok single line: 'A 3'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
3 2 1
output:
Rubble!
result:
ok single line: 'Rubble!'
Test #3:
score: 0
Accepted
time: 3ms
memory: 3792kb
input:
2 3 2
output:
C 1
result:
ok single line: 'C 1'
Test #4:
score: 0
Accepted
time: 3ms
memory: 3756kb
input:
100 101 100
output:
A 1
result:
ok single line: 'A 1'
Test #5:
score: 0
Accepted
time: 3ms
memory: 3624kb
input:
100 99 100
output:
Rubble!
result:
ok single line: 'Rubble!'
Test #6:
score: 0
Accepted
time: 3ms
memory: 3760kb
input:
1000 5000 1000
output:
B 1001
result:
ok single line: 'B 1001'
Test #7:
score: 0
Accepted
time: 3ms
memory: 3760kb
input:
2000 1000 1000
output:
C 1
result:
ok single line: 'C 1'
Test #8:
score: 0
Accepted
time: 3ms
memory: 3844kb
input:
1000000000000000 2000000000000000 4000000000000000
output:
B 1
result:
ok single line: 'B 1'
Test #9:
score: 0
Accepted
time: 3ms
memory: 3780kb
input:
1000000000000000 2000000000000000 4000000000000001
output:
Rubble!
result:
ok single line: 'Rubble!'
Test #10:
score: 0
Accepted
time: 2ms
memory: 3784kb
input:
1 1 1
output:
Rubble!
result:
ok single line: 'Rubble!'
Test #11:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
1000000000000000000 1000000000000000000 1000000000000000000
output:
Rubble!
result:
ok single line: 'Rubble!'
Test #12:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
1000000000000000000 1000000000000000000 999999999999999999
output:
Rubble!
result:
ok single line: 'Rubble!'
Test #13:
score: 0
Accepted
time: 1ms
memory: 3784kb
input:
999999999999999999 999999999999999999 1000000000000000000
output:
C 1
result:
ok single line: 'C 1'
Test #14:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
1000000000000000000 666666666666666666 333333333333333343
output:
Rubble!
result:
ok single line: 'Rubble!'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
1000000000000000000 1000000000000000000 1
output:
Rubble!
result:
ok single line: 'Rubble!'
Test #16:
score: 0
Accepted
time: 2ms
memory: 3784kb
input:
1000000000000000000 1 1000000000000000000
output:
Rubble!
result:
ok single line: 'Rubble!'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
1 1000000000000000000 1000000000000000000
output:
Rubble!
result:
ok single line: 'Rubble!'
Test #18:
score: -100
Wrong Answer
time: 3ms
memory: 3728kb
input:
1 1 1000000000000000000
output:
C -1486618627
result:
wrong answer 1st lines differ - expected: 'C 999999999999999997', found: 'C -1486618627'