結果

問題 No.1579 New Type of Nim
ユーザー ks2mks2m
提出日時 2021-07-02 22:06:18
言語 Java
(openjdk 23)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 2,201 ms
コンパイル使用メモリ 75,820 KB
実行使用メモリ 54,372 KB
最終ジャッジ日時 2024-07-23 05:19:52
合計ジャッジ時間 7,617 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

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