제출 #589975

#제출 시각아이디문제언어결과실행 시간메모리
589975AlesL0전선 연결 (IOI17_wiring)C++17
13 / 100
34 ms3768 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 1e9+1; long long min_total_length(std::vector<int> r, std::vector<int> b){ ll s = 0; int mr = 0, mb = INF; for (int i = 0; i < b.size(); i++){ s += b[i]; mb = min(mb, b[i]); } for (int i = 0; i < r.size(); i++){ s -= r[i]; mr = max(mr, r[i]); } ll n = r.size(), m = b.size(); if (n > m)s += (n-m)*mb; else s -= (m-n)*mr; return s; }

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