Submission #1024883

#TimeUsernameProblemLanguageResultExecution timeMemory
1024883c2zi6Wiring (IOI17_wiring)C++14
13 / 100
18 ms4440 KiB
#define _USE_MATH_DEFINES #include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define all(a) (a).begin(), (a).end() #define replr(i, a, b) for (int i = int(a); i <= int(b); ++i) #define reprl(i, a, b) for (int i = int(a); i >= int(b); --i) #define rep(i, n) for (int i = 0; i < int(n); ++i) #define mkp(a, b) make_pair(a, b) using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<PII> VPI; typedef vector<VI> VVI; typedef vector<VVI> VVVI; typedef vector<VPI> VVPI; typedef pair<ll, ll> PLL; typedef vector<ll> VL; typedef vector<PLL> VPL; typedef vector<VL> VVL; typedef vector<VVL> VVVL; typedef vector<VPL> VVPL; template<class T> T setmax(T& a, T b) {if (a < b) return a = b; return a;} template<class T> T setmin(T& a, T b) {if (a < b) return a; return a = b;} #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; template<class T> using indset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #include "wiring.h" namespace TEST2 { ll min_total_length(VI a, VI b) { ll ans = 0; int l = a.size()-1; int r = 0; while (l >= 0 && r < b.size()) { ans += b[r] - a[l]; l--; r++; } while (l >= 0) ans += b[0] - a[l--]; while (r < b.size()) ans += b[r++] - a.back(); return ans; } }; ll min_total_length(VI l, VI b) { if (l.back() < b[0]) return TEST2::min_total_length(l, b); return 0; }

Compilation message (stderr)

wiring.cpp: In function 'll TEST2::min_total_length(VI, VI)':
wiring.cpp:39:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |         while (l >= 0 && r < b.size()) {
      |                          ~~^~~~~~~~~~
wiring.cpp:45:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |         while (r < b.size()) ans += b[r++] - a.back();
      |                ~~^~~~~~~~~~
#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...