結果
問題 |
No.3041 非対称じゃんけん
|
ユーザー |
![]() |
提出日時 | 2025-02-28 22:14:07 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 754 bytes |
コンパイル時間 | 3,110 ms |
コンパイル使用メモリ | 283,192 KB |
実行使用メモリ | 17,984 KB |
最終ジャッジ日時 | 2025-02-28 22:14:16 |
合計ジャッジ時間 | 8,359 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 WA * 16 TLE * 1 -- * 9 |
ソースコード
#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; } int now = 0; std::unordered_set<int> St[2]; St[now].insert(0); bool zero = false; for (int i = 0; i < N; i++) { int nxt = 1 - now; for (auto p : St[now]) { St[nxt].insert(p); St[nxt].insert(p + A[i]); St[nxt].insert(p + B[i]); St[nxt].insert(p + C[i]); } if (A[i] == 0 || B[i] == 0 || C[i] == 0) { zero = true; } now = nxt; std::cout << (int)St[now].size() - (!zero) << '\n'; } }