結果

問題 No.883 ぬりえ
ユーザー tcltktcltk
提出日時 2021-11-18 07:26:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 779 bytes
コンパイル時間 1,096 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 84,880 KB
最終ジャッジ日時 2023-08-26 12:54:03
合計ジャッジ時間 6,156 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 176 ms
80,876 KB
testcase_01 AC 174 ms
80,956 KB
testcase_02 AC 181 ms
81,096 KB
testcase_03 AC 171 ms
80,860 KB
testcase_04 AC 171 ms
80,872 KB
testcase_05 AC 175 ms
81,192 KB
testcase_06 AC 175 ms
80,684 KB
testcase_07 WA -
testcase_08 AC 178 ms
81,072 KB
testcase_09 WA -
testcase_10 AC 177 ms
81,060 KB
testcase_11 AC 187 ms
80,976 KB
testcase_12 AC 177 ms
80,680 KB
testcase_13 AC 176 ms
80,856 KB
testcase_14 AC 178 ms
81,016 KB
testcase_15 AC 199 ms
84,880 KB
testcase_16 AC 186 ms
84,048 KB
testcase_17 AC 183 ms
83,692 KB
testcase_18 AC 170 ms
81,060 KB
testcase_19 AC 173 ms
81,028 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

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 3
# """
# sys.stdin = io.StringIO(_INPUT)

INF = 10**10


N, K = map(int, input().split())

n = N // (K*K)
k = 0
while n * (K*K) + k*k < N:
    k += 1

M = K*n + k
A = [['.'] * M for _ in range(M)]
for n1 in range(n):
    for i in range(K*n1, K*(n1+1)):
        for j in range(K*n1, K*(n1+1)):
            A[i][j] = '#'
            N -= 1
for i in range(K*n, K*n+k):
    for j in range(K*n, K*n+k):
        if N > 0:
            A[i][j] = '#'
            N -= 1

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