結果

問題 No.883 ぬりえ
ユーザー simamumusimamumu
提出日時 2019-09-13 21:36:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 656 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 19,804 KB
最終ジャッジ日時 2023-09-17 15:27:38
合計ジャッジ時間 2,429 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,056 KB
testcase_01 AC 32 ms
9,956 KB
testcase_02 AC 32 ms
10,048 KB
testcase_03 AC 32 ms
10,132 KB
testcase_04 AC 32 ms
9,908 KB
testcase_05 AC 31 ms
9,964 KB
testcase_06 AC 31 ms
9,984 KB
testcase_07 AC 33 ms
9,952 KB
testcase_08 AC 33 ms
9,956 KB
testcase_09 AC 32 ms
10,108 KB
testcase_10 AC 31 ms
10,064 KB
testcase_11 AC 32 ms
10,084 KB
testcase_12 AC 33 ms
10,048 KB
testcase_13 AC 33 ms
10,076 KB
testcase_14 AC 33 ms
9,972 KB
testcase_15 AC 71 ms
19,804 KB
testcase_16 AC 42 ms
12,520 KB
testcase_17 AC 38 ms
11,312 KB
testcase_18 AC 32 ms
10,136 KB
testcase_19 AC 33 ms
10,052 KB
testcase_20 AC 33 ms
10,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N,K = inpl()
W = math.ceil(max(N/K,math.sqrt(N)))

MAP = [['.']*W for _ in range(W)]

x = y = 0
k = 0
for _ in range(N):
    MAP[y][x] = '#'
    if k>0 and k%W == W-1:
        x += 1
    else:
        x += 1
        y += 1
    x %= W
    y %= W
    k += 1

print(W)
print('\n'.join([''.join(m) for m in MAP]))
0