結果
問題 | No.85 TVザッピング(1) |
ユーザー |
![]() |
提出日時 | 2014-12-05 23:07:28 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,287 bytes |
コンパイル時間 | 707 ms |
コンパイル使用メモリ | 109,356 KB |
実行使用メモリ | 27,392 KB |
最終ジャッジ日時 | 2024-06-11 15:48:30 |
合計ジャッジ時間 | 2,287 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 2 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;using System.Linq;class Program85{public static void Main(string[] args){var line = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();int n = line[0];int m = line[1];if (n == 1 || m == 1){Console.WriteLine("NO");return;}{int x = 1;for (int y = 0; y < m; y++){if (x == 1){x = n - 1;}else{x = 1;}}if (x == 1){Console.WriteLine("YES");return;}}{int y = 1;for (int x = 0; x < n; x++){if (y == 1){y = m - 1;}else{y = 1;}}if (y == 1){Console.WriteLine("YES");return;}}Console.WriteLine("NO");}}