結果

問題 No.1026 OGAWA's New Keyboard
ユーザー tenten
提出日時 2021-02-09 07:58:21
言語 Java
(openjdk 23)
結果
AC  
実行時間 693 ms / 1,000 ms
コード長 534 bytes
コンパイル時間 2,280 ms
コンパイル使用メモリ 74,548 KB
実行使用メモリ 66,012 KB
最終ジャッジ日時 2024-07-06 13:28:30
合計ジャッジ時間 8,389 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

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