# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
914487 | 2024-01-22T09:06:54 Z | tosivanmak | Wiring (IOI17_wiring) | C++17 | 148 ms | 262144 KB |
#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]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | 3rd lines differ - on the 1st token, expected: '14340', found: '17422' |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Runtime error | 148 ms | 262144 KB | Execution killed with signal 9 |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Incorrect | 1 ms | 344 KB | 3rd lines differ - on the 1st token, expected: '17703', found: '19052' |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 604 KB | 3rd lines differ - on the 1st token, expected: '27', found: '30' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | 3rd lines differ - on the 1st token, expected: '14340', found: '17422' |
3 | Halted | 0 ms | 0 KB | - |