제출 #1119730

#제출 시각아이디문제언어결과실행 시간메모리
1119730tsengang경주 (Race) (IOI11_race)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define ll long long #define ff first #define ss second #define all(x) x.begin(), x.end() #define pb push_back #define ertunt return #define vodka void using namespace std; ll n,m; ll a[21]; ll b[21]; bool yes; bool vis[21]; vodka dfs(ll x){ if(x > n-1){ yes = true; ertunt; } for(ll i = 0; i < m; i++){ if(vis[i] == false){ if(b[i] <= a[x]){ a[x]-=b[i]; vis[i] = true; if(a[x] == 0)dfs(x+1); else dfs(x); vis[i] = false; a[x]+=b[i]; } } } } int main(){ cin >> n >> m; if(n == 1){ ll d; cin >> d; ll b[m+1]; for(ll j = 1; j <= m; j++)cin >> b[j]; for(ll i = 1; i <= (1<<m); i++){ ll res = 0; for(ll j = 0; j < m; j++){ if(i&(1<<j)){ res+=b[j]; } } if(res == d){ cout << "YES"; ertunt 0; } } cout << "NO"; ertunt 0; } for(ll i = 0; i < n; i++) cin >> a[i]; for(ll i = 0; i < m; i++) cin >> b[i]; sort(a,a+n); sort(b,b+m); dfs(0); if(yes)cout << "YES\n"; else cout << "NO"; }

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

/usr/bin/ld: /tmp/cctNP7dU.o: in function `main':
race.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccpNwEbT.o:grader.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccpNwEbT.o: in function `main':
grader.cpp:(.text.startup+0x28): undefined reference to `best_path(int, int, int (*) [2], int*)'
collect2: error: ld returned 1 exit status