結果

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

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000000
#define Inf64 1000000000000000001LL

int main(){
	int n,f;
	cin>>n>>f;
	bitset<900005> dp;
	dp[0] = 1;
	vector<int> a(n),b(n),c(n);
	rep(i,n)cin>>a[i];
	rep(i,n)cin>>b[i];
	rep(i,n)cin>>c[i];
	
	rep(i,n){
		vector<int> t = {a[i],b[i],c[i]};
		sort(t.begin(),t.end());
		b[i] = t[1]-t[0],c[i] = t[2]-t[0];
		dp |= (dp<<b[i]) | (dp<<c[i]);
		cout<<dp.count()<<endl;
	}
	return 0;
}
0