제출 #416396

#제출 시각아이디문제언어결과실행 시간메모리
416396schse전선 연결 (IOI17_wiring)C++17
0 / 100
1 ms332 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) { vector<vector<long long>> dp(2, vector<long long>(b.size() + 1, INT64_MAX)); dp[0][0] = 0; for (int i = 1; i <= r.size(); i++) { dp[i % 2][max(0, i - 26)] = INT64_MAX; for (int e = max(1, i - 25); e <= b.size() && e <= i + 25; e++) { dp[(i) % 2][i + e] = min(dp[(i - 1) % 2][i + e - 1], dp[(i) % 2][e - 1], dp[(i - 1) % 2][e]) + abs((ll)r[i - 1] - (ll)b[e - 1]); } } return dp[r.size() % 2][b.size()]; }

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

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:19:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  for (int i = 1; i <= r.size(); i++)
      |                  ~~^~~~~~~~~~~
wiring.cpp:22:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |   for (int e = max(1, i - 25); e <= b.size() && e <= i + 25; e++)
      |                                ~~^~~~~~~~~~~
#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...