QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#775527 | #9784. Donkey and Puss in Boots | ucup-team191# | WA | 2ms | 3868kb | C++23 | 526b | 2024-11-23 16:09:18 | 2024-11-23 16:09:18 |
Judging History
answer
#include <bits/stdc++.h>
#define X first
#define Y second
#define PB push_back
using namespace std;
typedef vector<int> vi;
typedef long long ll;
const int N = 1e6 + 2;
int n;
vector<int> adj[N];
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
cin >> n;
int u; vi a;
for (int i = 0; i < n; ++i) {
cin >> u; a.PB(u);
}
sort(a.rbegin(), a.rend());
ll sam = 0;
for(int i = 1;i < n;i++) sam += a[i];
cout << ((sam >= n) ? "Puss in Boots" : "Donkey") << endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3780kb
input:
2 2 2
output:
Puss in Boots
result:
ok single line: 'Puss in Boots'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3504kb
input:
4 0 47 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3612kb
input:
4 0 47 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3868kb
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: 2ms
memory: 3552kb
input:
5 8 5 1 1 0
output:
Puss in Boots
result:
ok single line: 'Puss in Boots'
Test #6:
score: 0
Accepted
time: 2ms
memory: 3852kb
input:
9 5 13 1 0 0 0 0 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #7:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
7 13 0 1 0 0 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #8:
score: -100
Wrong Answer
time: 2ms
memory: 3500kb
input:
5 0 0 0 0 0
output:
Donkey
result:
wrong answer 1st lines differ - expected: 'Puss in Boots', found: 'Donkey'