結果
| 問題 |
No.85 TVザッピング(1)
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-15 21:58:50 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 694 bytes |
| コンパイル時間 | 194 ms |
| コンパイル使用メモリ | 82,712 KB |
| 実行使用メモリ | 53,720 KB |
| 最終ジャッジ日時 | 2025-04-15 21:59:28 |
| 合計ジャッジ時間 | 2,382 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 WA * 2 |
ソースコード
n, m, c = map(int, input().split())
# Calculate the position (X, Y) of channel C
x = (c - 1) // m + 1
y = (c - 1) % m + 1
# Check if the grid is 1x1 (but according to problem statement, at least one of N or M is >=2)
# So no need to handle 1x1 case.
# Check if the grid is single row or column
if n == 1 or m == 1:
if n * m == 2:
print("YES")
else:
print("NO")
else:
# Check if either dimension is even
if n % 2 == 0 or m % 2 == 0:
print("YES")
else:
# Both are odd, check if C is at a corner
is_corner = (x == 1 or x == n) and (y == 1 or y == m)
if is_corner:
print("NO")
else:
print("YES")
lam6er