結果

問題 No.1579 New Type of Nim
ユーザー ks2mks2m
提出日時 2021-07-02 22:06:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 2,217 ms
コンパイル使用メモリ 71,900 KB
実行使用メモリ 57,720 KB
最終ジャッジ日時 2023-09-30 11:14:46
合計ジャッジ時間 7,830 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
56,068 KB
testcase_01 AC 124 ms
55,824 KB
testcase_02 AC 123 ms
55,820 KB
testcase_03 AC 125 ms
56,044 KB
testcase_04 AC 123 ms
56,096 KB
testcase_05 AC 125 ms
56,040 KB
testcase_06 AC 124 ms
56,152 KB
testcase_07 AC 125 ms
55,816 KB
testcase_08 AC 123 ms
55,848 KB
testcase_09 AC 123 ms
56,044 KB
testcase_10 AC 124 ms
55,832 KB
testcase_11 AC 124 ms
55,768 KB
testcase_12 AC 126 ms
55,812 KB
testcase_13 AC 125 ms
55,920 KB
testcase_14 AC 124 ms
56,064 KB
testcase_15 AC 125 ms
55,700 KB
testcase_16 AC 125 ms
55,728 KB
testcase_17 AC 126 ms
55,772 KB
testcase_18 AC 125 ms
56,160 KB
testcase_19 AC 125 ms
56,044 KB
testcase_20 AC 125 ms
55,868 KB
testcase_21 AC 123 ms
55,636 KB
testcase_22 AC 124 ms
55,796 KB
testcase_23 AC 124 ms
56,216 KB
testcase_24 AC 125 ms
56,132 KB
testcase_25 AC 125 ms
57,720 KB
testcase_26 AC 126 ms
55,836 KB
testcase_27 AC 126 ms
54,464 KB
testcase_28 AC 125 ms
56,020 KB
testcase_29 AC 124 ms
56,348 KB
testcase_30 AC 123 ms
55,728 KB
testcase_31 AC 124 ms
55,840 KB
testcase_32 AC 125 ms
55,792 KB
testcase_33 AC 125 ms
55,828 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 (y - x <= 1 && x % 2 == 1) {
			System.out.println("Q");
		} else {
			System.out.println("P");
		}
	}
}
0