結果

問題 No.1792 科学の甲子園
ユーザー 👑 hitonanodehitonanode
提出日時 2021-12-21 00:12:55
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,486 bytes
コンパイル時間 1,442 ms
コンパイル使用メモリ 94,696 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-10-13 19:42:39
合計ジャッジ時間 2,326 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#pragma GCC optimize("O3,unroll-loops")
#include <iostream>
#include <vector>
using namespace std;
using lint = long long;

template <typename T> bool chmax(T &m, const T q) { return m < q ? (m = q, true) : false; }
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)

template <typename T> T rd_integer() {
    T ret = 0;
    bool minus = false;

    char c = getchar_unlocked();
    while (!isdigit(c)) minus |= (c == '-'), c = getchar_unlocked();
    while (isdigit(c)) ret = (ret << 1) + (ret << 3) + (c ^ 48), c = getchar_unlocked();

    return minus ? -ret : ret;
}
int rdi() { return rd_integer<int>(); }

int main() {
    constexpr int D = 6;
    vector dp(5, vector<lint>(1 << D, 1));

    int N = rdi();
    vector<lint> V(D);
    vector<lint> tmp(1 << D, 1);

    vector<short> first_digit(1 << D);
    FOR(s, 1, 1 << D) first_digit[s] = __builtin_ctz(s);

    while (N--) {
        for (auto &x : V) x = rdi();
        // FOR(s, 1, 1 << D) tmp[s] = tmp[s - (1 << first_digit[s])] * V[first_digit[s]];
        // REP(d, 4) {
        //     REP(s, 1 << D) {
        //         for (int t = s; t > 0; t = (t - 1) & s) {
        //             chmax(dp[d + 1][s], dp[d][s - t] * tmp[t]);
        //         }
        //     }
        // }
    }
    cout << dp.back().back() << '\n';
}
0