結果

問題 No.3041 非対称じゃんけん
ユーザー hirakuuuu
提出日時 2025-02-28 22:39:59
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 1,219 bytes
コンパイル時間 6,255 ms
コンパイル使用メモリ 333,552 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2025-02-28 22:40:17
合計ジャッジ時間 15,570 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19 TLE * 2 -- * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define rrep(i, a, n) for(int i = a; i >= n; i--)
#define inr(l, x, r) (l <= x && x < r)
#define ll long long
#define ld long double

// using mint = modint1000000007;
// using mint = modint998244353;
constexpr int IINF = 1001001001;
constexpr ll INF = 1e18;

template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}

int main(){
    int n, f; cin >> n >> f;
    vector<int> 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];

    vector<bool> d(f+1);
    set<int> s;
    d[a[0]] = d[b[0]] = d[c[0]] = true;
    {
        int ans = 0;
        rep(j, 0, d.size()){
            if(d[j]) ans++;
        }
        cout << ans << endl;
    }
    rep(i, 1, n){
        vector<bool> e(f+1);
        e[a[i]] = true;
        e[b[i]] = true;
        e[c[i]] = true;
        vector<bool> g = convolution(e, d);
        int ans = 0;
        rep(j, 0, g.size()){
            if(g[j]) ans++;
        }
        cout << ans << endl;
        swap(d, g);
    }

    return 0;
}
0