結果
問題 | No.868 ハイパー部分和問題 |
ユーザー |
![]() |
提出日時 | 2019-08-16 23:07:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 4,951 bytes |
コンパイル時間 | 1,721 ms |
コンパイル使用メモリ | 171,916 KB |
実行使用メモリ | 92,752 KB |
最終ジャッジ日時 | 2024-09-22 21:17:41 |
合計ジャッジ時間 | 25,228 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 5 WA * 9 TLE * 1 -- * 23 |
ソースコード
// warm heart, wagging tail,and a smile just for you! // // ▒█████▒▒ // ██████████▒ // ▒████████████▒ // ██████████████████ // ████████████████████▒ // ▒██████████████████████▒ // ▒███████████████████████ // ▒████▒▒▒▒▒▒█████████████████▒ // ███▒▒▒▒▒▒██████████████████████▒▒▒ // ▒██▒▒███████████████████████▒▒▒▒▒██████ // ▒█████████████████████████▒▒▒▒▒▒█████████▒ // ▒█████████████████████▒▒▒▒▒▒██████████████ // ▒████ ████▒▒▒▒▒████ ████▒ // ▒█████▒ ████ ▒▒▒▒███████ ████ ██████▒ // ▒██▒▒▒▒▒ ██████ █████████ ██████ ██▒▒▒██▒ // █████████ ████████ █████████ ████████ ▒▒▒▒█████ // ▒█████████ ██████ ████████▒ ██████ █████████ // ▒██████████ ████ █████▒▒▒▒▒▒ ████ ██████████ // ████████████ ▒▒▒▒▒▒▒████████ ███████████▒ // ▒██████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒███████████████████████████████████▒ // ███▒▒▒▒▒▒▒▒▒▒▒▒█████████████████████████████████████████▒▒████████▒ // ▒▒▒▒▒▒▒▒▒██████████████ ███████▒▒▒▒███████████ // █████████████████████████ ███████▒▒▒██████████████▒ // █████████████████████████████ ███████▒▒▒██████████████████▒ // ██████████████████████████████████████████████████████████████████████ // ██████████████████████████████████████████████████████████████████▒ // ▒█████████████████▒▒▒▒▒▒▒██████████████████████████████████▒▒▒ // #include "bits/stdc++.h" using namespace std; #define MOD 1000000007 //#define MOD 998244353 const double EPS = 1e-9; #define INF (1LL<<60) #define D double #define fs first #define sc second #define int long long #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define RFOR(i,a,b) for(int i = (b-1);i>=(a);--i) #define REP(i,n) FOR(i,0,(n)) #define RREP(i,n) RFOR(i,0,(n)) #define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr) #define range(i,a,b) ((a)<=(i) && (i)<(b)) #define debug(x) cout << #x << " = " << (x) << endl; #define SP << " " << typedef pair<int,int> P; typedef vector<int> vec; typedef vector<vector<int>> mat; signed main(){ ios::sync_with_stdio(false); cin.tie(0); int n,k; cin >> n >> k; vector<int> a(n); REP(i,n) cin >> a[i]; bitset<15000*15000+10> bs; bs[0] = 1; REP(i,n){ bs |= (bs<<a[i]); } int q; cin >> q; REP(_,q){ int x,v; cin >> x >> v; x--; bs >>= a[x]; a[x] = v; bs <<= a[x]; cout << bs[k] << "\n"; } return 0; }