結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
29,544 KB
testcase_01 AC 150 ms
29,544 KB
testcase_02 AC 151 ms
29,524 KB
testcase_03 AC 151 ms
29,572 KB
testcase_04 AC 145 ms
29,576 KB
testcase_05 AC 146 ms
29,576 KB
testcase_06 AC 158 ms
29,544 KB
testcase_07 WA -
testcase_08 AC 159 ms
29,548 KB
testcase_09 WA -
testcase_10 AC 156 ms
29,580 KB
testcase_11 AC 144 ms
29,560 KB
testcase_12 AC 146 ms
29,556 KB
testcase_13 AC 144 ms
29,484 KB
testcase_14 AC 146 ms
29,540 KB
testcase_15 AC 151 ms
29,624 KB
testcase_16 AC 152 ms
29,624 KB
testcase_17 AC 154 ms
29,488 KB
testcase_18 AC 153 ms
29,552 KB
testcase_19 AC 156 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:
    a=0
    b=int(numpy.sqrt(N-1/2)+1)
elif not N%(K*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