結果
問題 | No.883 ぬりえ |
ユーザー | kawap23 |
提出日時 | 2019-09-13 22:16:04 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 636 bytes |
コンパイル時間 | 358 ms |
コンパイル使用メモリ | 10,916 KB |
実行使用メモリ | 16,408 KB |
最終ジャッジ日時 | 2023-09-17 14:35:46 |
合計ジャッジ時間 | 2,874 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 17 ms
8,016 KB |
testcase_01 | AC | 18 ms
7,976 KB |
testcase_02 | AC | 17 ms
7,928 KB |
testcase_03 | AC | 16 ms
7,904 KB |
testcase_04 | AC | 16 ms
7,960 KB |
testcase_05 | AC | 17 ms
7,900 KB |
testcase_06 | AC | 17 ms
7,928 KB |
testcase_07 | WA | - |
testcase_08 | AC | 17 ms
7,924 KB |
testcase_09 | WA | - |
testcase_10 | AC | 16 ms
8,084 KB |
testcase_11 | AC | 17 ms
7,960 KB |
testcase_12 | AC | 17 ms
7,956 KB |
testcase_13 | AC | 17 ms
7,900 KB |
testcase_14 | AC | 17 ms
7,904 KB |
testcase_15 | AC | 491 ms
16,408 KB |
testcase_16 | AC | 132 ms
10,428 KB |
testcase_17 | AC | 68 ms
9,500 KB |
testcase_18 | AC | 17 ms
7,900 KB |
testcase_19 | AC | 17 ms
7,904 KB |
testcase_20 | WA | - |
ソースコード
from math import sqrt N, K = map(int, input().split()) count = N // (K * K) N -= count * K * K #残り塗らないといけない枚数 n = int(sqrt(N)) if n * n < N: n += 1 M = count * K + n # print (count, N, n) lst = [['.'] * M for _ in range(M)] for i in range(count * K): for j in range(count * K): if i // K == j // K: lst[i][j] = '#' for i in range(count * K, M): for j in range(count * K, M): if N > 0 and count * K + K > i and count * K + K > j: lst[i][j] = '#' N -= 1 else: break #出力 print (M) for i in lst: print (*i, sep = '')