제출 #405782

#제출 시각아이디문제언어결과실행 시간메모리
405782peuch전선 연결 (IOI17_wiring)C++17
13 / 100
31 ms3788 KiB
#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; int it1 = -1; int it2 = b.size(); while(it1 != r.size() - 1 || it2 != 0){ if(it1 != r.size() - 1) it1++; if(it2 != 0) it2--; ans += b[it2] - r[it1]; // printf("Adding: %d - %d\n", b[it2], r[it1]); } return ans; }

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

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:9:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  while(it1 != r.size() - 1 || it2 != 0){
      |        ~~~~^~~~~~~~~~~~~~~
wiring.cpp:10:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |   if(it1 != r.size() - 1) it1++;
      |      ~~~~^~~~~~~~~~~~~~~
#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...