結果

問題 No.883 ぬりえ
ユーザー Alex WiceAlex Wice
提出日時 2019-09-13 21:49:10
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 492 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 77,436 KB
実行使用メモリ 80,184 KB
最終ジャッジ日時 2023-09-17 07:07:59
合計ジャッジ時間 3,533 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
76,224 KB
testcase_01 AC 74 ms
76,224 KB
testcase_02 AC 74 ms
76,348 KB
testcase_03 AC 74 ms
76,196 KB
testcase_04 AC 75 ms
76,480 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 74 ms
76,340 KB
testcase_08 AC 73 ms
76,384 KB
testcase_09 AC 74 ms
76,392 KB
testcase_10 AC 74 ms
76,136 KB
testcase_11 AC 73 ms
76,136 KB
testcase_12 AC 74 ms
76,188 KB
testcase_13 AC 73 ms
76,440 KB
testcase_14 WA -
testcase_15 AC 99 ms
79,352 KB
testcase_16 AC 85 ms
78,620 KB
testcase_17 AC 84 ms
78,212 KB
testcase_18 AC 73 ms
76,460 KB
testcase_19 WA -
testcase_20 AC 73 ms
76,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

rr = raw_input
rri = lambda: int(raw_input())
rrm = lambda: map(int, raw_input().split())

def solve(tot, K):
    q, r = divmod(tot, K)
    N = q + (r > 0)
    N = max(N, K)
    ans = [['.'] * N for _ in xrange(N)]
    for r, row in enumerate(ans):
        for c in range(r, r+K):
            c %= N
            if tot:
                ans[r][c] = '#'
                tot -= 1
    return ans
    
ans = solve(*rrm())
print len(ans)
for row in ans:
    print "".join(row)
0