結果

問題 No.1026 OGAWA's New Keyboard
ユーザー tentententen
提出日時 2021-02-09 07:58:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 607 ms / 1,000 ms
コード長 534 bytes
コンパイル時間 2,103 ms
コンパイル使用メモリ 72,892 KB
実行使用メモリ 63,048 KB
最終ジャッジ日時 2023-09-20 18:35:34
合計ジャッジ時間 10,076 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,396 KB
testcase_01 AC 129 ms
55,540 KB
testcase_02 AC 129 ms
55,868 KB
testcase_03 AC 128 ms
55,700 KB
testcase_04 AC 607 ms
63,048 KB
testcase_05 AC 208 ms
59,388 KB
testcase_06 AC 218 ms
59,460 KB
testcase_07 AC 517 ms
62,752 KB
testcase_08 AC 194 ms
58,796 KB
testcase_09 AC 135 ms
55,844 KB
testcase_10 AC 177 ms
56,808 KB
testcase_11 AC 176 ms
56,340 KB
testcase_12 AC 143 ms
55,596 KB
testcase_13 AC 128 ms
55,708 KB
testcase_14 AC 134 ms
55,692 KB
testcase_15 AC 141 ms
55,828 KB
testcase_16 AC 168 ms
56,572 KB
testcase_17 AC 360 ms
60,688 KB
testcase_18 AC 179 ms
56,604 KB
testcase_19 AC 347 ms
60,492 KB
testcase_20 AC 138 ms
55,288 KB
testcase_21 AC 129 ms
55,676 KB
testcase_22 AC 172 ms
56,296 KB
testcase_23 AC 171 ms
56,520 KB
testcase_24 AC 478 ms
62,776 KB
testcase_25 AC 174 ms
56,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        StringBuilder head = new StringBuilder();
        StringBuilder tail = new StringBuilder();
        for (int i = 0; i < n; i++) {
            if (sc.next().charAt(0) == '0') {
                tail.append(sc.next());
            } else {
                head.append(sc.next());
            }
        }
        System.out.println(head.reverse().append(tail));
    }
}
0