結果

問題 No.883 ぬりえ
ユーザー kohei2019kohei2019
提出日時 2022-05-04 23:53:57
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 607 bytes
コンパイル時間 955 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 88,184 KB
最終ジャッジ日時 2023-09-17 05:06:26
合計ジャッジ時間 4,615 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,388 KB
testcase_01 AC 72 ms
71,244 KB
testcase_02 AC 73 ms
71,392 KB
testcase_03 AC 73 ms
70,920 KB
testcase_04 AC 72 ms
71,192 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 WA -
testcase_08 AC 72 ms
71,236 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 73 ms
71,176 KB
testcase_12 AC 72 ms
71,336 KB
testcase_13 AC 74 ms
71,076 KB
testcase_14 RE -
testcase_15 AC 170 ms
88,184 KB
testcase_16 AC 109 ms
81,252 KB
testcase_17 AC 96 ms
78,936 KB
testcase_18 AC 77 ms
75,220 KB
testcase_19 RE -
testcase_20 RE -
権限があれば一括ダウンロードができます

ソースコード

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,p+K):
        for m in range(p,p+K):
            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