제출 #905216

#제출 시각아이디문제언어결과실행 시간메모리
905216PetrixAdvertisement 2 (JOI23_ho_t2)C++17
0 / 100
1 ms432 KiB
#include <iostream> #include <algorithm> #include <vector> using namespace std; vector<pair<int,int>> v; int main() { int n,cnt=0,i,curent=-1,a,b; cin>>n; for(i=0;i<n;i++){ cin>>a>>b; v.push_back({a-b,-b+a}); } sort(v.begin(),v.end()); for(i=0;i<v.size();i++){ if(curent<v[i].first){ cnt++;curent=-v[i].second; } } cout<<cnt; return 0; }

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

Main.cpp: In function 'int main()':
Main.cpp:17:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for(i=0;i<v.size();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...