QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#774624#9784. Donkey and Puss in Bootsucup-team5697#WA 1ms3832kbC++14655b2024-11-23 13:34:112024-11-23 13:34:11

Judging History

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

  • [2024-11-23 13:34:11]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3832kb
  • [2024-11-23 13:34:11]
  • 提交

answer

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#define mems(x, v) memset(x, v, sizeof x)
#define mcpy(x, y) memcpy(x, y, sizeof x)
using namespace std;
typedef pair <int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
typedef long double wisdom;

int a[100005];
int main() {
	int n; ll cnt = 0, ans = 0; scanf("%d", &n);
	for (int i = 1, x; i <= n; i++) scanf("%d", &a[i]), cnt += a[i];
	if (!cnt) return puts("Donkey"), 0;
	sort(a + 1, a + n + 1);
	for (int i = 1; i < n; i++) ans += a[i];
	puts(ans >= n ? "Puss in Boots" : "Donkey");
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3744kb

input:

2
2 2

output:

Puss in Boots

result:

ok single line: 'Puss in Boots'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3672kb

input:

4
0 47 0 0

output:

Donkey

result:

ok single line: 'Donkey'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

4
0 47 0 0

output:

Donkey

result:

ok single line: 'Donkey'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3740kb

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: 1ms
memory: 3656kb

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: 3832kb

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: 3804kb

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: 3556kb

input:

5
0 0 0 0 0

output:

Donkey

result:

wrong answer 1st lines differ - expected: 'Puss in Boots', found: 'Donkey'