제출 #381401

#제출 시각아이디문제언어결과실행 시간메모리
381401D_BKošnja (COCI17_kosnja)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namesoace std; int main(){ int t; cin>>t; for (int i = 1;i<=t;i++){ int x,y; cin>>x>>y; if (x==1 || y==1){ cout<<0<<'\n'; } else{ cout<<(min(x,y)-1)*2<<'\n'; } } }

컴파일 시 표준 에러 (stderr) 메시지

kosnja.cpp:2:7: error: expected nested-name-specifier before 'namesoace'
    2 | using namesoace std;
      |       ^~~~~~~~~
kosnja.cpp: In function 'int main()':
kosnja.cpp:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |     cin>>t;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:75,
                 from kosnja.cpp:1:
/usr/include/c++/9/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;  /// Linked to standard input
      |                  ^~~
kosnja.cpp:10:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |             cout<<0<<'\n';
      |             ^~~~
      |             std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:75,
                 from kosnja.cpp:1:
/usr/include/c++/9/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;  /// Linked to standard output
      |                  ^~~~
kosnja.cpp:13:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |             cout<<(min(x,y)-1)*2<<'\n';
      |             ^~~~
      |             std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:75,
                 from kosnja.cpp:1:
/usr/include/c++/9/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;  /// Linked to standard output
      |                  ^~~~
kosnja.cpp:13:20: error: 'min' was not declared in this scope; did you mean 'std::min'?
   13 |             cout<<(min(x,y)-1)*2<<'\n';
      |                    ^~~
      |                    std::min
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from kosnja.cpp:1:
/usr/include/c++/9/bits/stl_algo.h:3450:5: note: 'std::min' declared here
 3450 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~