제출 #122529

#제출 시각아이디문제언어결과실행 시간메모리
122529baqargam전선 연결 (IOI17_wiring)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "wiring.h" using namespace std; long long min_total_length(vector<long long> r, vector<long long> b) { sort(r.begin(),r.end()); sort(b.begin(),b.end()); long long n=r.size(); long long m=b.size(); long long res=(b[0]-r[n-1])*max(n,m); for(long long i=0;i<n;i++) res+=r[n-1]-r[i]; for(long long i=0;i<m;i++) res+=b[i]-b[0]; return res; }

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

wiring.cpp: In function 'long long int min_total_length(std::vector<long long int>, std::vector<long long int>)':
wiring.cpp:14:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
     for(long long i=0;i<m;i++)
     ^~~
wiring.cpp:16:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  return res;
  ^~~~~~
/tmp/ccrjnLG0.o: In function `main':
grader.cpp:(.text.startup+0x23b): undefined reference to `min_total_length(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status