# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
293066 | Ruba_K | Jakarta Skyscrapers (APIO15_skyscraper) | C++14 | 1 ms | 384 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;
const int di[] = {1, -1, 0, 0 , 1 , 1 , -1 , -1};
const int dj[] = {0, 0, 1, -1 , 1 , -1 , 1 , -1};
typedef long long ll;
const int N = 3e3 + 3 ;
#define int long long
int n , m , arr[N] ;
int vis[N][N];
int calc(int idx , int jmp){
if(idx >= n || idx < 0)
return 1e9 ;
if(arr[idx])jmp = arr[idx];
if(vis[idx][jmp])
return 1e9 ;
vis[idx][jmp]++;
if(idx == 1)return 0 ;
int first = 1e9 , second = 1e9;
first = 1 + calc(idx + jmp , jmp);
second = 1 + calc(idx - jmp , jmp);
if(min(first , second) >= 5000)return -1 ;
return min(first , second);
# | 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... |