結果
問題 |
No.3041 非対称じゃんけん
|
ユーザー |
|
提出日時 | 2025-02-28 23:44:16 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,481 bytes |
コンパイル時間 | 3,655 ms |
コンパイル使用メモリ | 281,656 KB |
実行使用メモリ | 8,232 KB |
最終ジャッジ日時 | 2025-02-28 23:44:31 |
合計ジャッジ時間 | 13,851 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 22 TLE * 2 -- * 6 |
ソースコード
#ifndef INCLUDED_MAIN #define INCLUDED_MAIN #include __FILE__ int main(){ ll n,f; cin>>n>>f; vector<ll> aa(n),bb(n),cc(n); rep(i,n) cin>>aa[i]; rep(i,n) cin>>bb[i]; rep(i,n) cin>>cc[i]; vector<ll> cur; cur.push_back(0); rep(i,n) { vector<bool> canmake(n*f+1,false); vector<ll> nxt; ll a=aa[i],b=bb[i],c=cc[i]; for(auto sum:cur) { if(sum+a<=n*f) { if(!canmake[sum+a]){ canmake[sum+a]=true; nxt.push_back(sum+a); } } if(sum+b<=n*f) { if(!canmake[sum+b]){ canmake[sum+b]=true; nxt.push_back(sum+b); } } if(sum+c<=n*f) { if(!canmake[sum+c]){ canmake[sum+c]=true; nxt.push_back(sum+c); } } } cout<<nxt.size()<<endl; cur=move(nxt); } } #else #include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define srep(i,l,r) for(int i=l;i<=r;i++) using ll=long long; const ll mod=998244353; #define INF 922330000000000000ll ll modpow(ll base,ll exp,ll mode){ ll result=1; if(mode==0){ rep(i,exp)result*=base; }else{ base%=mod; while(exp>0){ if(exp&1) result=(result*base)%mod; base=(base*base)%mod; exp>>=1; } } return result; } #endif