QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#806956 | #9784. Donkey and Puss in Boots | rgnerdplayer | Compile Error | / | / | C++23 | 684b | 2024-12-09 17:23:08 | 2024-12-09 17:23:10 |
Judging History
This is the latest submission verdict.
- [2024-12-09 17:23:10]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-12-09 17:23:08]
- Submitted
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
auto solve = [&]() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
i64 sum = accumulate(a.begin(), a.end(), 0LL);
int mx = *max_element(a.begin(), a.end(), 0LL);
bool alice;
if (sum == 0) {
alice = false;
} else {
alice = sum - mx < n;
}
cout << (alice ? "Donkey": "Puss in Boots") << '\n';
};
solve();
return 0;
}
Details
In file included from /usr/include/c++/13/bits/stl_algobase.h:71, from /usr/include/c++/13/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51, from answer.code:1: /usr/include/c++/13/bits/predefined_ops.h: In instantiation of ‘constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Iterator2 = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Compare = long long int]’: /usr/include/c++/13/bits/stl_algo.h:5715:12: required from ‘constexpr _ForwardIterator std::__max_element(_ForwardIterator, _ForwardIterator, _Compare) [with _ForwardIterator = __gnu_cxx::__normal_iterator<int*, vector<int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<long long int>]’ /usr/include/c++/13/bits/stl_algo.h:5766:43: required from ‘constexpr _FIter std::max_element(_FIter, _FIter, _Compare) [with _FIter = __gnu_cxx::__normal_iterator<int*, vector<int> >; _Compare = long long int]’ answer.code:19:30: required from here /usr/include/c++/13/bits/predefined_ops.h:158:30: error: expression cannot be used as a function 158 | { return bool(_M_comp(*__it1, *__it2)); } | ~~~~~~~^~~~~~~~~~~~~~~~