# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
776285 | benjaminkleyn | 게임 (IOI14_game) | C++17 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "game.h"
#include <bits/stdc++.h>
int out[1500];
void initialize(int n)
{
iota(out, out + n, 0);
}
int hasEdge(int u, int v)
{
if (u < v) swap(u, v);
return (--out[u]) == 0;
}
컴파일 시 표준 에러 (stderr) 메시지
game.cpp: In function 'void initialize(int)': game.cpp:7:5: error: 'iota' was not declared in this scope; did you mean 'std::iota'? 7 | iota(out, out + n, 0); | ^~~~ | std::iota In file included from /usr/include/c++/10/numeric:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:84, from game.cpp:2: /usr/include/c++/10/bits/stl_numeric.h:88:5: note: 'std::iota' declared here 88 | iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value) | ^~~~ game.cpp: In function 'int hasEdge(int, int)': game.cpp:11:16: error: 'swap' was not declared in this scope 11 | if (u < v) swap(u, v); | ^~~~ game.cpp:11:16: note: suggested alternatives: In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from game.cpp:2: /usr/include/c++/10/bits/regex.h:2141:5: note: 'std::__cxx11::swap' 2141 | swap(match_results<_Bi_iter, _Alloc>& __lhs, | ^~~~ In file included from /usr/include/c++/10/bits/stl_pair.h:59, from /usr/include/c++/10/bits/stl_algobase.h:64, from /usr/include/c++/10/bits/specfun.h:45, from /usr/include/c++/10/cmath:1927, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41, from game.cpp:2: /usr/include/c++/10/bits/move.h:189:5: note: 'std::swap' 189 | swap(_Tp& __a, _Tp& __b) | ^~~~ /usr/include/c++/10/bits/move.h:189:5: note: 'std::swap' In file included from /usr/include/c++/10/exception:147, from /usr/include/c++/10/ios:39, from /usr/include/c++/10/istream:38, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from game.cpp:2: /usr/include/c++/10/bits/exception_ptr.h:169:5: note: 'std::__exception_ptr::swap' 169 | swap(exception_ptr& __lhs, exception_ptr& __rhs) | ^~~~ In file included from /usr/include/c++/10/filesystem:45, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129, from game.cpp:2: /usr/include/c++/10/bits/fs_path.h:658:15: note: 'std::filesystem::__cxx11::swap' 658 | inline void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); } | ^~~~