Submission #240290

#TimeUsernameProblemLanguageResultExecution timeMemory
240290Ruxandra985Wiring (IOI17_wiring)C++14
13 / 100
49 ms3840 KiB
#include <bits/stdc++.h> #include "wiring.h" #define INF 2000000000 using namespace std; int taken[200010]; long long min_total_length(vector<int> r, vector<int> b) { int i , curr , j; long long sol = 0 , val1 , val2; i = r.size() - 1; j = 0; while (i >= 0 && j < b.size()){ sol = sol + b[j] - r[i]; i--; j++; } while (i >= 0){ sol = sol + b[0] - r[i]; i--; } while (j < b.size()){ sol = sol + b[j] - r.back(); j++; } return sol; }

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:16:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while (i >= 0 && j < b.size()){
                      ~~^~~~~~~~~~
wiring.cpp:27:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while (j < b.size()){
            ~~^~~~~~~~~~
wiring.cpp:10:13: warning: unused variable 'curr' [-Wunused-variable]
     int i , curr , j;
             ^~~~
wiring.cpp:11:25: warning: unused variable 'val1' [-Wunused-variable]
     long long sol = 0 , val1 , val2;
                         ^~~~
wiring.cpp:11:32: warning: unused variable 'val2' [-Wunused-variable]
     long long sol = 0 , val1 , val2;
                                ^~~~
#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...