結果

問題 No.1579 New Type of Nim
ユーザー ks2mks2m
提出日時 2021-07-02 22:05:29
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 2,147 ms
コンパイル使用メモリ 71,640 KB
実行使用メモリ 56,600 KB
最終ジャッジ日時 2023-09-11 21:58:54
合計ジャッジ時間 7,737 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,788 KB
testcase_01 AC 119 ms
55,792 KB
testcase_02 AC 117 ms
56,600 KB
testcase_03 AC 114 ms
55,716 KB
testcase_04 AC 116 ms
55,916 KB
testcase_05 AC 116 ms
55,536 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 120 ms
55,864 KB
testcase_10 WA -
testcase_11 AC 120 ms
55,884 KB
testcase_12 AC 119 ms
55,644 KB
testcase_13 AC 117 ms
55,676 KB
testcase_14 AC 118 ms
55,748 KB
testcase_15 AC 120 ms
55,356 KB
testcase_16 AC 120 ms
55,640 KB
testcase_17 AC 118 ms
55,852 KB
testcase_18 AC 118 ms
56,004 KB
testcase_19 AC 123 ms
53,296 KB
testcase_20 AC 121 ms
55,740 KB
testcase_21 AC 121 ms
55,644 KB
testcase_22 AC 123 ms
55,620 KB
testcase_23 AC 120 ms
55,860 KB
testcase_24 AC 121 ms
55,552 KB
testcase_25 AC 125 ms
55,752 KB
testcase_26 WA -
testcase_27 AC 122 ms
55,964 KB
testcase_28 AC 122 ms
55,744 KB
testcase_29 AC 121 ms
55,520 KB
testcase_30 AC 119 ms
53,960 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 119 ms
55,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		sc.close();

		int x = Math.min(a, b);
		int y = Math.max(a, b);
		if (x - y <= 1 && x % 2 == 1) {
			System.out.println("Q");
		} else {
			System.out.println("P");
		}
	}
}
0