結果
問題 | No.3041 非対称じゃんけん |
ユーザー |
|
提出日時 | 2025-02-28 21:59:42 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,691 ms / 2,200 ms |
コード長 | 862 bytes |
コンパイル時間 | 1,897 ms |
コンパイル使用メモリ | 199,612 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-02-28 21:59:58 |
合計ジャッジ時間 | 14,986 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;template<class T> istream& operator >> (istream& is, vector<T>& vec) {for(T& x : vec) is >> x;return is;}template<class T> ostream& operator << (ostream& os, const vector<T>& vec) {if(vec.empty()) return os;os << vec[0];for(auto it = vec.begin(); ++it != vec.end(); ) os << ' ' << *it;return os;}int main(){ios::sync_with_stdio(false);cin.tie(0);int n, f;cin >> n >> f;vector<int> a(n), b(n), c(n);cin >> a >> b >> c;bitset<900001> B;B[0] = 1;array<int, 3> ary;for(int i = 0; i < n; i++){ary = {a[i], b[i], c[i]};sort(ary.begin(), ary.end());int c1 = ary[1] - ary[0];int c2 = ary[2] - ary[0];B |= (B << c1) | (B << c2);cout << B.count() << '\n';}}