foo.cc:2:7: error: expected nested-name-specifier before 'nameapce'
2 | using nameapce std;
| ^~~~~~~~
foo.cc: In function 'int find(int)':
foo.cc:12:26: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
12 | int mid=l+r>>1;
| ~^~
foo.cc: In function 'int main()':
foo.cc:19:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
19 | cin>>n>>m;
| ^~~
| std::cin
In file included from stdc++.h:75:
/nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/iostream:60:18: note: 'std::cin' declared here
60 | extern istream cin; /// Linked to standard input
| ^~~
foo.cc:26:17: error: 'string' was not declared in this scope; did you mean 'std::string'?
26 | string op;int x;
| ^~~~~~
| std::string
In file included from /nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/iosfwd:39,
from /nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/ios:38,
from /nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/istream:38,
from /nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/sstream:38,
from /nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/complex:45,
from /nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/ccomplex:39,
from stdc++.h:54:
/nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/bits/stringfwd.h:77:33: note: 'std::string' declared here
77 | typedef basic_string<char> string;
| ^~~~~~
foo.cc:27:22: error: 'op' was not declared in this scope
27 | cin>>op>>x;
| ^~
foo.cc:47:25: error: 'swap' was not declared in this scope
47 | swap(a[pos],a[id[x]]);
| ^~~~
foo.cc:47:25: note: suggested alternatives:
In file included from /nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/regex:66,
from stdc++.h:110:
/nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/bits/regex.h:2171:5: note: 'std::__cxx11::swap'
2171 | swap(match_results<_Bi_iter, _Alloc>& __lhs,
| ^~~~
In file included from /nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/bits/exception_ptr.h:43,
from /nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/exception:168,
from /nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/ios:39:
/nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/bits/move.h:196:5: note: 'std::swap'
196 | swap(_Tp& __a, _Tp& __b)
| ^~~~
/nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/bits/exception_ptr.h:223:5: note: 'std::__exception_ptr::swap'
223 | swap(exception_ptr& __lhs, exception_ptr& __rhs)
| ^~~~
foo.cc:51:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
51 | cout<<query(id[x])-1<<endl;
| ^~~~
| std::cout
/nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/iostream:61:18: note: 'std::cout' declared here
61 | extern ostream cout; /// Linked to standard output
| ^~~~
foo.cc:51:47: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
51 | cout<<query(id[x])-1<<endl;
| ^~~~
| std::endl
In file included from /nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/istream:39:
/nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/ostream:688:5: note: 'std::endl' declared here
688 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
foo.cc:54:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
54 | cout<<a[find(x)]<<endl;
| ^~~~
| std::cout
/nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/iostream:61:18: note: 'std::cout' declared here
61 | extern ostream cout; /// Linked to standard output
| ^~~~
foo.cc:54:43: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
54 | cout<<a[find(x)]<<endl;
| ^~~~
| std::endl
/nix/store/np14qqgvvnyna3vv640hmhi21flymiia-gcc-12.2.0/include/c++/12.2.0/ostream:688:5: note: 'std::endl' declared here
688 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
[Hydro](https://hydro.ac)提供评测服务