제출 #562814

#제출 시각아이디문제언어결과실행 시간메모리
562814silv723Cluedo (IOI10_cluedo)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> void Solve(){ int k=1; vector<int> v={0,0,1,1}; while(k){ v[k]++; cout<<v[1]<<" "<<v[2]<<" "<<v[3]<<endl; cin>>k; } }

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

cluedo.cpp: In function 'void Solve()':
cluedo.cpp:4:3: error: 'vector' was not declared in this scope; did you mean 'std::vector'?
    4 |   vector<int> v={0,0,1,1};
      |   ^~~~~~
      |   std::vector
In file included from /usr/include/c++/10/vector:67,
                 from /usr/include/c++/10/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
                 from cluedo.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector' declared here
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
cluedo.cpp:4:10: error: expected primary-expression before 'int'
    4 |   vector<int> v={0,0,1,1};
      |          ^~~
cluedo.cpp:6:5: error: 'v' was not declared in this scope
    6 |     v[k]++;
      |     ^
cluedo.cpp:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |     cout<<v[1]<<" "<<v[2]<<" "<<v[3]<<endl;
      |     ^~~~
      |     std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:75,
                 from cluedo.cpp:1:
/usr/include/c++/10/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;  /// Linked to standard output
      |                  ^~~~
cluedo.cpp:7:39: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |     cout<<v[1]<<" "<<v[2]<<" "<<v[3]<<endl;
      |                                       ^~~~
      |                                       std::endl
In file included from /usr/include/c++/10/istream:39,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from cluedo.cpp:1:
/usr/include/c++/10/ostream:681:5: note: 'std::endl' declared here
  681 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
cluedo.cpp:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |     cin>>k;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:75,
                 from cluedo.cpp:1:
/usr/include/c++/10/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;  /// Linked to standard input
      |                  ^~~