Submission #422254

#TimeUsernameProblemLanguageResultExecution timeMemory
422254PbezzWiring (IOI17_wiring)C++14
Compilation error
0 ms0 KiB
#include "wiring.h" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long #define pb push_back typedef pair<ll,ll> pii; typedef tree<ll, null_type,less<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; const ll MAXN = 2e5+4; const ll INF = 1e9+7; long long min_total_length(std::vector<int> r, std::vector<int> b){ ll n=(ll)r.size(), m=(ll)b.size(),ans=0; for(i=0;i<n-1;i++){ ans+=b[0]-r[i]; } for(i=1;i<m;i++){ ans+=b[i]-r[n-1]; } return ans; }

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:21:5: error: 'i' was not declared in this scope
   21 | for(i=0;i<n-1;i++){
      |     ^
wiring.cpp:25:5: error: 'i' was not declared in this scope
   25 | for(i=1;i<m;i++){
      |     ^