제출 #83643

#제출 시각아이디문제언어결과실행 시간메모리
83643nikolapesic2802무제 (POI11_tem)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back const int N=1e6+5; vector<int> lo(N),hi(N); int main() { int n; scanf("%i",&n); for(int i=0;i<n;i++) scanf("%i %i",&lo[i],&hi[i]); int r=res; multiset<int,greater<int> > mins; res=1; int s=0; mins.insert(lo[0]); for(int i=1;i<n;i++) { 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:18:11: error: 'res' was not declared in this scope
     int r=res;
           ^~~
tem.cpp:18:9: warning: unused variable 'r' [-Wunused-variable]
     int r=res;
         ^
tem.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%i",&n);
     ~~~~~^~~~~~~~~
tem.cpp:17: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]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~