結果

問題 No.1026 OGAWA's New Keyboard
ユーザー ks2mks2m
提出日時 2020-04-14 16:01:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 331 ms / 1,000 ms
コード長 639 bytes
コンパイル時間 3,473 ms
コンパイル使用メモリ 72,380 KB
実行使用メモリ 59,168 KB
最終ジャッジ日時 2023-10-14 10:00:49
合計ジャッジ時間 6,947 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,232 KB
testcase_01 AC 42 ms
49,164 KB
testcase_02 AC 42 ms
49,340 KB
testcase_03 AC 42 ms
49,280 KB
testcase_04 AC 331 ms
59,168 KB
testcase_05 AC 109 ms
53,152 KB
testcase_06 AC 115 ms
55,256 KB
testcase_07 AC 288 ms
57,120 KB
testcase_08 AC 87 ms
52,128 KB
testcase_09 AC 43 ms
49,348 KB
testcase_10 AC 59 ms
50,264 KB
testcase_11 AC 54 ms
49,372 KB
testcase_12 AC 44 ms
49,336 KB
testcase_13 AC 41 ms
49,348 KB
testcase_14 AC 42 ms
49,248 KB
testcase_15 AC 43 ms
49,444 KB
testcase_16 AC 54 ms
49,460 KB
testcase_17 AC 175 ms
56,544 KB
testcase_18 AC 57 ms
50,136 KB
testcase_19 AC 171 ms
56,044 KB
testcase_20 AC 43 ms
49,484 KB
testcase_21 AC 42 ms
49,672 KB
testcase_22 AC 51 ms
49,348 KB
testcase_23 AC 58 ms
49,548 KB
testcase_24 AC 251 ms
57,144 KB
testcase_25 AC 58 ms
49,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int n = Integer.parseInt(sa[0]);
		StringBuilder sb0 = new StringBuilder();
		StringBuilder sb1 = new StringBuilder();
		for (int i = 0; i < n; i++) {
			sa = br.readLine().split(" ");
			if (sa[0].equals("0")) {
				sb0.append(sa[1]);
			} else {
				sb1.append(sa[1]);
			}
		}
		br.close();

		sb1.reverse();
		sb1.append(sb0);
		System.out.println(sb1.toString());
	}
}
0