結果

問題 No.3041 非対称じゃんけん
コンテスト
ユーザー askr58
提出日時 2025-02-28 23:04:33
言語 C++23
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 636 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,857 ms
コンパイル使用メモリ 377,160 KB
実行使用メモリ 9,284 KB
最終ジャッジ日時 2026-07-06 13:18:37
合計ジャッジ時間 17,524 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
using mint=modint998244353;
int main()
{
    const int bb=1000000;
    int n,f;
    cin>>n>>f;
    vector<int> a(n),b(n),c(n);
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<n;i++)cin>>b[i];
    for(int i=0;i<n;i++)cin>>c[i];
    bitset<bb> bs;
    bs[0]=1;
    bool zero=true;
    for(int i=0;i<n;i++){
        if(a[i]!=0&&b[i]!=0&&c[i]!=0)zero=false;
        bs=(bs|(bs<<a[i])|(bs<<b[i])|(bs<<c[i]));
        int t=bs.count();
        if(zero)cout<<t<<endl;
        else cout<<t-1<<endl;
    }
    
    return 0;
}
0