제출 #313043

#제출 시각아이디문제언어결과실행 시간메모리
313043kylych03전선 연결 (IOI17_wiring)C++14
13 / 100
46 ms3832 KiB
#include "wiring.h" #include <bits/stdc++.h> //#include "grader.cpp" using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { sort(r.begin(), r.end()); sort(b.begin(), b.end()); if(r.back() < b[0]){ long long sum = 0; for(int i = 0 ;i < r.size(); i++) sum += (r.back() - r[i]); for(int i = 0 ;i < b.size(); i++) sum += (b[i] - b[0]); return sum + max(r.size(), b.size()) * 1ll * (b[0] - r.back()); } return 0; }

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

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:11:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |         for(int i = 0 ;i < r.size(); i++)
      |                        ~~^~~~~~~~~~
wiring.cpp:13:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |         for(int i = 0 ;i < b.size(); i++)
      |                        ~~^~~~~~~~~~
#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...