제출 #77231

#제출 시각아이디문제언어결과실행 시간메모리
77231farukkastamonuda무제 (POI11_tem)C++14
40 / 100
354 ms33792 KiB
#include <bits/stdc++.h> using namespace std; int n,s[1000000],e[1000000],x[1000000],v[1000000],mn,c[1000000],ans,ds,de; int main(){ scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d%d",s+i,e+i); } ds=de=n; for(int i=0;i<n;i++){ int cmn=i; while(ds<de && s[x[ds]]<s[i]){ cmn=min(cmn,v[x[ds]]); c[v[x[ds]]]=0; ds++; } c[cmn]=1; while(ds<de && s[x[de-1]]>e[i]){ de--; c[v[x[de]]]=0; while(!c[mn]) mn++; } x[--ds]=i; v[i]=cmn; ans=max(ans,i-mn+1); } printf("%d\n",ans); return 0; }

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

tem.cpp: In function 'int main()':
tem.cpp:5:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
tem.cpp:7:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d",s+i,e+i);
         ~~~~~^~~~~~~~~~~~~~~~
#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...
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...