Submission #442808

# Submission time Handle Problem Language Result Execution time Memory
442808 2021-07-09T07:38:05 Z baluteshih Dungeons Game (IOI21_dungeons) C++17
11 / 100
7000 ms 19752 KB
#include "dungeons.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define X first
#define Y second
#define ALL(v) v.begin(), v.end()
#define pb push_back
#define SZ(a) ((int)a.size())

int N;
vector<int> S, P, W, L;

void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l) {
    N = n;
    S = s;
    P = p;
    W = w;
    L = l;
	return;
}

long long simulate(int x, int z) {
    ll nw = z;
    while (x != N) {
        if (nw >= S[x])
            nw += S[x], x = W[x];
        else
            nw += P[x], x = L[x];
    }
	return nw;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 23 ms 2692 KB Output is correct
5 Correct 2 ms 332 KB Output is correct
6 Correct 23 ms 2680 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Execution timed out 7084 ms 19752 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 46 ms 3508 KB Output is correct
3 Correct 2640 ms 3496 KB Output is correct
4 Correct 3076 ms 3424 KB Output is correct
5 Correct 2066 ms 3404 KB Output is correct
6 Execution timed out 7069 ms 3408 KB Time limit exceeded
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 46 ms 3508 KB Output is correct
3 Correct 2640 ms 3496 KB Output is correct
4 Correct 3076 ms 3424 KB Output is correct
5 Correct 2066 ms 3404 KB Output is correct
6 Execution timed out 7069 ms 3408 KB Time limit exceeded
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 46 ms 3508 KB Output is correct
3 Correct 2640 ms 3496 KB Output is correct
4 Correct 3076 ms 3424 KB Output is correct
5 Correct 2066 ms 3404 KB Output is correct
6 Execution timed out 7069 ms 3408 KB Time limit exceeded
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Execution timed out 7084 ms 19752 KB Time limit exceeded
3 Halted 0 ms 0 KB -