結果
| 問題 |
No.3041 非対称じゃんけん
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-28 23:06:49 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 774 bytes |
| コンパイル時間 | 3,534 ms |
| コンパイル使用メモリ | 283,904 KB |
| 実行使用メモリ | 13,640 KB |
| 最終ジャッジ日時 | 2025-02-28 23:07:03 |
| 合計ジャッジ時間 | 8,393 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 WA * 18 TLE * 2 -- * 6 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int N, F;
cin >> N >> F;
vector<int> A(N), B(N), C(N);
for(auto&x: A) cin >> x;
for(auto&x: B) cin >> x;
for(auto&x: C) cin >> x;
int M = 61;
vector<bool> dp(M);
int ans = 0;
auto Push = [&](vector<bool>& DP, int k) {
if(DP.size() <= k) return;
if(!DP[k]) {
DP[k] = 1;
ans++;
}
};
Push(dp, A[0]), Push(dp, B[0]), Push(dp, C[0]);
cout << ans << "\n";
for(int i = 1; i < N; i++) {
M += 61;
vector<bool> ndp = dp;
ndp.resize(M);
for(int j = 0, sz = dp.size(); j < sz; j++) if(dp[j]) {
Push(ndp, A[i] + j), Push(ndp, B[i] + j), Push(ndp, C[i] + j);
}
cout << ans << "\n";
dp = ndp;
}
}