# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
469078 | Millad | Liteh and Newfiteh (INOI20_litehfiteh) | C++14 | 355 ms | 347388 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.
/// In the name of god
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define debug(x) cerr << #x << " : " << x << '\n'
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
const ll maxn = 1e5 + 5;
const ll inf = 1e18;
const ll lg = 20;
ll n, a[maxn], dp[maxn][lg + 1][lg + 1], pw2[lg + 1], ANS[maxn];
int main(){
pw2[0] = 1;
for(ll i = 1; i < lg; i ++)pw2[i] = (pw2[i - 1] * 2ll);
cin >> n;
for(ll i = 0; i < n; i ++){
cin >> a[i]; ANS[i] = inf;
for(ll j = 0; j < lg; j ++){
if(a[i] < j)dp[i][0][j] = -1;
else if(a[i] == j)dp[i][0][j] = 0;
else if(a[i] == j + 1)dp[i][0][j] = 1;
else dp[i][0][j] = -1;
}
if(dp[i][0][0] != -1){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |