結果

問題 No.1149 色塗りゲーム
ユーザー ks2m
提出日時 2020-08-07 21:33:06
言語 Java
(openjdk 23)
結果
AC  
実行時間 318 ms / 2,000 ms
コード長 552 bytes
コンパイル時間 2,235 ms
コンパイル使用メモリ 76,408 KB
実行使用メモリ 73,208 KB
平均クエリ数 19.82
最終ジャッジ日時 2024-07-17 04:17:14
合計ジャッジ時間 17,261 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

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