# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
729698 | ktkerem | Boxes with souvenirs (IOI15_boxes) | C++17 | 629 ms | 284844 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*#pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")/**/
#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef __int128 vll;
typedef long long ftyp;
typedef std::complex<ftyp> vec;
#define llll std::pair<ll , ll>
#define pb push_back
#define fi first
#define sec second
#define cx real
#define cy imag
#define all(a) a.begin() , a.end()
#define debug std::cout << "!!ALERT ALERT!!" << std::endl;
const ll limit = 1e12+7;
const ll sus = 1e5+5;
std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
ll delivery(int n , int k , int l , int pos[]){
ll lpos[n+1];
for(ll i = 0;n>i;i++){
lpos[i+1] = pos[i];
}
ll pre[n+2] , suf[n+2];
pre[0] = suf[n+1] = 0;
for(ll i = 1;n>=i;i++){
pre[i] = lpos[i]*2;
if(i > k) pre[i] += pre[i-k];
suf[n-i+1]=(l - lpos[n-i+1]) * 2;
if(n-i+k <= n){
suf[n-i+1] += suf[n-i+1+k];
}
}
ll ans = suf[1];
for(ll i = 0;n>=i;i++){
ans = std::min(ans , pre[i] + suf[i+1]);
if(i+k <= n) ans = std::min(ans , pre[i] + l + suf[i+k+1]);
else ans = std::min(ans , pre[i] + l);
}
return ans;
}
/*void solve(){
return;
}
int main(){
std::ios_base::sync_with_stdio(false);std::cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("in.txt" , "r" , stdin);
freopen("out.txt" , "w" , stdout);
#endif
ll t = 1;
//std::cin >> t;
while(t--){
solve();
}
}*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |