Submission #545392

#TimeUsernameProblemLanguageResultExecution timeMemory
545392Trisanu_DasLabels (NOI20_labels)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namepsace std; int main(){ int n; cin >> n; int d[n - 1]; for(int i = 0; i < n - 1; i++) cin >> d[i]; if(d[0] == 1) cout << 1 << ' ' << 2 << '\n'; else if(d[0] == -1) cout << 2 << ' ' << 1 << '\n'; else cout << -1 << '\n'; }

Compilation message (stderr)

Labels.cpp:2:7: error: expected nested-name-specifier before 'namepsace'
    2 | using namepsace std;
      |       ^~~~~~~~~
Labels.cpp: In function 'int main()':
Labels.cpp:5:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   int n; cin >> n;
      |          ^~~
      |          std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:75,
                 from Labels.cpp:1:
/usr/include/c++/10/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;  /// Linked to standard input
      |                  ^~~
Labels.cpp:7:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   if(d[0] == 1) cout << 1 << ' ' << 2 << '\n';
      |                 ^~~~
      |                 std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:75,
                 from Labels.cpp:1:
/usr/include/c++/10/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;  /// Linked to standard output
      |                  ^~~~
Labels.cpp:8:23: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   else if(d[0] == -1) cout << 2 << ' ' << 1 << '\n';
      |                       ^~~~
      |                       std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:75,
                 from Labels.cpp:1:
/usr/include/c++/10/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;  /// Linked to standard output
      |                  ^~~~
Labels.cpp:9:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   else cout << -1 << '\n';
      |        ^~~~
      |        std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:75,
                 from Labels.cpp:1:
/usr/include/c++/10/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;  /// Linked to standard output
      |                  ^~~~