結果

問題 No.3041 非対称じゃんけん
ユーザー KumaTachiRen
提出日時 2025-02-28 21:32:33
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1,848 ms / 2,200 ms
コード長 1,545 bytes
コンパイル時間 5,566 ms
コンパイル使用メモリ 333,644 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-02-28 21:32:57
合計ジャッジ時間 19,831 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#include <atcoder/all>
using namespace atcoder;

using mint = modint998244353;
using vm = vector<mint>;
using vvm = vector<vm>;
inline ostream &operator<<(ostream &os, const mint x)
{
    return os << x.val();
};
inline istream &operator>>(istream &is, mint &x)
{
    long long v;
    is >> v;
    x = v;
    return is;
};

struct Fast
{
    Fast()
    {
        std::cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << setprecision(10);
    }
} fast;

#define all(a) (a).begin(), (a).end()
#define contains(a, x) ((a).find(x) != (a).end())
#define rep(i, a, b) for (int i = (a); i < (int)(b); i++)
#define rrep(i, a, b) for (int i = (int)(b) - 1; i >= (a); i--)
#define YN(b) cout << ((b) ? "YES" : "NO") << "\n";
#define Yn(b) cout << ((b) ? "Yes" : "No") << "\n";
#define yn(b) cout << ((b) ? "yes" : "no") << "\n";

using ll = long long;
using vl = vector<ll>;
using vi = vector<int>;
using vvi = vector<vi>;

void solve()
{
    int n, f;
    cin >> n >> f;

    vi a(n), b(n), c(n);
    rep(i, 0, n) cin >> a[i];
    rep(i, 0, n) cin >> b[i];
    rep(i, 0, n) cin >> c[i];

    using bs = bitset<900001>;
    bs dp(1);
    rep(i, 0, n)
    {
        int x = a[i], y = b[i], z = c[i];
        if (y > z) swap(y, z);
        if (x > y) swap(x, y);
        if (y > z) swap(y, z);
        y -= x;
        z -= x;
        dp = dp | (dp << y) | (dp << z);
        cout << dp.count() << "\n";
    }
}

int main()
{
    int t = 1;
    // cin >> t;
    while (t--)
        solve();
}
0