結果

問題 No.883 ぬりえ
ユーザー dn6049949dn6049949
提出日時 2019-09-13 23:32:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,892 bytes
コンパイル時間 626 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 90,964 KB
最終ジャッジ日時 2023-09-17 15:25:18
合計ジャッジ時間 5,434 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
72,896 KB
testcase_01 AC 119 ms
73,456 KB
testcase_02 AC 116 ms
73,032 KB
testcase_03 AC 116 ms
73,104 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 118 ms
72,884 KB
testcase_08 AC 118 ms
73,084 KB
testcase_09 AC 115 ms
73,304 KB
testcase_10 AC 118 ms
73,288 KB
testcase_11 AC 118 ms
73,208 KB
testcase_12 AC 117 ms
73,120 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 244 ms
90,964 KB
testcase_16 AC 169 ms
84,180 KB
testcase_17 AC 153 ms
82,660 KB
testcase_18 AC 122 ms
77,060 KB
testcase_19 WA -
testcase_20 AC 118 ms
73,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    a,b = LI()
    for i in range(1,101):
        if a%i == 0 and i%b == 0:
            print("YES")
            return
    print("NO")
    return

#B
def B():
    n,k = LI()
    h = math.ceil(n/k)
    s = []
    l = 0
    for i in range(n//k):
        s.append(["#" if l <= i < l+k or (i < (l+k)%h and l+k >= h) else "." for i in range(h)])
        l += 1
    l %= h
    su = n%k
    if su:
        s.append(["#" if l <= i < l+su else "." for i in range(h)])
    print(h)
    for i in s:
        print(*i,sep="")
    return

#C
def C():
    s = S()
    n = len(s)
    k = 1
    p = s[0]
    q = deque()
    for i in range(1,n):
        if s[i] == p:
            k += 1
        else:
            q.append(k)
            k = 1
            p = s[i]
    if p == "1":
        q.append(k)
    ans = 0
    print(q)
    while q:
        x = q.pop()
        if q:
            y = q.pop()
            if x <= y:
                ans += min(2,x)
            else:
                ans += y
                q[-1] += (x+y)
        else:
            ans += min(2,x)
        print(q)
    print(ans)
    return

#D
def D():

    return

#E
def E():

    return

#F
def F():

    return

#Solve
if __name__ == "__main__":
    B()
0