Submission #1158995

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11589952025-02-28 02:56:37emptypringlescanWiring (IOI17_wiring)C++20
100 / 100
24 ms10780 KiB
#include <bits/stdc++.h>
using namespace std;
#include "wiring.h"
vector<pair<long long,int> > arr;
long long min_total_length(vector<int> r, vector<int> b){
arr.push_back({-1,-1});
int c1=0,c2=0;
while(c1<(int)r.size()||c2<(int)b.size()){
if(c1==(int)r.size()){
arr.push_back({b[c2],1});
c2++;
}
else if(c2==(int)b.size()){
arr.push_back({r[c1],0});
c1++;
}
else if(r[c1]<b[c2]){
arr.push_back({r[c1],0});
c1++;
}
else{
arr.push_back({b[c2],1});
c2++;
}
}
long long dp[200005];
for(int i=0; i<200005; i++) dp[i]=1e16;
dp[0]=0;
int pst=0,curst=1;
long long back[200005],pref[200005],best,cur,sum;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...