제출 #434541

#제출 시각아이디문제언어결과실행 시간메모리
434541medmdg전선 연결 (IOI17_wiring)C++14
0 / 100
1 ms204 KiB
#include<bits/stdc++.h> #include "wiring.h" #define ll long long using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { ll c=0; ll x=0,y=10000000000; for(int i=0;i<r.size();i++){ x=max(x,(ll)(r[i])); c-=r[i]; } c-=max((unsigned ll)(0),(b.size()-r.size())*x); for(int i=0;i<b.size();i++){ y=min(x,(ll)(b[i])); c+=b[i]; } c+=max((unsigned ll)(0),(r.size()-b.size())*y); return c; }

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

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