제출 #966116

#제출 시각아이디문제언어결과실행 시간메모리
966116hirayuu_oj마상시합 토너먼트 (IOI12_tournament)C++17
0 / 100
8 ms1624 KiB
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #define all(x) x.begin(),x.end() using ll=long long; template<class S,auto op,auto e> struct SegmentTree{ int size; vector<S> tree; SegmentTree(int sz){ size=sz; tree.resize(size*2); rep(i,size*2)tree[i]=e(); } void set(int pos,S val){ pos+=size; tree[pos]=val; pos/=2; while(pos>0){ tree[pos]=op(tree[pos*2],tree[pos*2+1]); pos/=2; } } S get(int pos){ return tree[pos+size]; } S prod(int lf,int ri){ lf+=size; ri+=size; S ret_lf=e(); S ret_ri=e(); while(lf<ri){ if(lf%2==1){ ret_lf=op(ret_lf,tree[lf]); lf++; } if(ri%2==1){ ri--; ret_ri=op(tree[ri],ret_ri); } lf/=2; ri/=2; } return op(ret_lf,ret_ri); } }; using T=pair<int,int>; T op(T x,T y){ return {x.first+y.first,max(x.second,x.first+y.second)}; } T e(){ return {0,0}; } T add(T x,T y){ return {x.first+y.first,x.second+y.second}; } int ma(int x,int y){ return max(x,y); } int me(){ return -1; } int GetBestPosition(int N, int C, int R, int *K, int *S, int *E) { assert(false); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...