ログイン
新規登録
AtsuoCoder Petrozavodsk Contest 001
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 922f8437-0ae1-49d3-9673-4e86cfb0c71b
コード
#include <bits/stdc++.h> using namespace std; int main() { int Q,T,X; cin>>Q; vector<int> vec(A); for (int i = 0; i < Q; i++) { if (T=1) {cin>>X; vec.vector(X); } else if (T=2) { cout << vec.at(1) << endl; vec.pop_back(1); } else { cout << str.size() << endl; } }
結果
問題
点数
言語
結果
実行時間
メモリ
E - Q
0
C++
WJ
0 ms
0 KiB
コンパイルエラー
Main.cpp: In function 'int main()': Main.cpp:7:17: error: 'A' was not declared in this scope 7 | vector<int> vec(A); | ^ Main.cpp:10:9: error: invalid use of 'std::vector<int>::vector' 10 | vec.vector(X); | ^~~~~~ Main.cpp:15:15: error: no matching function for call to 'std::vector<int>::pop_back(int)' 15 | vec.pop_back(1); | ~~~~~~~~~~~~^~~ In file included from /usr/include/c++/13/vector:66, from /usr/include/c++/13/functional:64, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53, from Main.cpp:1: /usr/include/c++/13/bits/stl_vector.h:1322:7: note: candidate: 'constexpr void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = int; _Alloc = std::allocator<int>]' 1322 | pop_back() _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/13/bits/stl_vector.h:1322:7: note: candidate expects 0 arguments, 1 provided Main.cpp:18:11: error: 'str' was not declared in this scope; did you mean 'std'? 18 | cout << str.size() << endl; | ^~~ | std Main.cpp:23:2: error: expected '}' at end of input 23 | } | ^ Main.cpp:4:12: note: to match this '{' 4 | int main() { | ^