結果
| 問題 |
No.412 花火大会
|
| ユーザー |
titia
|
| 提出日時 | 2023-03-09 00:36:14 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 2,000 ms |
| コード長 | 390 bytes |
| コンパイル時間 | 95 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-09-18 02:40:58 |
| 合計ジャッジ時間 | 1,309 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 18 |
ソースコード
B,C,D=sorted(map(int,input().split()))
N=int(input())
A=list(map(int,input().split()))
A.sort()
DP=[1,0,0,0]
for a in A:
NDP=DP[:]
if a>=B:
NDP[1]+=DP[0]
else:
NDP[0]+=DP[0]
if a>=C:
NDP[2]+=DP[1]
else:
NDP[1]+=DP[1]
if a>=D:
NDP[3]+=DP[2]
else:
NDP[2]+=DP[2]
NDP[3]+=DP[3]
DP=NDP
print(DP[-1])
titia