結果
問題 | No.883 ぬりえ |
ユーザー | tktk_snsn |
提出日時 | 2020-12-24 01:47:23 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 794 bytes |
コンパイル時間 | 363 ms |
コンパイル使用メモリ | 81,788 KB |
実行使用メモリ | 87,004 KB |
最終ジャッジ日時 | 2023-10-21 15:29:12 |
合計ジャッジ時間 | 2,767 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 31 ms
53,536 KB |
testcase_01 | AC | 33 ms
53,536 KB |
testcase_02 | AC | 33 ms
53,536 KB |
testcase_03 | AC | 31 ms
53,536 KB |
testcase_04 | AC | 31 ms
53,536 KB |
testcase_05 | AC | 31 ms
53,536 KB |
testcase_06 | AC | 31 ms
53,536 KB |
testcase_07 | WA | - |
testcase_08 | AC | 32 ms
53,536 KB |
testcase_09 | WA | - |
testcase_10 | AC | 31 ms
53,536 KB |
testcase_11 | AC | 31 ms
53,536 KB |
testcase_12 | AC | 30 ms
53,536 KB |
testcase_13 | AC | 29 ms
53,536 KB |
testcase_14 | AC | 38 ms
59,088 KB |
testcase_15 | AC | 99 ms
87,004 KB |
testcase_16 | AC | 69 ms
80,036 KB |
testcase_17 | AC | 62 ms
77,664 KB |
testcase_18 | AC | 36 ms
59,088 KB |
testcase_19 | AC | 32 ms
53,536 KB |
testcase_20 | WA | - |
ソースコード
N, K = map(int, input().split()) if N == K * (K + 1): print(K + 1) for i in range(N): for j in range(N): if i == j: print(".", end="") else: print("#", end="") print() exit() d, m = divmod(N, K * K) r = 0 while True: if r * r >= m: break r += 1 size = K * d + r res = [[0] * size for _ in range(size)] p = 0 for _ in range(d): for i in range(K): for j in range(K): res[p + i][p + j] = N N = max(0, N-1) p += K for i in range(r): for j in range(r): res[p + i][p + j] = N N = max(0, N-1) print(size) for r in res: for i in r: if i: print("#", end="") else: print(".", end="") print()