結果
問題 | No.85 TVザッピング(1) |
ユーザー |
|
提出日時 | 2015-11-21 18:40:26 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 122 ms / 5,000 ms |
コード長 | 652 bytes |
コンパイル時間 | 3,731 ms |
コンパイル使用メモリ | 77,760 KB |
実行使用メモリ | 41,272 KB |
最終ジャッジ日時 | 2024-10-04 17:43:58 |
合計ジャッジ時間 | 7,201 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
import java.util.Scanner; public class Main_yukicoder85 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); int w = sc.nextInt(); @SuppressWarnings("unused") int c = sc.nextInt(); int b = Math.max(h, w); int s = Math.min(h, w); if (s == 1 && b > 2) { System.out.println("NO"); } else if (s == 1 && b <= 2) { System.out.println("YES"); } else if (s % 2 == 1 && b % 2 == 1) { System.out.println("NO"); } else { System.out.println("YES"); } sc.close(); } }