제출 #914487

#제출 시각아이디문제언어결과실행 시간메모리
914487tosivanmak전선 연결 (IOI17_wiring)C++17
0 / 100
148 ms262144 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long long long min_total_length(vector<int> r, vector<int> b) { r.insert(r.begin(), 0); b.insert(b.begin(),0); if(r.size()<b.size()){ swap(r,b); } ll dp[r.size()+5][b.size()+5]; ll n=r.size(),m=b.size(); for(int i=0;i<r.size()+5;i++){ for(int j=0;j<b.size()+5;j++){ dp[i][j]=1e17; } } dp[0][0]=0; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ dp[i][j]=min(dp[i-1][j-1],dp[i-1][j])+abs(r[i]-b[j]); } } return dp[n][m]; }

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

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