結果
問題 |
No.1026 OGAWA's New Keyboard
|
ユーザー |
![]() |
提出日時 | 2021-07-14 19:00:33 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 26 ms / 1,000 ms |
コード長 | 398 bytes |
コンパイル時間 | 96 ms |
コンパイル使用メモリ | 29,056 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-03 19:09:13 |
合計ジャッジ時間 | 1,034 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 21 |
ソースコード
#include<stdio.h> int main() { int n; scanf("%d", &n); int i; int t; char c; char ans[500005]; int l, r; l = r = 200005; scanf("%d %c", &t, &c); ans[r] = c; r++; l--; for (i = 1; i < n; i++) { scanf("%d %c", &t, &c); if (t > 0) { ans[l] = c; l--; } else { ans[r] = c; r++; } } for (i = l + 1; i < r; i++) printf("%c", ans[i]); printf("\n"); return 0; }