結果

問題 No.883 ぬりえ
ユーザー tcltktcltk
提出日時 2021-11-19 15:52:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 913 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 84,996 KB
最終ジャッジ日時 2023-08-29 23:28:17
合計ジャッジ時間 8,668 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 195 ms
80,908 KB
testcase_01 AC 198 ms
80,916 KB
testcase_02 AC 196 ms
80,956 KB
testcase_03 AC 192 ms
81,056 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 192 ms
80,952 KB
testcase_07 AC 194 ms
81,080 KB
testcase_08 AC 197 ms
80,864 KB
testcase_09 AC 195 ms
81,032 KB
testcase_10 WA -
testcase_11 AC 194 ms
81,180 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 230 ms
84,996 KB
testcase_16 AC 210 ms
84,156 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 192 ms
80,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq


def input():
    return sys.stdin.readline()[:-1]


# sys.setrecursionlimit(1000000)

# _INPUT = """20 4
# """
# sys.stdin = io.StringIO(_INPUT)

INF = 10**10


def solve(N, K):
    for M in range(1, INF):
        if M <= K:
            if N <= M*M:
                A = [['#'] * M for _ in range(M)]
                return M, A
        else:
            if N <= K*M:
                A = [['.'] * M for _ in range(M)]
                j = 0
                for i in range(M):
                    for _ in range(K):
                        A[i][j] = '#'
                        j = (j + 1) % M
                return M, A
    
    return None, None

N, K = map(int, input().split())
M, A = solve(N, K)

print(M)
for i in range(M):
    print(''.join(A[i]))
0