結果

問題 No.412 花火大会
コンテスト
ユーザー himueu
提出日時 2026-10-19 00:12:17
言語 C++23(gcc16)
(gcc 16.2.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 956µs
コード長 694 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,396 ms
コンパイル使用メモリ 183,456 KB
実行使用メモリ 9,916 KB
最終ジャッジ日時 2026-10-19 00:12:24
合計ジャッジ時間 3,500 ms
ジャッジサーバーID
(参考情報)
judge6_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>

int main() {
    using namespace std;
    int b, c, d, n;
    cin >> b >> c >> d >> n;
    if (b > c) { swap(b, c); }
    if (c > d) { swap(c, d); }
    if (b > c) { swap(b, c); }
    vector<int> a(n);
    for (auto &e : a) { cin >> e; }
    sort(a.begin(), a.end());

    int ans = 0;
    for (int i = 0; i < n; i++) {
        if (a[i] < b) { continue; }
        for (int j = i + 1; j < n; j++) {
            if (a[j] < c) { continue; }
            for (int k = j + 1; k < n; k++) {
                if (a[k] < d) { continue; }
                ans += 1 << i;
            }
        }
    }
    cout << ans << endl;
}
0