# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
800575 | Theo830 | Liteh and Newfiteh (INOI20_litehfiteh) | C++17 | 2 ms | 2644 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,a,b) for(ll i = a;i < b;i++)
#define pb push_back
#define ii pair<ll,ll>
#define iii pair<ll,ii>
#define F first
#define S second
ll exo[100005][18][18];
const ll INF = 1e9;
ll dp[100005];
ll n;
ll solve(ll idx){
if(idx == n){
return 0;
}
if(dp[idx] != -1){
return dp[idx];
}
ll ans = INF;
f(j,0,18){
if(idx + (1<<j) > n){
break;
}
ans = min(ans,solve(idx + (1<<j)) + exo[idx][0][j]);
}
cout<<idx<<" "<<ans<<"\n";
return dp[idx] = ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |