Submission #471403

#TimeUsernameProblemLanguageResultExecution timeMemory
471403Cross_RatioWiring (IOI17_wiring)C++14
13 / 100
39 ms3780 KiB
#include "wiring.h" #include <bits/stdc++.h> using namespace std; long long min_total_length(vector<int> r,vector<int> b) { int N = r.size(); int M = b.size(); long long int cnt = 0; int i, j; if(N<M) { for(i=0;i<M;i++) cnt += b[i]; for(i=0;i<M;i++) { if(i < N) cnt -= r[i]; else cnt -= r[N-1]; } return cnt; } else { for(i=0;i<N;i++) { if(i<M) cnt += b[i]; else cnt += b[0]; } for(i=0;i<N;i++) cnt -= r[i]; return cnt; } }

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:8:10: warning: unused variable 'j' [-Wunused-variable]
    8 |   int i, j;
      |          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...