제출 #1107059

#제출 시각아이디문제언어결과실행 시간메모리
1107059vjudge1은행 (IZhO14_bank)C++17
19 / 100
86 ms31312 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define sz size() #define in insert #define int long long #define F first #define up upper_bound #define S second #define lb lower_bound #define pair pair<int, int> #define all(v) v.begin(),v.end() #define FOR1(x, n) for(int j = x; j <= n; j ++) #define FOR(x, n) for(int i = x; i <= n; i ++) #define FORR(x, n) for(int i = x; i >= n; i --) #define nikita ios_base::sync_with_stdio(0), cin.tie(0); int n,m,k,t,ans=0,sum=0,cnt, l, r, x, y, q; const int N = 1e6+5; int a[N], b[N], c[N]; vector<int>g[N]; int pref[N]; bool f = 0; string str; void rec(int sum = 0, int i = 1, string s = ""){ if(f)return; if(sum == x){ f=1; str = s; return; } if(i > m)return; rec(sum, i+1, s + '0'); if(f)return; rec(sum+b[i], i + 1, s + '1'); } void solve() { nikita cin >> n >> m; FOR(1, n)cin >> a[i]; FOR(1, m)cin >> b[i]; FOR(1, n){ x = a[i],f = 0; k=0, sum = 0; rec(); if(!f){ cout << "NO\n"; return; } while(str.sz<m)str+='0'; FOR1(1, m){ if(str[j-1] == '1')b[j]=0, k++; } } cout << "YES\n"; } signed main() { nikita int t=1; FOR(1, t)solve(); }

컴파일 시 표준 에러 (stderr) 메시지

bank.cpp: In function 'void solve()':
bank.cpp:50:21: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   50 |         while(str.sz<m)str+='0';
      |               ~~~~~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...