結果
問題 |
No.2339 Factorial Paths
|
ユーザー |
|
提出日時 | 2025-06-16 23:23:38 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 232 ms / 2,000 ms |
コード長 | 975 bytes |
コンパイル時間 | 347 ms |
コンパイル使用メモリ | 82,308 KB |
実行使用メモリ | 108,676 KB |
最終ジャッジ日時 | 2025-06-16 23:23:49 |
合計ジャッジ時間 | 10,013 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
## https://yukicoder.me/problems/no/2339 from collections import deque def main(): N = int(input()) if N == 1: print(2, 2) print("..") print("#.") return dot = [["#" for _ in range(2000)] for _ in range(2000)] index_h = 0 index_w = 0 queue = deque() queue.append(N) while len(queue) > 0: n = queue.popleft() n1 = n // 2 n2 = n - n1 for i in range(index_h, index_h + n1 + 1): for j in range(index_w, index_w+ n2 + 1): dot[i][j] = "." index_h += n1 index_w += n2 if n1 > 1: queue.append(n1) if n2 > 1: queue.append(n2) H = index_h + 1 W = index_w + 1 print(H, W) for h in range(H): array = [] for w in range(W): array.append(dot[h][w]) row = "".join(array) print(row) if __name__ == "__main__": main()