제출 #767328

#제출 시각아이디문제언어결과실행 시간메모리
767328APROHACK전선 연결 (IOI17_wiring)C++14
13 / 100
22 ms3788 KiB
#include "wiring.h" #include <bits/stdc++.h> #define pb push_back #define ff first #define ss second #define ll long long using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { int ir = r.size() -1, ib = 0; ll ans = 0; while(ir >= 0 and ib < b.size()){ ans += b[ib] - r[ir]; ir--; ib++; } while(ir >= 0){ ans += b[0] - r[ir]; ir--; } while(ib < b.size()){ ans += b[ib] - r.back(); ib++; } return ans; }

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

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:12:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  while(ir >= 0 and ib < b.size()){
      |                    ~~~^~~~~~~~~~
wiring.cpp:21:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |  while(ib < b.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...