結果

問題 No.883 ぬりえ
ユーザー kohei2019kohei2019
提出日時 2022-05-04 23:55:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 621 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 88,472 KB
最終ジャッジ日時 2023-09-17 05:08:06
合計ジャッジ時間 3,330 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
70,928 KB
testcase_01 AC 63 ms
71,332 KB
testcase_02 AC 64 ms
71,312 KB
testcase_03 AC 66 ms
71,048 KB
testcase_04 AC 60 ms
71,424 KB
testcase_05 AC 61 ms
71,224 KB
testcase_06 AC 60 ms
71,056 KB
testcase_07 WA -
testcase_08 AC 72 ms
71,304 KB
testcase_09 WA -
testcase_10 AC 65 ms
71,204 KB
testcase_11 AC 65 ms
71,472 KB
testcase_12 AC 60 ms
71,080 KB
testcase_13 AC 61 ms
71,368 KB
testcase_14 AC 66 ms
75,096 KB
testcase_15 AC 141 ms
88,472 KB
testcase_16 AC 91 ms
81,124 KB
testcase_17 AC 83 ms
78,932 KB
testcase_18 AC 66 ms
75,308 KB
testcase_19 AC 63 ms
71,164 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
def func(n,k):#縦横マス数,一列の最大
    return (n//k)*k*k + (n%k)**2

for i in range(1,N+1):
    if N <= func(i, K):
        M = i
        break
HW = [['.']*M for _ in range(M)]
cnt= 0
for p in range(0,M,K):
    for l in range(p,min(p+K,M)):
        for m in range(p,min(p+K,M)):
            if cnt == N:
                break
            HW[l][m] = '#'
            cnt += 1
for l in range((M//K)*K,M):
    for m in range((M//K)*K,M):
        if cnt == N:
            break
        HW[l][m] = '#'
        cnt += 1
print(M)
for i in range(M):
    print(*HW[i],sep='')
            
0