QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#798199#9784. Donkey and Puss in Bootsucup-team5071#WA 0ms3872kbC++20539b2024-12-04 09:37:152024-12-04 09:37:19

Judging History

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

  • [2024-12-04 09:37:19]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3872kb
  • [2024-12-04 09:37:15]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
void Solve()
{
    int n;
    cin >> n;
    vector<int> a(n);
    int maxa = 0;
    long long suma = 0;
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        maxa = max(maxa, a[i]);
        suma += a[i];
    }
    if (suma - maxa >= n)
    {
        cout << "Puss in Boots\n";
    }
    else
    {
        cout << "Donkey\n";
    }
}
int main()
{
    ios::sync_with_stdio(false), cin.tie(0);
    Solve();
    return 0;
}
/*
5
1 2
2 3
3 4
4 5
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3628kb

input:

2
2 2

output:

Puss in Boots

result:

ok single line: 'Puss in Boots'

Test #2:

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

input:

4
0 47 0 0

output:

Donkey

result:

ok single line: 'Donkey'

Test #3:

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

input:

4
0 47 0 0

output:

Donkey

result:

ok single line: 'Donkey'

Test #4:

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

input:

10
5 7 3 0 2 0 0 1 0 0

output:

Puss in Boots

result:

ok single line: 'Puss in Boots'

Test #5:

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

input:

5
8 5 1 1 0

output:

Puss in Boots

result:

ok single line: 'Puss in Boots'

Test #6:

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

input:

9
5 13 1 0 0 0 0 0 0

output:

Donkey

result:

ok single line: 'Donkey'

Test #7:

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

input:

7
13 0 1 0 0 0 0

output:

Donkey

result:

ok single line: 'Donkey'

Test #8:

score: -100
Wrong Answer
time: 0ms
memory: 3612kb

input:

5
0 0 0 0 0

output:

Donkey

result:

wrong answer 1st lines differ - expected: 'Puss in Boots', found: 'Donkey'