제출 #42744

#제출 시각아이디문제언어결과실행 시간메모리
42744nonocut전선 연결 (IOI17_wiring)C++14
13 / 100
34 ms14304 KiB
//Subtask 2 #include "wiring.h" #include<bits/stdc++.h> using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { long long ans = 0; for(auto x : r) ans -= x; for(auto x : b) ans += x; if(r.size()<b.size()) { for(int i=0;i<b.size()-r.size();i++) ans -= *r.rbegin(); } else { for(int i=0;i<r.size()-b.size();i++) ans += *b.begin(); } return ans; }

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

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:10:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=0;i<b.size()-r.size();i++) ans -= *r.rbegin();
                ^
wiring.cpp:13:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=0;i<r.size()-b.size();i++) ans += *b.begin();
                ^
#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...