QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#23812#2967. Snowball Fightmaze#WA 3ms3848kbC++141.2kb2022-03-19 15:51:322022-04-30 04:10:29

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-04-30 04:10:29]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3848kb
  • [2022-03-19 15:51:32]
  • 提交

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;
        }
        else
        {
            in[0].first -= (in[0].first - in[1].first) * 2;
            in[1].first -= (in[0].first - in[1].first);
        }
        // printf("%lld\n", (abs((x - 1) / 3) + 2 * in[0].first + in[0].second + 1));
        ll ans = (abs((x - 1) / 3) + 2 * in[0].first + in[0].second + 1) % 3;
        printf("%c %d\n", ans + 'A', 1);
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3772kb

input:

10 3 1

output:

A 3

result:

ok single line: 'A 3'

Test #2:

score: 0
Accepted
time: 2ms
memory: 3512kb

input:

3 2 1

output:

Rubble!

result:

ok single line: 'Rubble!'

Test #3:

score: 0
Accepted
time: 2ms
memory: 3640kb

input:

2 3 2

output:

C 1

result:

ok single line: 'C 1'

Test #4:

score: 0
Accepted
time: 2ms
memory: 3848kb

input:

100 101 100

output:

A 1

result:

ok single line: 'A 1'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3512kb

input:

100 99 100

output:

Rubble!

result:

ok single line: 'Rubble!'

Test #6:

score: 0
Accepted
time: 2ms
memory: 3784kb

input:

1000 5000 1000

output:

B 1001

result:

ok single line: 'B 1001'

Test #7:

score: 0
Accepted
time: 2ms
memory: 3772kb

input:

2000 1000 1000

output:

C 1

result:

ok single line: 'C 1'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

1000000000000000 2000000000000000 4000000000000000

output:

B 1

result:

ok single line: 'B 1'

Test #9:

score: 0
Accepted
time: 2ms
memory: 3720kb

input:

1000000000000000 2000000000000000 4000000000000001

output:

Rubble!

result:

ok single line: 'Rubble!'

Test #10:

score: 0
Accepted
time: 2ms
memory: 3712kb

input:

1 1 1

output:

Rubble!

result:

ok single line: 'Rubble!'

Test #11:

score: 0
Accepted
time: 3ms
memory: 3712kb

input:

1000000000000000000 1000000000000000000 1000000000000000000

output:

Rubble!

result:

ok single line: 'Rubble!'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3716kb

input:

1000000000000000000 1000000000000000000 999999999999999999

output:

Rubble!

result:

ok single line: 'Rubble!'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3764kb

input:

999999999999999999 999999999999999999 1000000000000000000

output:

C 1

result:

ok single line: 'C 1'

Test #14:

score: 0
Accepted
time: 3ms
memory: 3716kb

input:

1000000000000000000 666666666666666666 333333333333333343

output:

Rubble!

result:

ok single line: 'Rubble!'

Test #15:

score: 0
Accepted
time: 3ms
memory: 3708kb

input:

1000000000000000000 1000000000000000000 1

output:

Rubble!

result:

ok single line: 'Rubble!'

Test #16:

score: 0
Accepted
time: 1ms
memory: 3784kb

input:

1000000000000000000 1 1000000000000000000

output:

Rubble!

result:

ok single line: 'Rubble!'

Test #17:

score: 0
Accepted
time: 1ms
memory: 3516kb

input:

1 1000000000000000000 1000000000000000000

output:

Rubble!

result:

ok single line: 'Rubble!'

Test #18:

score: -100
Wrong Answer
time: 3ms
memory: 3760kb

input:

1 1 1000000000000000000

output:

C -1486618627

result:

wrong answer 1st lines differ - expected: 'C 999999999999999997', found: 'C -1486618627'