結果
問題 | No.85 TVザッピング(1) |
ユーザー |
![]() |
提出日時 | 2020-09-12 15:28:36 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 25 ms / 5,000 ms |
コード長 | 493 bytes |
コンパイル時間 | 816 ms |
コンパイル使用メモリ | 107,856 KB |
実行使用メモリ | 26,888 KB |
最終ジャッジ日時 | 2025-01-02 02:44:45 |
合計ジャッジ時間 | 2,647 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; public class Hello { static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); var m = int.Parse(line[1]); getAns(n, m); } static void getAns(int n, int m) { string ans; if (n == 1) ans = m == 2 ? "YES" : "NO"; else if (m == 1) ans = n == 2 ? "YES" : "NO"; else ans = n % 2 == 1 && m % 2 == 1 ? "NO" : "YES"; Console.WriteLine(ans); } }