結果

問題 No.1026 OGAWA's New Keyboard
ユーザー はむ吉🐹はむ吉🐹
提出日時 2020-04-14 20:34:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 421 ms / 1,000 ms
コード長 454 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 25,956 KB
最終ジャッジ日時 2023-10-14 10:03:49
合計ジャッジ時間 2,867 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,528 KB
testcase_01 AC 20 ms
8,648 KB
testcase_02 AC 20 ms
8,656 KB
testcase_03 AC 19 ms
8,648 KB
testcase_04 AC 421 ms
25,956 KB
testcase_05 AC 30 ms
9,016 KB
testcase_06 AC 35 ms
9,136 KB
testcase_07 AC 268 ms
18,924 KB
testcase_08 AC 26 ms
8,872 KB
testcase_09 AC 18 ms
8,492 KB
testcase_10 AC 21 ms
8,684 KB
testcase_11 AC 20 ms
8,668 KB
testcase_12 AC 19 ms
8,520 KB
testcase_13 AC 18 ms
8,592 KB
testcase_14 AC 18 ms
8,636 KB
testcase_15 AC 19 ms
8,524 KB
testcase_16 AC 20 ms
8,524 KB
testcase_17 AC 118 ms
12,496 KB
testcase_18 AC 21 ms
8,500 KB
testcase_19 AC 105 ms
12,272 KB
testcase_20 AC 19 ms
8,512 KB
testcase_21 AC 18 ms
8,488 KB
testcase_22 AC 20 ms
8,604 KB
testcase_23 AC 20 ms
8,504 KB
testcase_24 AC 219 ms
16,856 KB
testcase_25 AC 21 ms
8,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3


import collections


def compute(entries):
    q = collections.deque()
    for t, s in entries:
        if t == 0:
            q.append(s)
        else:
            q.appendleft(s)
    return "".join(q)


def main():
    n = int(input())
    entries = []
    for _ in range(n):
        t0, s = input().split()
        entries.append((int(t0), s))
    res = compute(entries)
    print(res)


if __name__ == "__main__":
    main()
0