結果
問題 | No.3041 非対称じゃんけん |
ユーザー |
|
提出日時 | 2025-02-28 21:59:55 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 654 bytes |
コンパイル時間 | 4,438 ms |
コンパイル使用メモリ | 263,684 KB |
実行使用メモリ | 14,260 KB |
最終ジャッジ日時 | 2025-02-28 22:00:13 |
合計ジャッジ時間 | 14,032 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 19 TLE * 2 -- * 9 |
ソースコード
#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;std::queue<vector<ll>> que;for (int i = 0; i < N; i ++) {vector<ll> X(F + 1, 0);X[A[i]] = X[B[i]] = X[C[i]] = 1;que.push(X);}vector<ll> ans(1, 1);for (int i = 0; i < N; i ++) {if (!que.empty()) {ans = convolution(ans, que.front());que.pop();}for (auto& a : ans) a = min(a, 1ll);cout << accumulate(ans.begin(), ans.end(), 0ll) << endl;}}