結果
問題 | No.459 C-VS for yukicoder |
ユーザー | maspy |
提出日時 | 2020-03-18 21:21:58 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,637 bytes |
コンパイル時間 | 174 ms |
コンパイル使用メモリ | 12,928 KB |
実行使用メモリ | 14,956 KB |
最終ジャッジ日時 | 2024-05-08 02:41:28 |
合計ジャッジ時間 | 11,751 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 30 ms
11,008 KB |
testcase_01 | AC | 28 ms
10,880 KB |
testcase_02 | AC | 30 ms
11,008 KB |
testcase_03 | WA | - |
testcase_04 | AC | 30 ms
11,008 KB |
testcase_05 | AC | 30 ms
11,008 KB |
testcase_06 | AC | 29 ms
11,136 KB |
testcase_07 | WA | - |
testcase_08 | AC | 27 ms
11,008 KB |
testcase_09 | AC | 29 ms
11,136 KB |
testcase_10 | AC | 30 ms
11,008 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 30 ms
11,008 KB |
testcase_14 | AC | 30 ms
11,008 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | AC | 214 ms
14,956 KB |
testcase_22 | AC | 191 ms
12,640 KB |
testcase_23 | AC | 185 ms
12,800 KB |
testcase_24 | AC | 98 ms
12,800 KB |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 63 ms
12,032 KB |
testcase_29 | AC | 89 ms
11,520 KB |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | AC | 74 ms
11,520 KB |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | WA | - |
testcase_49 | WA | - |
testcase_50 | WA | - |
testcase_51 | WA | - |
testcase_52 | WA | - |
testcase_53 | WA | - |
testcase_54 | WA | - |
testcase_55 | WA | - |
testcase_56 | WA | - |
testcase_57 | WA | - |
testcase_58 | WA | - |
testcase_59 | WA | - |
testcase_60 | WA | - |
ソースコード
#!/usr/bin/env python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines H, W, N = map(int, readline().split()) cols = [0] * W for _ in range(H): S = readline().rstrip() for i, x in enumerate(S): if x == ord('#'): cols[i] += 1 C = list(map(int, read().split())) use = [0 for _ in range(N)] def to_string(n): n, a = divmod(n, 4) c, b = divmod(n, 4) ch = '.', '#' rows = [None] * 3 rows[0] = ch[a > 0] + ch[b > 0] + ch[c > 0] a -= 1 b -= 1 c -= 1 rows[1] = ch[a > 0] + ch[b > 0] + ch[c > 0] a -= 1 b -= 1 c -= 1 rows[2] = ch[a > 0] + ch[b > 0] + ch[c > 0] return '\n'.join(rows) col_to_i = [[] for _ in range(W + 10)] for i, x in enumerate(C): col_to_i[x].append(i) for col in range(W): for i in col_to_i[col - 2]: if cols[col] and not use[i]: use[i] = 16 cols[col] -= 1 for i in col_to_i[col - 1]: if cols[col] and not use[i]: use[i] = 4 cols[col] -= 1 for i in col_to_i[col]: if cols[col] and not use[i]: use[i] = 1 cols[col] -= 1 for col in range(W): for i in col_to_i[col - 2]: n = min(cols[col], 3 - use[i] % 4) cols[col] -= n use[i] += n * 16 for i in col_to_i[col - 1]: n = min(cols[col], 3 - ((use[i] % 16) // 4)) cols[col] -= n use[i] += 4 * n for i in col_to_i[col]: n = min(cols[col], 3 - (use[i] // 16)) cols[col] -= n use[i] += n for n in use: print(to_string(n))