# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1027787 | edogawa_something | Dungeons Game (IOI21_dungeons) | C++17 | 2 ms | 10844 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 "dungeons.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vii;
typedef pair<ll,ll> pii;
#define F first
#define S second
#define pb push_back
#define all(v) v.begin(),v.end()
const ll M=4e5+10;
const ll inf=2e18;
vector<pair<pii,int>>inc[M];
ll awin[M];
ll N;
vector<int>lose;
void init(int n,vector<int>s,vector<int>p,vector<int>w,vector<int>l) {
N=n;
w.pb(n),l.pb(n);
s.pb(0);
for(auto it:l)
lose.pb(it);
for(int i=n-1;i>=0;i--){
for(auto &it:inc[w[i]])
inc[i].pb(it);
for(auto &it:inc[i])
it.F.F-=s[i],it.F.S+=s[i];
while(inc[i].size()&&inc[i].back().F.F<s[i])
inc[i].pop_back();
inc[i].pb({{s[i],0},i});
Compilation message (stderr)
# | 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... |