Submission #809063

#TimeUsernameProblemLanguageResultExecution timeMemory
809063BenmathDungeons Game (IOI21_dungeons)C++17
0 / 100
1 ms468 KiB
#include "dungeons.h" #include <bits/stdc++.h> using namespace std; int n1; vector<int>s1; vector<int>p1; vector<int>l1; vector<int>w1; vector<long long int>tipovi; void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) { n1=n; for(int i=0;i<n;i++){ s1[i]=s[i]; p1[i]=p[i]; w1[i]=w[i]; l1[i]=l[i]; } /* sort(s1.begin(),s1.end()); tipovi.push_back(s1[0]); tip[s1[0]]=0; for(int i=1;i<n;i++){ if(s1[i]>s1[i-1]){ tipovi.push_back(s1[i]); tip[s1[i]]=k; k++; } } for(int t=0;t<=k;t++){ for(int j=0;j<=30;j++){ for(int i=n;i>=0;i--){ if(i==n){ type[t][i][j]=0; loc[t][i][j]=n; }else{ if(j==0){ int ro=tip[s1[i]]; if(t>ro){ type[t][i][j]=s[i]; loc[t][i][j]=w[i]; }else{ type[t][i][j]=p[i]; loc[t][i][j]=l[i]; } }else{ loc[t][i][j]=loc[t][loc[t][i][j-1]][j-1]; type[t][i][j]=type[t][i][j-1]+type[t][loc[t][i][j-1]][j-1]; } } } } } */ } long long simulate(int x, int z) { return 0; /* int neki; int t1=0; long long int total=z; int lok=x; while(t1==0){ if(total<tipovi[0]){ neki=0; } int ro=tipovi.size(); if(total>=tipovi[ro-1]){ neki=ro; return (total+type[neki][lok][30]); } for(int i=0;i<ro;i++){ if(i!=(ro-1)){ if(total>=tipovi[i] and total<tipovi[i+1]){ neki=i+1; } } } for(int j=30;j>=0;j--){ if((total+type[neki][lok][j])<tipovi[neki]){ total=total+type[neki][lok][j]; lok=loc[neki][lok][j]; } } total=total+type[neki][lok][0]; lok=loc[neki][lok][0]; if(lok==n){ return total; } } */ }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...