제출 #617484

#제출 시각아이디문제언어결과실행 시간메모리
617484Sergio_2357전선 연결 (IOI17_wiring)C++17
13 / 100
23 ms3772 KiB
#include "wiring.h" #include <bits/stdc++.h> using namespace std; #define int long long int min_total_length(vector<signed> r, vector<signed> b) { sort(b.begin(), b.end()); int res = 0; for (int i = 0; i < r.size(); i++) res += b[0] - r[i]; if (r.size() < b.size()) res += (b[0] - r[r.size() - 1]) * (b.size() - r.size()); for (int i = 0; i < b.size(); i++) res += b[i] - b[0]; return res; }

컴파일 시 표준 에러 (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: 'long long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for (int i = 0; i < r.size(); i++)
      |                     ~~^~~~~~~~~~
wiring.cpp:16:23: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |     for (int i = 0; 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...