結果
| 問題 | 
                            No.1026 OGAWA's New Keyboard
                             | 
                    
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-04-14 15:58:23 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 23 ms / 1,000 ms | 
| コード長 | 525 bytes | 
| コンパイル時間 | 3,856 ms | 
| コンパイル使用メモリ | 88,032 KB | 
| 最終ジャッジ日時 | 2025-01-09 18:41:55 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 21 | 
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <numeric>
using namespace std;
typedef long long int ll;
int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	stack<char> s;
	queue<char> q;
	for(int i=0;i<n;i++){
		int t; cin >> t;
		char c; cin >> c;
		if(t==0){
			q.push(c);
		}else{
			s.push(c);
		}
	}
	while(s.size()){
		cout << s.top();
		s.pop();
	}
	while(q.size()){
		cout << q.front();
		q.pop();
	}
	cout << endl;
}