結果

問題 No.883 ぬりえ
ユーザー ku_fukudaku_fukuda
提出日時 2019-09-18 01:42:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 479 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 29,644 KB
最終ジャッジ日時 2023-09-21 20:59:22
合計ジャッジ時間 7,046 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
29,568 KB
testcase_01 AC 125 ms
29,588 KB
testcase_02 WA -
testcase_03 AC 127 ms
29,500 KB
testcase_04 AC 127 ms
29,552 KB
testcase_05 AC 127 ms
29,548 KB
testcase_06 AC 127 ms
29,580 KB
testcase_07 WA -
testcase_08 AC 129 ms
29,460 KB
testcase_09 WA -
testcase_10 AC 127 ms
29,624 KB
testcase_11 WA -
testcase_12 AC 127 ms
29,580 KB
testcase_13 AC 126 ms
29,588 KB
testcase_14 AC 128 ms
29,568 KB
testcase_15 AC 129 ms
29,484 KB
testcase_16 AC 126 ms
29,592 KB
testcase_17 AC 126 ms
29,616 KB
testcase_18 AC 132 ms
29,556 KB
testcase_19 AC 124 ms
29,608 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy
N,K=map(int,input().split())
a=(N//(K*K))
b=0
if N<=K*K:
    b=int(numpy.sqrt(N-1/2)+1)
elif not N%K==0:
    b=int(numpy.sqrt(N%(K*K)-1/2))+1
M=a*K+b
print(M)
for i in range(a):
    word='.'*(i*K)+'#'*K+'.'*(M-K*(i+1))
    for j in range(K):
        print(word)
last=N-K*K*a
for j in range(b):
    num=0
    if last>=b:
        last=last-b
        num=b
    elif last>0:
        num=last
        last=0
    word='.'*(a*K)+'#'*num+'.'*(M-a*K-num)
    print(word)
    
0