QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#782540#9784. Donkey and Puss in BootszsjzsjWA 0ms3688kbC++14622b2024-11-25 20:25:142024-11-25 20:25:15

Judging History

This is the latest submission verdict.

  • [2024-11-25 20:25:15]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3688kb
  • [2024-11-25 20:25:14]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;

const int N=1e5;
typedef long long ll;
ll n, a[N];
ll cnt1=0, cnt2=0, maxx=0, summ=0;

int main() {

    cin>>n;
    for (ll i=1;i<=n;i++) {
        cin>>a[i];
        if (a[i]) {
            cnt1++;
        }
        maxx = max(maxx, a[i]);
        summ += a[i];
    }
    if (cnt1 == 1) {
        cout<<"Donkey"<<endl;
    } else {
        if (summ - maxx < n) {
            cout<<"Donkey"<<endl;
        } else {
            cout<<"Puss in Boots"<<endl;
        }
    }

    return 0;
}
/*
2
2 2
*/

/*
4
0 47 0 0
*/

/*
2
1 2
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 2

output:

Puss in Boots

result:

ok single line: 'Puss in Boots'

Test #2:

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

input:

4
0 47 0 0

output:

Donkey

result:

ok single line: 'Donkey'

Test #3:

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

input:

4
0 47 0 0

output:

Donkey

result:

ok single line: 'Donkey'

Test #4:

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

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: 3508kb

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: 3644kb

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: 3636kb

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: 3632kb

input:

5
0 0 0 0 0

output:

Donkey

result:

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