QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#825905 | #9784. Donkey and Puss in Boots | charlyjoe# | WA | 1ms | 3752kb | C++20 | 802b | 2024-12-22 00:24:56 | 2024-12-22 00:24:58 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long; // %lld
using ld = long double; // %0.5Lf
using vi = vector<ll>;
using pi = pair<ll,ll>;
#define endl '\n'
#define fst first
#define snd second
#define pb push_back
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,a,b) for(int i = (b)-1; i >= (a); i--)
#define all(a) (a).begin() , (a).end()
#define rall(a) (a).rbegin(), (a).rend()
const ll MOD = 1e9+7; // 998244353
const ll MXN = 2e5+5;
const ll INF = 1e18;
int main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll n; cin >> n;
vi A(n); FOR(i,0,n) cin >> A[i];
sort(rall(A));
A[0] = 0;
ll sum = accumulate(all(A),0);
cout << (sum >= n ? "Puss in Boots" : "Donkey") << endl;
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3592kb
input:
2 2 2
output:
Puss in Boots
result:
ok single line: 'Puss in Boots'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
4 0 47 0 0
output:
Donkey
result:
ok single line: 'Donkey'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3604kb
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: 3600kb
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: 3612kb
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: 3752kb
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: 3592kb
input:
5 0 0 0 0 0
output:
Donkey
result:
wrong answer 1st lines differ - expected: 'Puss in Boots', found: 'Donkey'