제출 #83609

#제출 시각아이디문제언어결과실행 시간메모리
83609nikolapesic2802무제 (POI11_tem)C++14
24 / 100
1042 ms33792 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back int main() { int n; scanf("%i",&n); vector<int> lo(n),hi(n); for(int i=0;i<n;i++) scanf("%i %i",&lo[i],&hi[i]); int last; multiset<int,greater<int> > mins; int res=1; int s=0; mins.insert(lo[0]); last=hi[0]; for(int i=1;i<n;i++) { if(lo[i]>last) { mins.clear(); mins.insert(lo[i]); last=hi[i]; s=i; continue; } while(mins.size()&&*mins.begin()>hi[i]) { mins.erase(mins.find(lo[s])); s++; } mins.insert(lo[i]); res=max(res,i-s+1); } printf("%i\n",res); return 0; }

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

tem.cpp: In function 'int main()':
tem.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%i",&n);
     ~~~~~^~~~~~~~~
tem.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%i %i",&lo[i],&hi[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...