結果
| 問題 |
No.412 花火大会
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-03-06 18:55:54 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 578 bytes |
| コンパイル時間 | 145 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-10-14 03:09:42 |
| 合計ジャッジ時間 | 1,803 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 WA * 4 |
ソースコード
#!/usr/bin/env python3
# %%
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# %%
B, C, D, N, *E = map(int, read().split())
# %%
E.sort()
B, C, D = sorted([B, C, D])
# %%
dp = [1, 0, 0, 0]
for x in E:
newdp = dp[:]
if x >= B:
newdp[1] += dp[0]
else:
newdp[0] += dp[0]
if x >= C:
newdp[2] += dp[1]
else:
newdp[1] += dp[1]
if x >= C:
newdp[3] += dp[2]
else:
newdp[2] += dp[2]
newdp[3] += dp[3]
dp = newdp
# %%
print(dp[3])
maspy