結果
| 問題 |
No.412 花火大会
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-02-11 10:39:23 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 618 bytes |
| コンパイル時間 | 712 ms |
| コンパイル使用メモリ | 75,728 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-18 03:02:46 |
| 合計ジャッジ時間 | 1,650 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 12 WA * 6 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
int main(){
int a[3], n;
for(int i = 0; i < 3; i++) cin >> a[i];
sort(a, a+3);
cin >> n;
int e[n];
for(int i = 0; i < n; i++) cin >> e[i];
sort(e, e+n);
vector<ll> dp(4, 0);
dp[0] = 1;
for(int i = 0; i < n; i++){
vector<ll> next = dp;
for(int j = 0; j < 3; j++){
if(e[i] >= a[j]) next[j+1] += dp[j];
}
if(e[i] < a[0]) next[0] += dp[0];
next[3] += dp[3];
dp = next;
}
cout << dp[3] << endl;
return 0;
}