QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#801145 | #9784. Donkey and Puss in Boots | isWFnoya# | WA | 0ms | 3856kb | C++20 | 578b | 2024-12-06 18:40:54 | 2024-12-06 18:40:58 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int N=1919810;
int n,m;
int a[N];
bool check(){
for(int i=1;i<=n;i++) if(a[i]==0) return false;
return true;
}
int main()
{
cin>>n;
for(int i=1;i<=n;i++) scanf("%d",&a[i]);
if(check()){
puts("Puss in Boots");
}else{
sort(a+1,a+1+n);
ll sum=0;
for(int i=1;i<n;i++) sum+=a[i];
if(sum>=n){
puts("Puss in Boots");
}else{
puts("Donkey");
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3600kb
input:
2 2 2
output:
Puss in Boots
result:
ok single line: 'Puss in Boots'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
4 0 47 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
4 0 47 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3784kb
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: 3724kb
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: 3656kb
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: 3784kb
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: 3652kb
input:
5 0 0 0 0 0
output:
Donkey
result:
wrong answer 1st lines differ - expected: 'Puss in Boots', found: 'Donkey'