Submission #729698

#TimeUsernameProblemLanguageResultExecution timeMemory
729698ktkeremBoxes with souvenirs (IOI15_boxes)C++17
100 / 100
629 ms284844 KiB
/*#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)

boxes.cpp:5:78: warning: "/*" within comment [-Wcomment]
    5 | #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")/**/
      |
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...