# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
600357 | idiot123 | Dungeons Game (IOI21_dungeons) | C++17 | 7075 ms | 3412 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>
#include "dungeons.h"
using namespace std;
//we will use powers of 4 to decide what is the best jump
const int MAX_BIT = 13;
//jumps are base 4 to save memory
const int MAX_JUMP = 12;
const long long INF = 1e9;
vector<array<array<int, MAX_JUMP>, MAX_BIT>> jump;
vector<array<array<long long, MAX_JUMP>, MAX_BIT>> maxVal;
vector<array<array<long long, MAX_JUMP>, MAX_BIT>> sum;
int N;
void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l){
N = n;
vector<bool> vis(n+1, false);
jump.resize(n+1);
maxVal.resize(n+1);
sum.resize(n+1);
for(int i = 0; i < n; i++){
for(int bit = 0; bit < MAX_BIT; bit++){
if((1<<bit) >= s[i]){
jump[i][bit][0] = w[i];
maxVal[i][bit][0] = INF;
sum[i][bit][0] = s[i];
}else{
jump[i][bit][0] = l[i];
maxVal[i][bit][0] = s[i]-1;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |