Submission #878692

#TimeUsernameProblemLanguageResultExecution timeMemory
878692hasan2006Exhibition (JOI19_ho_t2)C++17
100 / 100
107 ms6340 KiB
#include <bits/stdc++.h> using namespace std; #define TL ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); #define rall(s) s.rbegin(),s.rend() #define all(s) s.begin(),s.end() #define pb push_back #define se second #define fi first #define ll long long #define ld long double #define YES cout<<"YES\n" #define Yes cout<<"Yes\n" #define yes cout<<"yes\n" #define NO cout<<"NO\n" #define No cout<<"No\n" #define no cout<<"no\n" const int N = 5e5 + 9 , mod = 1e9 + 7; ll a[N] = {}, b[N] , c[N] , d[N] , dp[N][3]; void solve() { ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn = 1e18 , mx = 0; cin>>n>>m; vector<pair<int,int>>v; for(i = 1; i <= n; i++){ cin>>x>>y; v.pb({y , x}); } for(i = 1; i <= m; i++){ cin>>a[i]; } sort(rall(v)); sort(a + 1 , a + m + 1); reverse(a + 1 , a + m + 1); s = 0; for(i = 0; i < n; i++) if(v[i].se <= a[s + 1]) s++; cout<<s<<"\n"; } int main(){ int t = 1; //cin>>t; while(t--) { solve(); } } // Author : حسن

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'void solve()':
joi2019_ho_t2.cpp:27:8: warning: unused variable 'q' [-Wunused-variable]
   27 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |        ^
joi2019_ho_t2.cpp:27:16: warning: unused variable 'j' [-Wunused-variable]
   27 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                ^
joi2019_ho_t2.cpp:27:26: warning: unused variable 'z' [-Wunused-variable]
   27 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                          ^
joi2019_ho_t2.cpp:27:37: warning: unused variable 'f' [-Wunused-variable]
   27 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                     ^
joi2019_ho_t2.cpp:27:40: warning: unused variable 'l' [-Wunused-variable]
   27 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                        ^
joi2019_ho_t2.cpp:27:44: warning: unused variable 'r' [-Wunused-variable]
   27 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                            ^
joi2019_ho_t2.cpp:27:48: warning: unused variable 'k' [-Wunused-variable]
   27 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                                ^
joi2019_ho_t2.cpp:27:60: warning: unused variable 'mn' [-Wunused-variable]
   27 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                                            ^~
joi2019_ho_t2.cpp:27:73: warning: unused variable 'mx' [-Wunused-variable]
   27 |     ll q , i , j , m ,n, z ,s = 0 , f, l , r , k , x , y , mn  = 1e18 , mx = 0;
      |                                                                         ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...