제출 #598096

#제출 시각아이디문제언어결과실행 시간메모리
598096yutabiRectangles (IOI19_rect)C++14
0 / 100
1 ms468 KiB
#include "rect.h" #include <bits/stdc++.h> using namespace std; long long count_rectangles(std::vector<std::vector<int> > a) { vector <bool> valid(50000,1); int maxi=0; for(int i=0;i<a[1].size();i++) { if(a[1][i]>=a[0][i] || a[1][i]>=a[2][i]) { valid[i]=0; maxi=a[1][i]; } if(a[1][i]>=maxi) { maxi=a[1][i]; valid[i]=0; } } maxi=0; for(int i=a[1].size()-1;i>=0;i--) { if(a[1][i]>=a[0][i] || a[1][i]>=a[2][i]) { valid[i]=0; maxi=a[1][i]; } if(a[1][i]>=maxi) { maxi=a[1][i]; valid[i]=0; } } vector <int> s; int res=0; for(int i=0;i<a[1].size();i++) { while(s.size() && a[1][i]>s.back()) { s.pop_back(); } if(valid[i]==1) { res++; if(s.size() && s.back()==a[1][i]) { res--; } } s.push_back(a[1][i]); } return res; }

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

rect.cpp: In function 'long long int count_rectangles(std::vector<std::vector<int> >)':
rect.cpp:19:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  for(int i=0;i<a[1].size();i++)
      |              ~^~~~~~~~~~~~
rect.cpp:59:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   59 |  for(int i=0;i<a[1].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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...