제출 #670454

#제출 시각아이디문제언어결과실행 시간메모리
670454berrExhibition (JOI19_ho_t2)C++17
0 / 100
1 ms340 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n, m; cin>>n>>m; vector<int> c(m); vector<array<int, 2>> a(n); for(int i = 0; i < n; i++){ cin >> a[i][0] >> a[i][1]; } for(int i = 0; i < m; i++){ cin>>c[i]; } sort(a.begin(), a.end()); sort(c.begin(), c.end()); int s=0; for(int i=20; i>=0; i--){ int tmp= s + (1<<i); if(tmp<=m){ vector<array<int, 2>> t(tmp); for(int l=0; l<tmp; l++){ t[l]=a[l]; swap(t[l][0], t[l][1]); } sort(t.begin(), t.end()); int flag=1; int l=0; for(int j=m-tmp; j<m; j++) { if(t[l][1]>c[j]) flag=0; l++; } if(flag) s=tmp; } } cout<<s; }

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

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:49:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   49 |                 if(t[l][1]>c[j]) flag=0; l++;
      |                 ^~
joi2019_ho_t2.cpp:49:42: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   49 |                 if(t[l][1]>c[j]) flag=0; l++;
      |                                          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...