답안 #1023888

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1023888 2024-07-15T08:38:07 Z vjudge1 Exhibition (JOI19_ho_t2) C++17
100 / 100
38 ms 4188 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int N = 1e6+5;

#define pii pair<int, int>
#define fi first
#define se second

int n, m, c[N];
pii a[N];

void sol() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) cin >> a[i].fi >> a[i].se;
  for (int i = 1; i <= m; ++i) cin >> c[i];
  sort(c+1, c+m+1);
  sort(a+1, a+n+1, [&](pii &p1, pii &p2) -> bool {
    if (p1==p2) return 0;
    else if (p1.se == p2.se) return p1.fi < p2.fi;
    else return p1.se < p2.se;
  });
  int j = m;
  for (int i = n; min(i, j) >= 1; --i)
    if (a[i].fi <= c[j])
      j--;
  cout << m-j;
}

signed main() {
  cin.tie(0) -> sync_with_stdio(0);
  if (fopen("A.inp", "r")) freopen("A.inp", "r", stdin);
  int tc = 1; // cin >> tc;
  for (int test = 1; test <= tc; ++test) sol();
}

Compilation message

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:33:35: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   33 |   if (fopen("A.inp", "r")) freopen("A.inp", "r", stdin);
      |                            ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 604 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 604 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 500 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 344 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 604 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 500 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 344 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 36 ms 4088 KB Output is correct
39 Correct 33 ms 4180 KB Output is correct
40 Correct 30 ms 3960 KB Output is correct
41 Correct 36 ms 4188 KB Output is correct
42 Correct 35 ms 4176 KB Output is correct
43 Correct 33 ms 4184 KB Output is correct
44 Correct 38 ms 4180 KB Output is correct
45 Correct 32 ms 4184 KB Output is correct
46 Correct 32 ms 4168 KB Output is correct
47 Correct 29 ms 3700 KB Output is correct
48 Correct 29 ms 3932 KB Output is correct
49 Correct 28 ms 3420 KB Output is correct
50 Correct 32 ms 3336 KB Output is correct
51 Correct 32 ms 4184 KB Output is correct
52 Correct 34 ms 4176 KB Output is correct
53 Correct 32 ms 4188 KB Output is correct
54 Correct 28 ms 4176 KB Output is correct
55 Correct 35 ms 4180 KB Output is correct
56 Correct 22 ms 3152 KB Output is correct
57 Correct 12 ms 1628 KB Output is correct
58 Correct 23 ms 2908 KB Output is correct
59 Correct 22 ms 2988 KB Output is correct
60 Correct 13 ms 1780 KB Output is correct
61 Correct 20 ms 2640 KB Output is correct
62 Correct 33 ms 4088 KB Output is correct
63 Correct 32 ms 4172 KB Output is correct
64 Correct 33 ms 4176 KB Output is correct
65 Correct 37 ms 4184 KB Output is correct
66 Correct 34 ms 3940 KB Output is correct
67 Correct 33 ms 4008 KB Output is correct
68 Correct 34 ms 4188 KB Output is correct
69 Correct 33 ms 4188 KB Output is correct
70 Correct 35 ms 4052 KB Output is correct
71 Correct 33 ms 4172 KB Output is correct
72 Correct 35 ms 4184 KB Output is correct
73 Correct 31 ms 4188 KB Output is correct