답안 #381401

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
381401 2021-03-25T07:26:45 Z D_B Košnja (COCI17_kosnja) C++17
컴파일 오류
0 ms 0 KB
#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';
        }
    }
}

Compilation message

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)
      |     ^~~