# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
469215 | AmirrezaM | Liteh and Newfiteh (INOI20_litehfiteh) | C++17 | 316 ms | 142724 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.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define vc vector
#define pb push_back
#define fr first
#define sc second
const int MAXN = 1 << 17 , lg = 19 , inf = 1e8;
int n , a[MAXN] , dp[MAXN] , pd[MAXN][lg][lg];
int main(){
cin >> n;
for(int i = 0 ; i < n ; i++) cin >> a[i];
for(int i = 0 ; i < n ; i++){
if(a[i] > lg){
cout << -1 << endl;
return 0;
}
}
for(int i = 0 ; i < n ; i++){
for(int d = 0 ; d < lg ; d++){
if(a[i] > d + 1 or a[i] < d) pd[i][0][d] = inf;
else pd[i][0][d] = a[i] - d;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |