結果

問題 No.1149 色塗りゲーム
ユーザー ks2mks2m
提出日時 2020-08-07 21:33:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 240 ms / 2,000 ms
コード長 552 bytes
コンパイル時間 2,937 ms
コンパイル使用メモリ 73,896 KB
実行使用メモリ 72,640 KB
平均クエリ数 19.82
最終ジャッジ日時 2023-09-24 04:07:12
合計ジャッジ時間 14,751 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 154 ms
72,236 KB
testcase_01 AC 151 ms
72,484 KB
testcase_02 AC 152 ms
72,000 KB
testcase_03 AC 162 ms
72,340 KB
testcase_04 AC 152 ms
71,428 KB
testcase_05 AC 159 ms
72,356 KB
testcase_06 AC 162 ms
72,308 KB
testcase_07 AC 152 ms
72,640 KB
testcase_08 AC 156 ms
71,860 KB
testcase_09 AC 155 ms
72,392 KB
testcase_10 AC 163 ms
71,812 KB
testcase_11 AC 159 ms
72,348 KB
testcase_12 AC 160 ms
72,276 KB
testcase_13 AC 156 ms
69,656 KB
testcase_14 AC 158 ms
72,304 KB
testcase_15 AC 161 ms
71,400 KB
testcase_16 AC 161 ms
72,240 KB
testcase_17 AC 162 ms
72,084 KB
testcase_18 AC 156 ms
72,084 KB
testcase_19 AC 161 ms
71,928 KB
testcase_20 AC 163 ms
71,904 KB
testcase_21 AC 165 ms
71,456 KB
testcase_22 AC 166 ms
72,188 KB
testcase_23 AC 164 ms
72,520 KB
testcase_24 AC 162 ms
71,552 KB
testcase_25 AC 166 ms
72,168 KB
testcase_26 AC 165 ms
72,140 KB
testcase_27 AC 164 ms
72,548 KB
testcase_28 AC 168 ms
72,244 KB
testcase_29 AC 165 ms
71,884 KB
testcase_30 AC 214 ms
72,268 KB
testcase_31 AC 207 ms
72,500 KB
testcase_32 AC 211 ms
72,012 KB
testcase_33 AC 210 ms
72,088 KB
testcase_34 AC 217 ms
72,436 KB
testcase_35 AC 212 ms
71,652 KB
testcase_36 AC 215 ms
71,644 KB
testcase_37 AC 214 ms
71,844 KB
testcase_38 AC 218 ms
71,564 KB
testcase_39 AC 214 ms
71,976 KB
testcase_40 AC 222 ms
72,452 KB
testcase_41 AC 218 ms
71,872 KB
testcase_42 AC 231 ms
72,044 KB
testcase_43 AC 215 ms
72,152 KB
testcase_44 AC 226 ms
72,108 KB
testcase_45 AC 228 ms
72,000 KB
testcase_46 AC 240 ms
72,392 KB
testcase_47 AC 232 ms
69,624 KB
testcase_48 AC 231 ms
72,160 KB
testcase_49 AC 237 ms
72,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if (n % 2 == 0) {
			System.out.println("2 " + (n / 2));
		} else {
			System.out.println("1 " + (n / 2 + 1));
		}
		while (true) {
			int t = sc.nextInt();
			if (t != 3) {
				break;
			}
			int k = sc.nextInt();
			int x = sc.nextInt();
			if (k == 1) {
				System.out.println("1 " + (n + 1 - x));
			} else {
				System.out.println("2 " + (n - x));
			}
		}
		sc.close();
	}
}
0