QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#788527 | #9784. Donkey and Puss in Boots | TaoRan | WA | 0ms | 3628kb | C++14 | 642b | 2024-11-27 17:19:43 | 2024-11-27 17:19:44 |
Judging History
answer
#include<bits/stdc++.h>
#define pt putchar
using namespace std;
typedef long long ll;
const int N=1e5+5;
int read();
void write(int x);
int n;
int main(){
n=read();
ll sum=0;int mx=0;
for(int i=1;i<=n;i++){
int a=read();
mx=max(a,mx);
sum+=a;
}
puts(sum-mx>=n?"Puss in Boots":"Donkey");
return 0;
}
int read(){
int x=0,f=1;
char c=getchar();
while(c<'0'||c>'9'){
if(c=='-'){
f=-1;
}
c=getchar();
}
while('0'<=c&&c<='9'){
x=x*10+c-'0';
c=getchar();
}
return x*f;
}
void write(int x){
if(x<0){
pt('-');
x=-x;
}
if(x>9){
write(x/10);
}
pt(x%10+'0');
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3612kb
input:
2 2 2
output:
Puss in Boots
result:
ok single line: 'Puss in Boots'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
4 0 47 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
4 0 47 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3532kb
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: 3544kb
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: 3500kb
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: 3628kb
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: 3608kb
input:
5 0 0 0 0 0
output:
Donkey
result:
wrong answer 1st lines differ - expected: 'Puss in Boots', found: 'Donkey'