ログイン
新規登録
AtsuoCoder Petrozavodsk Contest 001
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 7a5e53c4-bd4d-44ef-b6a7-e67b7ebc9351
コード
#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++) { cin>>T; 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:11:9: error: invalid use of 'std::vector<int>::vector' 11 | vec.vector(X); | ^~~~~~ Main.cpp:16:15: error: no matching function for call to 'std::vector<int>::pop_back(int)' 16 | 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:19:11: error: 'str' was not declared in this scope; did you mean 'std'? 19 | cout << str.size() << endl; | ^~~ | std Main.cpp:24:2: error: expected '}' at end of input 24 | } | ^ Main.cpp:4:12: note: to match this '{' 4 | int main() { | ^