結果
問題 | No.85 TVザッピング(1) |
ユーザー |
![]() |
提出日時 | 2014-12-05 23:14:06 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 25 ms / 5,000 ms |
コード長 | 1,641 bytes |
コンパイル時間 | 905 ms |
コンパイル使用メモリ | 109,908 KB |
実行使用メモリ | 27,260 KB |
最終ジャッジ日時 | 2024-10-04 17:10:44 |
合計ジャッジ時間 | 2,236 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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;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){if (m == 2){Console.WriteLine("YES");return;}Console.WriteLine("NO");return;}if (m == 1){if (n == 2){Console.WriteLine("YES");return;}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");}}