Submission #1036062

# Submission time Handle Problem Language Result Execution time Memory
1036062 2024-07-27T03:12:15 Z Mardonbekhazratov Dungeons Game (IOI21_dungeons) C++17
11 / 100
7000 ms 20652 KB
#include "dungeons.h"
#include <bits/stdc++.h>

using namespace std;

#define ll long long

int n;
vector<int>s,p,w,l;

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

long long simulate(int x, int z) {
	long long ans=z;
	while(x!=n){
		if(s[x]>ans){
			if(l[x]==x) ans+=(s[x]-ans+p[x]-1)/p[x]*p[x];
			else ans+=p[x],x=l[x];
		}
		else ans+=s[x],x=w[x];
	}
	return ans;
}

# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 12 ms 2908 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 12 ms 2908 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Execution timed out 7085 ms 20652 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 27 ms 5192 KB Output is correct
3 Correct 2312 ms 5320 KB Output is correct
4 Correct 2667 ms 4596 KB Output is correct
5 Correct 1808 ms 4556 KB Output is correct
6 Execution timed out 7013 ms 4172 KB Time limit exceeded
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 27 ms 5192 KB Output is correct
3 Correct 2312 ms 5320 KB Output is correct
4 Correct 2667 ms 4596 KB Output is correct
5 Correct 1808 ms 4556 KB Output is correct
6 Execution timed out 7013 ms 4172 KB Time limit exceeded
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 27 ms 5192 KB Output is correct
3 Correct 2312 ms 5320 KB Output is correct
4 Correct 2667 ms 4596 KB Output is correct
5 Correct 1808 ms 4556 KB Output is correct
6 Execution timed out 7013 ms 4172 KB Time limit exceeded
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Execution timed out 7085 ms 20652 KB Time limit exceeded
3 Halted 0 ms 0 KB -