제출 #1059906

#제출 시각아이디문제언어결과실행 시간메모리
1059906Zicrus전선 연결 (IOI17_wiring)C++17
13 / 100
24 ms3908 KiB
#include <bits/stdc++.h> #include "wiring.h" using namespace std; typedef long long ll; ll min_total_length(vector<int> r, vector<int> b) { ll res = 0; for (int i = 0; i < r.size(); i++) { ll ptrB = i >= b.size() ? 0 : i; res += b[ptrB] - r[i]; } for (int i = r.size(); i < b.size(); i++) { res += b[i] - r.back(); } return res; }

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

wiring.cpp: In function 'll min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:9:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for (int i = 0; i < r.size(); i++) {
      |                     ~~^~~~~~~~~~
wiring.cpp:10:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |         ll ptrB = i >= b.size() ? 0 : i;
      |                   ~~^~~~~~~~~~~
wiring.cpp:13:30: 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 = 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...