結果

問題 No.412 花火大会
ユーザー mamekinmamekin
提出日時 2016-10-05 15:07:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 971 bytes
コンパイル時間 1,046 ms
コンパイル使用メモリ 107,456 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-13 23:15:32
合計ジャッジ時間 2,191 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 WA -
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

int main()
{
    vector<int> a(3);
    for(int i=0; i<3; ++i)
        cin >> a[i];
    sort(a.rbegin(), a.rend());

    int n;
    cin >> n;
    vector<int> e(n);
    for(int i=0; i<n; ++i)
        cin >> e[i];
    sort(e.rbegin(), e.rend());

    vector<int> dp(4, 0);
    dp[0] = 1;
    for(int i=0; i<n; ++i){
        for(int j=3; j>=0; --j){
            if(j < 3 && a[j] < e[i])
                dp[j+1] += dp[j];
            else
                dp[j] *= 2;
        }
    }
    cout << dp[3] << endl;

    return 0;
}
0