제출 #416212

#제출 시각아이디문제언어결과실행 시간메모리
416212schse전선 연결 (IOI17_wiring)C++17
13 / 100
35 ms3780 KiB
#include <bits/stdc++.h> #ifndef EVAL #include "grader.cpp" #endif #define ll long long #include "wiring.h" using namespace std; ll min(ll a, ll b, ll c) { return std::min(a, std::min(b, c)); } long long min_total_length(std::vector<int> r, std::vector<int> b) { ll sum = 0; for (ll lines = 1, i = 1; i < r.size(); i++, lines++) sum += lines * (r[i] - r[i - 1]); for (ll lines = 1, i = b.size() - 2; i >= 0; i--, lines++) sum += lines * (b[i + 1] - b[i]); sum += max(r.size(), b.size()) * (b[0] - r.back()); return sum; }

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

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