제출 #1036440

#제출 시각아이디문제언어결과실행 시간메모리
1036440DeathIsAwe전선 연결 (IOI17_wiring)C++14
13 / 100
22 ms3932 KiB
#include "wiring.h" #include <bits/stdc++.h> using namespace std; #define ll long long long long min_total_length(vector<int> r, vector<int> b) { ll ans = 0, temp; if (b.size() > r.size()) { for (int i=0;i<b.size();i++) { temp = min(i, (int)r.size() - 1); ans += b[i] - r[temp]; } } else { for (int i=0;i<r.size();i++) { temp = max((int)b.size()-i-1, 0); ans += b[temp] - r[(int)r.size()-i-1]; } } return ans; }

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

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