Submission #1090995

#TimeUsernameProblemLanguageResultExecution timeMemory
1090995elotelo966Wiring (IOI17_wiring)C++17
Compilation error
0 ms0 KiB
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> using namespace std; #define int long long #define OYY LLONG_MAX #define mod 1000000007 #define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define FOR for(int i=1;i<=n;i++) #define mid (start+end)/2 #define lim 17 #define fi first #define se second int a[lim],b[lim]; int n,m; int dp[lim][(1<<lim)]; inline int f(int sira,int mask){ //cout<<sira<<" "<<mask<<" "<<(1<<m)-1<<endl; if(sira==n){ if(mask==(1<<m)-1)return 0; return OYY; } if(~dp[sira][mask])return dp[sira][mask]; int cev=LLONG_MAX; for(int i=0;i<m;i++){ int tut=f(sira+1,mask|(1<<i)); if(tut==LLONG_MAX)continue; cev=min(cev,tut+abs(a[sira]-b[i])); } return dp[sira][mask]=cev; } int32_t main(){ faster memset(dp,-1,sizeof(dp)); cin>>n>>m; FOR{ cin>>a[i-1]; } for(int i=0;i<m;i++){ cin>>b[i]; } if(n<m){ swap(n,m); swap(a,b); } int cev=f(0,0); cout<<cev<<'\n'; return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccUf3Ybz.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc3nBC4z.o:wiring.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccUf3Ybz.o: in function `main':
grader.cpp:(.text.startup+0x23a): undefined reference to `min_total_length(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status