結果
| 問題 | 
                            No.1026 OGAWA's New Keyboard
                             | 
                    
| ユーザー | 
                             gon_027
                         | 
                    
| 提出日時 | 2020-04-20 23:01:09 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 44 ms / 1,000 ms | 
| コード長 | 1,135 bytes | 
| コンパイル時間 | 740 ms | 
| コンパイル使用メモリ | 86,648 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-09-16 05:04:47 | 
| 合計ジャッジ時間 | 1,630 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 21 | 
ソースコード
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <deque>
using namespace std;
#define next '\n'
#define sp " "
#define print(x) cout << (x)
#define println(x) cout << (x) << next
#define stop return(0)
#define rep(i, n) for(int (i) = (0); (i) < (n); (++i))
#define FOR(i, start, end) for(int (i) = (start); (i) < (end); (++i))
#define foreach(e, elem) for(auto& (e) : (elem))
#define debug(elem) foreach(e, elem){ cout << e << sp; } cout << next
#define FAST ios::sync_with_stdio(false); cin.tie(nullptr)
#define size(s) (s).size()
#define all(vec) (vec).begin(), (vec).end()
#define pb(e) push_back(e);
#define INF 1e+8
#define PI acos(-1)
using ll = long long;
using ull = unsigned long long;
ll MOD = 1000000007;
deque<char> de;
int main(){
    int n;
    cin >> n;
    rep(i, n){
        int t;
        char c;
        cin >> t >> c;
        if(t == 0){
            de.pb(c);
        }else{
            de.push_front(c);
        }
    }
    for(char & it : de){
        cout << it;
    }
    cout << endl;
}
            
            
            
        
            
gon_027