답안 #106199

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
106199 2019-04-17T09:20:21 Z Hideo Exhibition (JOI19_ho_t2) C++14
100 / 100
109 ms 4716 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pb push_back
#define mk make_pair
#define fr first
#define sc second
#define vi vector < int >
#define vl vector < ll >
#define pi pair < int, int >
#define pii pair < int, pi >
#define vii vector < pi >

const int N = 1e5 + 7;
const int INF = 1e9 + 7;

int c[N];
int n, m, ans;

priority_queue < pi > pq;

main(){
    cin >> n >> m;
    for (int i = 1; i <= n; i++){
        int a, b;
        scanf("%d%d", &a, &b);
        pq.push(mk(b, a));
    }
    for (int i = 1; i <= m; i++)
        scanf("%d", &c[i]);
    sort(c + 1, c + m + 1);
    int it = m;
    while (it > 0 && !pq.empty()){
        if (pq.top().sc <= c[it]){
            it--;
            ans++;
        }
        pq.pop();
    }
    cout << ans;
}

Compilation message

joi2019_ho_t2.cpp:23:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:27:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d", &a, &b);
         ~~~~~^~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:31:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &c[i]);
         ~~~~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 3 ms 256 KB Output is correct
9 Correct 3 ms 256 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 1 ms 384 KB Output is correct
12 Correct 2 ms 384 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 316 KB Output is correct
15 Correct 2 ms 384 KB Output is correct
16 Correct 2 ms 384 KB Output is correct
17 Correct 2 ms 256 KB Output is correct
18 Correct 3 ms 384 KB Output is correct
19 Correct 3 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 3 ms 256 KB Output is correct
9 Correct 3 ms 256 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 1 ms 384 KB Output is correct
12 Correct 2 ms 384 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 316 KB Output is correct
15 Correct 2 ms 384 KB Output is correct
16 Correct 2 ms 384 KB Output is correct
17 Correct 2 ms 256 KB Output is correct
18 Correct 3 ms 384 KB Output is correct
19 Correct 3 ms 384 KB Output is correct
20 Correct 3 ms 384 KB Output is correct
21 Correct 4 ms 384 KB Output is correct
22 Correct 4 ms 384 KB Output is correct
23 Correct 4 ms 384 KB Output is correct
24 Correct 3 ms 384 KB Output is correct
25 Correct 4 ms 384 KB Output is correct
26 Correct 4 ms 384 KB Output is correct
27 Correct 4 ms 384 KB Output is correct
28 Correct 4 ms 384 KB Output is correct
29 Correct 4 ms 448 KB Output is correct
30 Correct 4 ms 384 KB Output is correct
31 Correct 3 ms 384 KB Output is correct
32 Correct 3 ms 384 KB Output is correct
33 Correct 3 ms 444 KB Output is correct
34 Correct 4 ms 384 KB Output is correct
35 Correct 2 ms 256 KB Output is correct
36 Correct 3 ms 384 KB Output is correct
37 Correct 3 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 3 ms 256 KB Output is correct
9 Correct 3 ms 256 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 1 ms 384 KB Output is correct
12 Correct 2 ms 384 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 316 KB Output is correct
15 Correct 2 ms 384 KB Output is correct
16 Correct 2 ms 384 KB Output is correct
17 Correct 2 ms 256 KB Output is correct
18 Correct 3 ms 384 KB Output is correct
19 Correct 3 ms 384 KB Output is correct
20 Correct 3 ms 384 KB Output is correct
21 Correct 4 ms 384 KB Output is correct
22 Correct 4 ms 384 KB Output is correct
23 Correct 4 ms 384 KB Output is correct
24 Correct 3 ms 384 KB Output is correct
25 Correct 4 ms 384 KB Output is correct
26 Correct 4 ms 384 KB Output is correct
27 Correct 4 ms 384 KB Output is correct
28 Correct 4 ms 384 KB Output is correct
29 Correct 4 ms 448 KB Output is correct
30 Correct 4 ms 384 KB Output is correct
31 Correct 3 ms 384 KB Output is correct
32 Correct 3 ms 384 KB Output is correct
33 Correct 3 ms 444 KB Output is correct
34 Correct 4 ms 384 KB Output is correct
35 Correct 2 ms 256 KB Output is correct
36 Correct 3 ms 384 KB Output is correct
37 Correct 3 ms 384 KB Output is correct
38 Correct 76 ms 4676 KB Output is correct
39 Correct 88 ms 4528 KB Output is correct
40 Correct 78 ms 4556 KB Output is correct
41 Correct 80 ms 4456 KB Output is correct
42 Correct 96 ms 4456 KB Output is correct
43 Correct 88 ms 4588 KB Output is correct
44 Correct 90 ms 4532 KB Output is correct
45 Correct 75 ms 4568 KB Output is correct
46 Correct 78 ms 4460 KB Output is correct
47 Correct 95 ms 4204 KB Output is correct
48 Correct 73 ms 4172 KB Output is correct
49 Correct 65 ms 3692 KB Output is correct
50 Correct 60 ms 3688 KB Output is correct
51 Correct 87 ms 4716 KB Output is correct
52 Correct 79 ms 4588 KB Output is correct
53 Correct 82 ms 4428 KB Output is correct
54 Correct 73 ms 4688 KB Output is correct
55 Correct 109 ms 4592 KB Output is correct
56 Correct 39 ms 3180 KB Output is correct
57 Correct 25 ms 1664 KB Output is correct
58 Correct 42 ms 3180 KB Output is correct
59 Correct 40 ms 3180 KB Output is correct
60 Correct 26 ms 1656 KB Output is correct
61 Correct 42 ms 2800 KB Output is correct
62 Correct 71 ms 4584 KB Output is correct
63 Correct 80 ms 4584 KB Output is correct
64 Correct 91 ms 4588 KB Output is correct
65 Correct 84 ms 4588 KB Output is correct
66 Correct 83 ms 4520 KB Output is correct
67 Correct 84 ms 4612 KB Output is correct
68 Correct 74 ms 4588 KB Output is correct
69 Correct 73 ms 4496 KB Output is correct
70 Correct 83 ms 4516 KB Output is correct
71 Correct 80 ms 4580 KB Output is correct
72 Correct 85 ms 4588 KB Output is correct
73 Correct 90 ms 4556 KB Output is correct