ログイン
新規登録
AtsuoCoder Petrozavodsk Contest 001
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 19af6181-49ff-4558-b0f7-55e75c2ccb41
コード
#include <vector> #include <iostream> #include <queue> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int Q; cin >> Q; queue<long long> A; vector<long long> ans; for (int i = 0; i < Q; i++) { int T; cin >> T; if (T == 1) { long long X; cin >> X; A.push(X); } else if (T == 2) { ans.push_back(A.front()); A.pop(); } else { // T == 3 ans.push_back((long long)A.size()); } } for (auto v : ans) { cout << v << "\n"; } return 0; }
結果
問題
点数
言語
結果
実行時間
メモリ
E - Q
100
C++
AC
12 ms
4268 KiB