結果

問題 No.85 TVザッピング(1)
ユーザー YamaKasa
提出日時 2018-07-05 02:20:35
言語 Java
(openjdk 23)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 530 bytes
コンパイル時間 2,060 ms
コンパイル使用メモリ 74,928 KB
実行使用メモリ 54,296 KB
最終ジャッジ日時 2024-07-01 02:20:51
合計ジャッジ時間 7,038 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M = scan.nextInt();
		int C = scan.nextInt();
		scan.close();
		if(N == 1 || M == 1) {
			if(N == 1 && M == 1) {
				System.out.println("YES");
			}else if(N == 2 || M == 2){
				System.out.println("YES");
			}else {
				System.out.println("NO");
			}
		}else if(N % 2 == 1 && M % 2 == 1) {
			System.out.println("NO");
		}else {
			System.out.println("YES");
		}
	}
}
0