QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#775527#9784. Donkey and Puss in Bootsucup-team191#WA 2ms3868kbC++23526b2024-11-23 16:09:182024-11-23 16:09:18

Judging History

你现在查看的是最新测评结果

  • [2024-11-23 16:09:18]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3868kb
  • [2024-11-23 16:09:18]
  • 提交

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;
}

详细

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'