結果
| 問題 | No.2432 Flip and Move |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-18 22:39:10 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 644 bytes |
| 記録 | |
| コンパイル時間 | 256 ms |
| コンパイル使用メモリ | 85,116 KB |
| 実行使用メモリ | 52,224 KB |
| 最終ジャッジ日時 | 2026-05-22 10:36:47 |
| 合計ジャッジ時間 | 4,174 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 2 TLE * 1 -- * 33 |
ソースコード
#int(input())
#map(int, input().split())
#list(map(int, input().split()))
H, W = map(int, input().split())
K = int(input())
from math import gcd
N = 2 * H * W // gcd(H, W)
K %= N
ans = [[0] * W for i in range(H)]
for i in range(K):
ux, vx = divmod(i, 2*H)
uy, vy = divmod(i, 2*W)
# if ux % 2 == 1:
# vx = 2*H - vx
# if uy % 2 == 1:
# vy = 2*W - vy
vx = min(vx, 2*H-vx-1)
vy = min(vy, 2*W-vy-1)
# print(H, W, vx, vy)
ans[vx][vy] += 1
for i in range(H):
a = ""
for j in range(W):
if ans[i][j] % 2 == 0:
a += "."
else:
a += "#"
print(a)