結果
問題 |
No.883 ぬりえ
|
ユーザー |
![]() |
提出日時 | 2019-09-18 01:46:15 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 486 bytes |
コンパイル時間 | 88 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 44,232 KB |
最終ジャッジ日時 | 2024-07-07 14:23:04 |
合計ジャッジ時間 | 12,518 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 WA * 3 |
ソースコード
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)