QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#795135 | #9784. Donkey and Puss in Boots | ucup-team139 | Compile Error | / | / | C++23 | 387b | 2024-11-30 18:02:36 | 2024-11-30 18:02:39 |
Judging History
answer
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
int n;
cin >> n;
long long sum = 0;
vector<int> v(n);
for (auto &i : v)
{
cin >> i;
sum += i;
}
sort(v.rbegin(), v.rend());
if (sum - v[0] < n)
{
cout << "Donkey\n";
}
else
{
cout << "Puss in Boots\n";
}
}
详细
answer.code: In function ‘int main()’: answer.code:13:3: error: ‘vector’ was not declared in this scope 13 | vector<int> v(n); | ^~~~~~ answer.code:3:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’? 2 | #include <algorithm> +++ |+#include <vector> 3 | using namespace std; answer.code:13:10: error: expected primary-expression before ‘int’ 13 | vector<int> v(n); | ^~~ answer.code:14:18: error: ‘v’ was not declared in this scope 14 | for (auto &i : v) | ^ answer.code:20:8: error: ‘v’ was not declared in this scope 20 | sort(v.rbegin(), v.rend()); | ^