Submission #93701

#TimeUsernameProblemLanguageResultExecution timeMemory
93701someone_aaWiring (IOI17_wiring)C++17
7 / 100
198 ms72760 KiB
#include <bits/stdc++.h> #include "wiring.h" #define ll long long #define mp make_pair #define pb push_back using namespace std; const int maxn = 2100; vector<pair<int, char> > v; ll dp[maxn][maxn]; int n; long long min_total_length(std::vector<int> r, std::vector<int> b) { for(int i=0;i<=r.size();i++) { for(int j=0;j<=b.size();j++) { dp[i][j] = (1LL << 45); } } dp[0][0] = 0LL; for(int i=1;i<=r.size();i++) { for(int j=1;j<=b.size();j++) { dp[i][j] = min(min(dp[i-1][j], dp[i][j-1]), dp[i-1][j-1]) + abs(r[i-1] - b[j-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:14:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<=r.size();i++) {
                 ~^~~~~~~~~~
wiring.cpp:15:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=0;j<=b.size();j++) {
                     ~^~~~~~~~~~
wiring.cpp:20:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=1;i<=r.size();i++) {
                 ~^~~~~~~~~~
wiring.cpp:21:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=1;j<=b.size();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...