結果
問題 | No.412 花火大会 |
ユーザー |
![]() |
提出日時 | 2018-12-07 16:17:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 698 bytes |
コンパイル時間 | 1,769 ms |
コンパイル使用メモリ | 201,320 KB |
最終ジャッジ日時 | 2025-01-06 18:39:57 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 18 |
ソースコード
#include<bits/stdc++.h> using namespace std; using Int = long long; template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;} //INSERT ABOVE HERE signed main(){ vector<Int> v(3); for(Int i=0;i<3;i++) cin>>v[i]; Int n; cin>>n; vector<Int> e(n); for(Int i=0;i<n;i++) cin>>e[i]; sort(v.rbegin(),v.rend()); v.emplace_back(1e5); sort(e.rbegin(),e.rend()); vector<Int> dp(4,0); dp[0]=1; for(Int i=0;i<n;i++){ vector<Int> nx(4,0); for(Int j=0;j<4;j++){ nx[j]+=dp[j]; nx[j+(v[j]<=e[i])]+=dp[j]; } swap(dp,nx); } cout<<dp[3]<<endl; return 0; }