제출 #104695

#제출 시각아이디문제언어결과실행 시간메모리
104695promota전선 연결 (IOI17_wiring)C++14
13 / 100
59 ms3832 KiB
#include <bits/stdc++.h> long long min_total_length(std::vector<int> r,std::vector<int> b){ long long minLen=0; if(b.size()<=r.size()){ int k=r.size()-b.size(); for(int i=0;i<b.size();i++){ minLen += b[i]-r[r.size()-i-1]; } for(int i=0;i<k;i++) minLen += b[0]-r[i]; } else{ int k=b.size()-r.size(); for(int i=0;i<r.size();i++){ minLen += b[i]-r[r.size()-i-1]; } for(int i=r.size();i<b.size();i++) minLen += b[i]-r[r.size()-1]; } return minLen; }

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

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:7:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int i=0;i<b.size();i++){
                   ~^~~~~~~~~
wiring.cpp:15:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int i=0;i<r.size();i++){
                   ~^~~~~~~~~
wiring.cpp:18:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int i=r.size();i<b.size();i++)
                          ~^~~~~~~~~
wiring.cpp:14:11: warning: unused variable 'k' [-Wunused-variable]
       int k=b.size()-r.size();
           ^
#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...