제출 #901049

#제출 시각아이디문제언어결과실행 시간메모리
901049RedSnow389은행 (IZhO14_bank)C++14
0 / 100
1 ms604 KiB
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define ld long double #define fr(i,n) for(i=0;i<n;i++) #define fa(i,v) for(auto &i:v) #define yesno cout<<"YES"<<endl; else cout<<"NO"<<endl; #define vvl vector<vector<ll> > #define vl vector<ll> #define pll pair<ll,ll> #define vpll vector<pair<ll,ll> > #define vvpll vector<vector<pair<ll,ll> > > #define mp make_pair #define pb push_back #define rs resize #define cl(v) v.clear() #define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define inf (ll)1e18 #define f1 first #define f2 second #define mod (ll)(1e9+7) int main(){ fastio ll n,m,i,j; cin>>n>>m; ll a[n], b[m]; fr(i,n) cin>>a[i]; fr(i,m) cin>>b[i]; vpll dp(1<<m); //leftover, peple cov dp[0]=mp(0,0); fr(i,(1<<m)) if(i){ fr(j,m){ if(dp[(1<<j)^i].f1+b[j]==a[dp[(1<<j)^i].f2+1] && dp[i].f2<dp[(1<<j)^i].f2+1){ dp[i].f2=dp[(1<<j)^i].f2+1; dp[i].f1=0; } else if(dp[(1<<j)^i].f1+b[j]<a[dp[(1<<j)^i].f2+1] && dp[i].f2<dp[(1<<j)^i].f2){ dp[i].f2=dp[(1<<j)^i].f2; dp[i].f1=a[dp[(1<<j)^i].f2+1]-dp[(1<<j)^i].f1+b[j]; } } if(dp[i].f2==n-1) break; } if(i!=(1<<m)) yesno }

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

bank.cpp: In function 'int main()':
bank.cpp:8:15: warning: macro expands to multiple statements [-Wmultistatement-macros]
    8 | #define yesno cout<<"YES"<<endl; else cout<<"NO"<<endl;
      |               ^~~~
bank.cpp:46:19: note: in expansion of macro 'yesno'
   46 |     if(i!=(1<<m)) yesno
      |                   ^~~~~
bank.cpp:46:5: note: some parts of macro expansion are not guarded by this 'if' clause
   46 |     if(i!=(1<<m)) yesno
      |     ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...