Submission #597163

#TimeUsernameProblemLanguageResultExecution timeMemory
597163Ahmadsm2005Wiring (IOI17_wiring)C++14
7 / 100
155 ms15612 KiB
#include "bits/stdc++.h" using namespace std; vector<int>edges[200001]; long long DP[201][201]; long long min_total_length(vector<int> r, vector<int> b) { for(int i=0;i<=r.size();i++){ for(int l=0;l<=b.size();l++){ DP[i][l]=(long long)1e18; } } DP[0][0]=0; for(int i=0;i<r.size();i++){ for(int l=0;l<b.size();l++){ DP[i+1][l+1]=min(abs(r[i]-b[l])+DP[i][l],DP[i+1][l+1]); DP[i+1][l]=min(abs(r[i]-b[l])+DP[i][l],DP[i+1][l]); DP[i][l+1]=min(abs(r[i]-b[l])+DP[i][l],DP[i][l+1]); } } return DP[r.size()][b.size()]; }

Compilation message (stderr)

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