Submission #81844

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
818442018-10-27 08:04:25gs18115트리 (KOI16_tree)C++14
100 / 100
484 ms38244 KiB
#include<iostream>
#include<vector>
using namespace std;
const int MAXN=2e5+10;
const int n=524288;
int in[MAXN],out[MAXN],dp[MAXN];
int ecnt;
vector<int>adj[MAXN];
void ET(const int&X,int dep)
{
in[X]=++ecnt;
dp[X]=dep++;
for(const int&i:adj[X])
ET(i,dep);
out[X]=++ecnt;
return;
}
inline int mn(const int&x,const int&y)
{
return dp[x]>dp[y]?x:y;
}
int ST[n*2+10],lz[n*2+10];
int query(const int&N,const int&i,const int&x,const int&y)
{
if(x==y)
return mn(ST[N],lz[N]);
int l=N<<1;
int r=l+1;
if(dp[ST[N]]<dp[lz[N]])
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

tree.cpp: In function 'int query(const int&, const int&, const int&, const int&)':
tree.cpp:35:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     int mid=x+y>>1;
             ~^~
tree.cpp: In function 'void lazy(const int&, const int&, const int&, const int&, const int&, const int&)':
tree.cpp:57:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     int mid=x+y>>1;
             ~^~
#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...