Submission #794301

#TimeUsernameProblemLanguageResultExecution timeMemory
794301firewaterWiring (IOI17_wiring)C++14
Compilation error
0 ms0 KiB
#include "wiring.h" #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include <cassert> #define ll long long #define mp make_pair #define fs first #define sn second #define MX 202300 using namespace std; ll n,m1,m2,sum[MX]; pair<ll,ll>a[MX]; long long min_total_length(std::vector<int> r, std::vector<int> b) { m1=r.size(); m2=b.size(); ll sum1=0,sum2=0; for(ll i=0;i<m1;++i) sum1+=r[i]; for(ll i=0;i<m2;++i) sum2+=b[i]; return ((sum2-r[m1-1]*m2)+(b[0]*m1-sum1)-(b[0]-r[m1-1])); // for(ll i=1;i<=m1;++i) // a[i]=mp(r[i-1],1); // for(ll i=1;i<=m2;++i) // a[i+m1]=mp(b[i-1],2); // n=m1+m2; // sort(a+1,a+1+n); // for(ll i=1;i<=n;++i) // sum[i]=a[i].fs+sum[i-1]; // return ((a[m1+1].fs*m1-sum[m1])+((sum[n]-sum[m1])-a[m1].fs*m2)-(a[m1+1].fs-a[m1].fs)); } int main() { int n, m; assert(2 == scanf("%d %d", &n, &m)); vector<int> r(n), b(m); for(int i = 0; i < n; i++) assert(1 == scanf("%d", &r[i])); for(int i = 0; i < m; i++) assert(1 == scanf("%d", &b[i])); long long res = min_total_length(r, b); printf("%lld\n", res); return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccCKVh3F.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc2at0qJ.o:wiring.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status