제출 #738425

#제출 시각아이디문제언어결과실행 시간메모리
738425Toxtaq전선 연결 (IOI17_wiring)C++17
0 / 100
17 ms1412 KiB
#include<bits/stdc++.h> using namespace std; /// Sub 2 long long min_total_length(vector<int>r, vector<int>b){ int p1 = 0, p2 = b.size() - 1; long long sum = 0; while(p1 < r.size() && p2 >= 0){ sum += b[p2] - r[p1]; p2--; p1++; } if(p1 > r.size()){ for(int i = p2;i >= 0;--i){ sum += b[i] - r.back(); } } else{ for(int i = p1;i < r.size();++i){ sum += b[0] - r[i]; } } return sum; } //int main() //{ // int n, m; // cin >> n >> m; // vector<int>v(n), l(m); // for(int i = 0;i < n;++i){ // cin >> v[i]; // } // for(int i = 0;i < m;++i){ // cin >> l[i]; // } // cout << min_total_length(v, l); //}

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

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