답안 #878691

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
878691 2023-11-25T05:33:46 Z hasan2006 Exhibition (JOI19_ho_t2) C++17
0 / 100
1 ms 2396 KB
#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({x , y});
    }
    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

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;
      |                                                                         ^~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Incorrect 0 ms 2396 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Incorrect 0 ms 2396 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Incorrect 0 ms 2396 KB Output isn't correct
3 Halted 0 ms 0 KB -