diff --git a/hihoCoder/1068_jhgkjhg_ugtdk77.cpp b/hihoCoder/1068_jhgkjhg_ugtdk77.cpp new file mode 100644 index 0000000..ca9e2a2 --- /dev/null +++ b/hihoCoder/1068_jhgkjhg_ugtdk77.cpp @@ -0,0 +1,75 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +typedef long long ll; +typedef unsigned int uint; +typedef unsigned long long ull; + +const int maxn = 1e6 + 5; +const int max_pos = 20 ; + +struct Q{ int l,r; } quary[maxn]; + +int N,Q; +int weight[maxn]; +int rmq[maxn][max_pos]; + +void init(){ + memset(rmq,0x5f,sizeof(rmq)); +} + +void input(){ + scanf("%d",&N); + for(int i=1;i<=N;i++) scanf("%d",&weight[i]); + scanf("%d",&Q); + for(int i=1;i<=Q;i++) scanf("%d%d",&quary[i].l,&quary[i].r); +} +/* +int get_mi(int x){ + int ret=0; + for(int i=1;i<=x;i*=2) ret++; + return ret-1; +} +*/ + +void RMQ_ST(){ + for(int i=1;i<=N;i++) rmq[i][0]=weight[i]; + //int l=get_mi(N); + int l=(int)((log(N))/(log(2.0))); + for(int j=1;j<=l;j++){ + for(int i=1;i+(1<