ログイン
新規登録
AtsuoCoder Waseda Tour Finals 2025
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 2a71a426-2bac-444d-9560-c4f917d0f41f
コード
#include <bits/stdc++.h> using namespace std; int main() { queue<int> S; int Q,X,T; cin>>Q; for(int i=0;i<Q;i++){ cin>>T; if(T==1){cin>>X; S.push(X); } else if(T==2){ cin>>X; S.front(X); } else if(T==3){ cout<<S.front()<<endl; S.pop(); } } }
結果
問題
点数
言語
結果
実行時間
メモリ
E - Q2
0
C++
WJ
0 ms
0 KiB
コンパイルエラー
Main.cpp: In function 'int main()': Main.cpp:16:16: error: no matching function for call to 'std::queue<int>::front(int&)' 16 | S.front(X); | ~~~~~~~^~~ In file included from /usr/include/c++/13/queue:66, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:157, from Main.cpp:1: /usr/include/c++/13/bits/stl_queue.h:233:7: note: candidate: 'std::queue<_Tp, _Sequence>::reference std::queue<_Tp, _Sequence>::front() [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; reference = int&]' 233 | front() | ^~~~~ /usr/include/c++/13/bits/stl_queue.h:233:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/13/bits/stl_queue.h:245:7: note: candidate: 'std::queue<_Tp, _Sequence>::const_reference std::queue<_Tp, _Sequence>::front() const [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; const_reference = const int&]' 245 | front() const | ^~~~~ /usr/include/c++/13/bits/stl_queue.h:245:7: note: candidate expects 0 arguments, 1 provided