結果

問題 No.883 ぬりえ
ユーザー rlangevinrlangevin
提出日時 2023-08-30 12:33:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 866 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 80,364 KB
最終ジャッジ日時 2023-08-30 12:33:51
合計ジャッジ時間 4,585 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,280 KB
testcase_01 AC 76 ms
71,112 KB
testcase_02 AC 78 ms
71,244 KB
testcase_03 AC 77 ms
71,148 KB
testcase_04 AC 77 ms
71,236 KB
testcase_05 AC 74 ms
71,332 KB
testcase_06 AC 74 ms
70,960 KB
testcase_07 AC 76 ms
71,220 KB
testcase_08 AC 74 ms
71,100 KB
testcase_09 AC 76 ms
71,204 KB
testcase_10 AC 74 ms
70,948 KB
testcase_11 AC 75 ms
71,216 KB
testcase_12 AC 77 ms
71,200 KB
testcase_13 AC 77 ms
71,224 KB
testcase_14 AC 82 ms
75,196 KB
testcase_15 AC 163 ms
80,364 KB
testcase_16 AC 110 ms
78,856 KB
testcase_17 AC 99 ms
78,076 KB
testcase_18 AC 82 ms
75,032 KB
testcase_19 AC 77 ms
71,248 KB
testcase_20 AC 74 ms
71,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
sq = 0
for i in range(100):
    if (sq + 1) ** 2 < N:
        sq += 1

M = max(sq + 1, (N + K - 1)//K)
cnt = 0
print(M)
for i in range(M):
    ans = ["."] * M
    for j in range(min(M, K)):
        if cnt == N:
            continue
        ans[(i + j)%M] = "#"
        cnt += 1
    print(*ans, sep="")
0