Submission #40475
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #include <bits/stdc++.h> using namespace std; #define FOR(i,n) for(int i=0;i<n;i++) #define why(n,x) int n;while(cin >>n,n!=x) #define iFOR(i,x,n)for(int i=x;i<n;i++) int dx[]={1,0,-1,0}; int dy[]={0,-1,0,1}; int dxx[]={1,1,0,-1,-1,-1,0,1}; int dyy[]={0,-1,-1,-1,0,1,1,1}; bool inside( int x, int y, int w, int h){ return (x>=0 && y>=0 && x<w && y<h);} typedef long long ll; typedef pair< int , int > pii; int main(){ cin.tie(0), ios::sync_with_stdio( false ); int a; queue< int > hoge; string str; while (cin>>str,str!= "exit" ){ if (str== "push" ){ cin >>a; hoge.push(a); } if (str== "front" ) cout<< hoge.front()<<endl; if (str== "pop" ) hoge.pop(); } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0601 - プログラミング入門:Queue |
ユーザー名 | ei1821 |
投稿日時 | 2018-08-03 09:24:54 |
言語 | C++11 |
状態 | Accepted |
得点 | 1 |
ソースコード長 | 726 Byte |
最大実行時間 | 513 ms |
最大メモリ使用量 | 20924 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 1 / 1 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
Input01 | AC | 40 ms | 476 KB |
1
|
Input02 | AC | 22 ms | 432 KB |
1
|
Input03 | AC | 22 ms | 392 KB |
1
|
Input04 | AC | 38 ms | 596 KB |
1
|
Input05 | AC | 31 ms | 672 KB |
1
|
Input06 | AC | 60 ms | 1248 KB |
1
|
Input07 | AC | 84 ms | 2272 KB |
1
|
Input08 | AC | 221 ms | 5516 KB |
1
|
Input09 | AC | 342 ms | 11700 KB |
1
|
Input10 | AC | 513 ms | 20924 KB |
1
|