| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 657546 | ono_de206 | 은행 (IZhO14_bank) | C++14 | 1080 ms | 3220 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<vector>
#include<set>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define in insert
#define all(x) x.begin(),x.end()
#define pb push_back
#define eb emplace_back
#define ff first
#define ss second
// #define int long long
template<typename T>
void mxx(T &a,T b) {if(b>a) a=b;}
template<typename T>
void mnn(T &a,T b) {if(b<a) a=b;}
const int mod=1e9+7;
void norm(int &a){
while(a<0) a+=mod;
while(a>=mod) a-=mod;
}
const int mxn=20100;
int a[22];
signed main(){
fast;
int n,m;
cin>>n>>m;
vector<int> a(n),b(m);
vector<vector<int> > gg(n);
for(int i=0; i<n; i++) cin>>a[i];
for(int i=0; i<m; i++) cin>>b[i];
for(int i=0; i<(1<<m); i++){
int sum=0;
for(int j=0; j<m; j++){
if(i&(1<<j)) sum+=b[j];
}
for(int j=0; j<n; j++) if(sum==a[j]) gg[j].pb(i);
}
vector<int> tmp;
tmp.pb(0);
for(int i=0; i<n; i++){
vector<int> lol;
for(int j=0; j<gg[i].size(); j++){
for(int k=0; k<tmp.size(); k++){
if((gg[i][j]&tmp[k])==0) lol.pb(gg[i][j]^tmp[k]);
}
}
swap(lol,tmp);
}
cout<<(!tmp.empty() ? "YES\n" : "NO\n");
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
