結果
| 問題 | 
                            No.1026 OGAWA's New Keyboard
                             | 
                    
| ユーザー | 
                             kyo1
                         | 
                    
| 提出日時 | 2020-07-16 03:22:26 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 19 ms / 1,000 ms | 
| コード長 | 478 bytes | 
| コンパイル時間 | 2,531 ms | 
| コンパイル使用メモリ | 196,764 KB | 
| 最終ジャッジ日時 | 2025-01-11 21:22:45 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 21 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<char> H, T;
  for (int i = 0; i < N; i++) {
    int t;
    char s;
    cin >> t >> s;
    if (t == 0) {
      T.emplace_back(s);
    } else {
      H.emplace_back(s);
    }
  }
  string res = "";
  reverse(H.begin(), H.end());
  for (char h : H) {
    res += h;
  }
  for (char t : T) {
    res += t;
  }
  cout << res << '\n';
  return 0;
}
            
            
            
        
            
kyo1