ログイン
新規登録
AtsuoCoder Petrozavodsk Contest 001
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 2fe7a4dd-39c1-428a-a9de-435f15fe80c6
コード
#include <bits/stdc++.h> using namespace std; int main() { using namespace std; 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 << vec.size() << endl; } } }
結果
問題
点数
言語
結果
実行時間
メモリ
E - Q
0
C++
WJ
0 ms
0 KiB
コンパイルエラー
Main.cpp: In function 'int main()': Main.cpp:8:17: error: 'A' was not declared in this scope 8 | vector<int> vec(A); | ^ Main.cpp:12:9: error: invalid use of 'std::vector<int>::vector' 12 | vec.vector(X); | ^~~~~~ Main.cpp:17:15: error: no matching function for call to 'std::vector<int>::pop_back(int)' 17 | 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