제출 #422257

#제출 시각아이디문제언어결과실행 시간메모리
422257Pbezz전선 연결 (IOI17_wiring)C++14
컴파일 에러
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,i; ll le=n-1,ri=0; while(le>=0&&ri<=m){ ans+=b[ri]-r[le]; le--; ri++; } if(le<0){ while(rri<=m){ ans+=b[ri]-r[n-1]; ri++; } }else{ while(le>=0){ ans+=b[0]-r[le]; le--; } } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:31:7: error: 'rri' was not declared in this scope; did you mean 'ri'?
   31 | while(rri<=m){
      |       ^~~
      |       ri
wiring.cpp:19:41: warning: unused variable 'i' [-Wunused-variable]
   19 | ll n=(ll)r.size(), m=(ll)b.size(),ans=0,i;
      |                                         ^