結果

問題 No.883 ぬりえ
ユーザー convexineqconvexineq
提出日時 2021-04-07 21:56:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 636 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 84,564 KB
最終ジャッジ日時 2023-09-05 05:39:37
合計ジャッジ時間 3,589 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,312 KB
testcase_01 AC 71 ms
71,308 KB
testcase_02 AC 70 ms
71,396 KB
testcase_03 AC 71 ms
71,088 KB
testcase_04 AC 70 ms
71,480 KB
testcase_05 AC 71 ms
71,232 KB
testcase_06 AC 70 ms
71,288 KB
testcase_07 AC 70 ms
71,312 KB
testcase_08 AC 71 ms
71,404 KB
testcase_09 AC 68 ms
71,208 KB
testcase_10 AC 70 ms
71,480 KB
testcase_11 AC 70 ms
71,312 KB
testcase_12 AC 71 ms
71,404 KB
testcase_13 AC 71 ms
71,156 KB
testcase_14 AC 75 ms
75,472 KB
testcase_15 AC 105 ms
84,564 KB
testcase_16 AC 81 ms
75,840 KB
testcase_17 AC 80 ms
75,976 KB
testcase_18 AC 72 ms
71,160 KB
testcase_19 AC 70 ms
71,284 KB
testcase_20 AC 71 ms
71,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
m = (n+k-1)//k
while m*m < n:
    m += 1
r = [[0]*m for _ in range(m)]
cnt = 0
print(m)
def f(x): return ".#"[x]
for i in range(m):
    for j in range(min(m,k)):
        r[i][(i+j)%m] = 1
        cnt += 1
        if cnt == n:
            for ri in r:
                print("".join(map(f,ri)))
            exit()
0