제출 #107073

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1070732019-04-21 17:17:01thebesLong Mansion (JOI17_long_mansion)C++14
100 / 100
1926 ms56596 KiB
#include <bits/stdc++.h>
using namespace std;
const int MN = 5e5+5;
int N, Q, t, i, x, y, l[MN], r[MN], c[MN], pre[MN], suf[MN], st[3*MN], lst[MN];
vector<int> a[MN];
void build(int i,int s,int e){
if(s!=e){
build(2*i,s,(s+e)/2);
build(2*i+1,(s+e)/2+1,e);
st[i]=min(st[2*i],st[2*i+1]);
}
else st[i]=pre[s];
}
int qu(int i,int s,int e,int ss,int se){
if(s>=ss&&e<=se) return st[i];
else if((s+e)/2<ss) return qu(2*i+1,(s+e)/2+1,e,ss,se);
else if((s+e)/2>=se) return qu(2*i,s,(s+e)/2,ss,se);
else return min(qu(2*i,s,(s+e)/2,ss,se),qu(2*i+1,(s+e)/2+1,e,ss,se));
}
int main(){
for(scanf("%d",&N),i=1;i<N;i++) scanf("%d",&c[i]);
for(i=1;i<=N;i++){
scanf("%d",&t);
while(t--) scanf("%d",&x), a[i].push_back(x);
}
for(i=1;i<N;i++){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

long_mansion.cpp: In function 'int main()':
long_mansion.cpp:25:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(scanf("%d",&N),i=1;i<N;i++) scanf("%d",&c[i]);
         ~~~~~~~~~~~~~~^~~~
long_mansion.cpp:25:42: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(scanf("%d",&N),i=1;i<N;i++) scanf("%d",&c[i]);
                                     ~~~~~^~~~~~~~~~~~
long_mansion.cpp:27:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&t);
         ~~~~~^~~~~~~~~
long_mansion.cpp:28:34: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         while(t--) scanf("%d",&x), a[i].push_back(x);
                    ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
long_mansion.cpp:60:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(scanf("%d",&Q);Q;Q--){
         ~~~~~^~~~~~~~~
long_mansion.cpp:61:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d",&x,&y);
         ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...