제출 #42332

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
423322018-02-26 07:04:08milmillinDeda (COCI17_deda)C++14
60 / 140
1064 ms3328 KiB
#include <cstdio>
#include <vector>
#include <cstring>
using namespace std;
int seg[600100];
void update(int idx,int l,int r,int k,int val) {
if (k<l||k>=r) return;
if (l+1==r) {
seg[idx]=val;
return;
}
int m = (l+r)>>1;
update(idx*2,l,m,k,val);
update(idx*2+1,m,r,k,val);
seg[idx]=min(seg[idx*2],seg[idx*2+1]);
//printf("++ %d %d %d\n",l,r,seg[idx]);
}
int get(int idx,int l,int r,int ll,int rr,int k) {
//printf("gg %d %d %d %d %d %d\n",l,r,ll,rr,k,seg[idx]);
if (ll>=r||rr<=l) return 2e9;
if (l+1==r) return (seg[idx]<=k)?l:2e9;
int m = (l+r)>>1;
if (ll>=m) {
return get(idx*2+1,m,r,ll,rr,k);
} else if (rr<=m) {
return get(idx*2,l,m,ll,rr,k);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

deda.cpp: In function 'int main()':
deda.cpp:44:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&n,&q);
                     ^
deda.cpp:49:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf(" %c%d%d",&x,&a,&b);
                            ^
#Verdict Execution timeMemoryGrader output
Fetching results...