Submission #92193

#TimeUsernameProblemLanguageResultExecution timeMemory
92193CPXGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "game.h" int ctr[2000]; int n; void initialize(int n) { ::n=n; } int hasEdge(int u, int v) { if(v<u)swap(v,u); ctr[v]++; return (ctr[v]==n-1); }

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:12:12: error: 'swap' was not declared in this scope
     if(v<u)swap(v,u);
            ^~~~
game.cpp:12:12: note: suggested alternatives:
In file included from /usr/include/c++/7/complex:45:0,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from game.cpp:1:
/usr/include/c++/7/sstream:796:5: note:   'std::__cxx11::swap'
     swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x,
     ^~~~
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from game.cpp:1:
/usr/include/c++/7/bits/regex.h:1958:5: note:   'std::__cxx11::swap'
     swap(match_results<_Bi_iter, _Alloc>& __lhs,
     ^~~~
In file included from /usr/include/c++/7/exception:142:0,
                 from /usr/include/c++/7/ios:39,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from game.cpp:1:
/usr/include/c++/7/bits/exception_ptr.h:166:5: note:   'std::__exception_ptr::swap'
     swap(exception_ptr& __lhs, exception_ptr& __rhs)
     ^~~~
In file included from /usr/include/c++/7/bits/nested_exception.h:40:0,
                 from /usr/include/c++/7/exception:143,
                 from /usr/include/c++/7/ios:39,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from game.cpp:1:
/usr/include/c++/7/bits/move.h:187:5: note:   'std::swap'
     swap(_Tp& __a, _Tp& __b)
     ^~~~