結果

問題 No.883 ぬりえ
ユーザー ku_fukuda
提出日時 2019-09-18 01:42:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 479 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 43,748 KB
最終ジャッジ日時 2024-07-07 14:22:40
合計ジャッジ時間 15,177 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 5
権限があれば一括ダウンロードができます

ソースコード

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