結果
| 問題 | No.3041 非対称じゃんけん |
| コンテスト | |
| ユーザー |
sai
|
| 提出日時 | 2025-02-28 22:42:05 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,127 bytes |
| 記録 | |
| コンパイル時間 | 3,264 ms |
| コンパイル使用メモリ | 366,388 KB |
| 実行使用メモリ | 11,084 KB |
| 最終ジャッジ日時 | 2026-07-06 13:03:06 |
| 合計ジャッジ時間 | 8,119 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 WA * 16 TLE * 1 -- * 9 |
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int N, F; std::cin >> N >> F;
std::vector<int> A(N), B(N), C(N);
for (auto &a : A) {
std::cin >> a;
}
for (auto &b : B) {
std::cin >> b;
}
for (auto &c : C) {
std::cin >> c;
}
std::vector<bool> dp[2];
int now = 0;
dp[now].resize(N * F + 1, false);
dp[1 - now].resize(N * F + 1, false);
for (int i = 0; i < N; i++) {
int nxt = 1 - now;
for (int j = 0; j <= N * F; j++) {
if (dp[now][j]) {
dp[nxt][j] = true;
if (j + A[i] <= N * F) {
dp[nxt][j + A[i]] = true;
}
if (j + B[i] <= N * F) {
dp[nxt][j + B[i]] = true;
}
if (j + C[i] <= N * F) {
dp[nxt][j + C[i]] = true;
}
}
}
dp[nxt][A[i]] = true;
dp[nxt][B[i]] = true;
dp[nxt][C[i]] = true;
now = nxt;
int ans = 0;
for (int j = 0; j <= N * F; j++) {
ans += (dp[nxt][j]);
}
std::cout << ans << '\n';
}
}
sai