結果

問題 No.3041 非対称じゃんけん
ユーザー Carpenters-Cat
提出日時 2025-02-28 22:08:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 633 bytes
コンパイル時間 3,910 ms
コンパイル使用メモリ 252,124 KB
実行使用メモリ 8,236 KB
最終ジャッジ日時 2025-02-28 22:08:26
合計ジャッジ時間 12,585 ms
ジャッジサーバーID
(参考情報)
judge6 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other WA * 24 TLE * 2 -- * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
int main () {
	int N, F;
	cin >> N >> F;
	std::vector<int> A(N), B(N), C(N);
	for (int& a : A) cin >> a;
	for (int& b : B) cin >> b;
	for (int& c : C) cin >> c;
	vector<int> ans(F * N + 10, 0);
	ans[0] = 1;
	int cnt = 0;
	for (int i = 0; i < N; i ++) {
		int X[] = {A[i], B[i], C[i]};
		sort(X, X + 3);
		int p = X[1] - X[0], q = X[2] - X[0];
		for (int j = F * i; j >= 0; j --) {
			if (ans[j]) {
				cnt += (ans[j + p] == 0) + (ans[j + q] == 0);
				ans[j + p] = ans[j + q] = 1;
			}
		}
		cout << cnt << endl;
	}
}
0