제출 #429529

#제출 시각아이디문제언어결과실행 시간메모리
429529Belgutei전선 연결 (IOI17_wiring)C++17
0 / 100
1 ms204 KiB
#include "wiring.h" #include<bits/stdc++.h> using namespace std; #define ll long long #define ff first #define ss second #define mk make_pair #define pb push_back long long min_total_length(std::vector<int> r, std::vector<int> b) { ll cc=0; for(int i=0; i<b.size(); i++){ if(b[i]<=r[r.size()-1]) cc=1; } if(cc==0){ // subtask 3 long long ans=0; if(r.size()>=b.size()){ int c=r.size()-1; int d=b.size()-1; while(d>=0){ ans+=b[d]-r[c]; d--; c--; } for(int i=c; i>=0; i--){ ans+=r[i]-b[0]; } return ans; } else{ for(int i=0; i<r.size(); i++){ ans+=b[i]-r[i]; } for(int i=r.size(); i<b.size(); i++){ ans+=b[i]-r[r.size()-1]; } return ans; } } return 0; }

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

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