Submission #422263

#TimeUsernameProblemLanguageResultExecution timeMemory
422263PbezzWiring (IOI17_wiring)C++14
13 / 100
28 ms1868 KiB
#include "wiring.h" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long #define pb push_back typedef pair<ll,ll> pii; typedef tree<ll, null_type,less<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; const ll MAXN = 2e5+4; const ll INF = 1e9+7; long long min_total_length(std::vector<int> r, std::vector<int> b){ ll n=(ll)r.size(), m=(ll)b.size(),ans=0; ll le=0,ri=m-1; while(le<n&&ri>=0){ ans+=b[ri]-r[le]; le++; ri--; }//cout<<le<<" "<<ri<<" "<<ans<<endl; if(le>=n){ while(ri>=0){ ans+=b[ri]-r[n-1]; ri--; } }else{ while(le<n){ ans+=b[0]-r[le]; le++; } } return ans; }
#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...