Submission #366265

# Submission time Handle Problem Language Result Execution time Memory
366265 2021-02-13T17:31:42 Z Killer2501 Exhibition (JOI19_ho_t2) C++14
100 / 100
80 ms 29236 KB
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define task "deleg"
#define pll pair<ll, ll>
#define pii pair<ll, pll>
#define fi first
#define se second
#define ull unsigned long long
using namespace std;
const ll mod = 1e15+7;
const ll N = 3e5+5;
const ll M = 1e6+5;
vector<ll> adj[N], sub[N];
vector<ll> kq;
ll n, m, t, k, b[N],  lab[N], u, v, h[N], a[N], ans, tong, d[N];
string s[N];
pll p[N];
void sol()
{
    cin >> n >> m;
    for(int i = 1; i <= n; i ++)cin >> p[i].se >> p[i].fi;
    for(int j = 1; j <= m; j ++)cin >> b[j];
    sort(p+1, p+1+n);
    sort(b+1, b+1+m);
    int j = n;
    for(int i = m; i > 0; i --)
    {
        while(b[i] < p[j].se && j > 0)--j;
        if(j == 0)break;
        --j;
        ++ans;
    }
    cout << ans;
}
int main()
{
    if(fopen(task".in", "r")){
       freopen(task".in", "r", stdin);
       freopen(task".out", "w", stdout);
    }
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int ntest = 1;
    //cin >> ntest;
    while(ntest -- > 0)
    sol();
}
// 8 5 3420
// 100000 666 505047023

Compilation message

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:39:15: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   39 |        freopen(task".in", "r", stdin);
      |        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:40:15: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   40 |        freopen(task".out", "w", stdout);
      |        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 15 ms 23788 KB Output is correct
2 Correct 15 ms 23788 KB Output is correct
3 Correct 17 ms 23788 KB Output is correct
4 Correct 15 ms 23788 KB Output is correct
5 Correct 17 ms 23788 KB Output is correct
6 Correct 14 ms 23788 KB Output is correct
7 Correct 15 ms 23916 KB Output is correct
8 Correct 15 ms 23788 KB Output is correct
9 Correct 15 ms 23788 KB Output is correct
10 Correct 14 ms 23788 KB Output is correct
11 Correct 15 ms 23788 KB Output is correct
12 Correct 15 ms 23788 KB Output is correct
13 Correct 15 ms 23788 KB Output is correct
14 Correct 15 ms 23788 KB Output is correct
15 Correct 15 ms 23788 KB Output is correct
16 Correct 15 ms 23788 KB Output is correct
17 Correct 15 ms 23916 KB Output is correct
18 Correct 15 ms 23788 KB Output is correct
19 Correct 17 ms 23788 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 15 ms 23788 KB Output is correct
2 Correct 15 ms 23788 KB Output is correct
3 Correct 17 ms 23788 KB Output is correct
4 Correct 15 ms 23788 KB Output is correct
5 Correct 17 ms 23788 KB Output is correct
6 Correct 14 ms 23788 KB Output is correct
7 Correct 15 ms 23916 KB Output is correct
8 Correct 15 ms 23788 KB Output is correct
9 Correct 15 ms 23788 KB Output is correct
10 Correct 14 ms 23788 KB Output is correct
11 Correct 15 ms 23788 KB Output is correct
12 Correct 15 ms 23788 KB Output is correct
13 Correct 15 ms 23788 KB Output is correct
14 Correct 15 ms 23788 KB Output is correct
15 Correct 15 ms 23788 KB Output is correct
16 Correct 15 ms 23788 KB Output is correct
17 Correct 15 ms 23916 KB Output is correct
18 Correct 15 ms 23788 KB Output is correct
19 Correct 17 ms 23788 KB Output is correct
20 Correct 18 ms 23916 KB Output is correct
21 Correct 16 ms 23916 KB Output is correct
22 Correct 15 ms 24044 KB Output is correct
23 Correct 15 ms 23916 KB Output is correct
24 Correct 16 ms 23916 KB Output is correct
25 Correct 16 ms 23916 KB Output is correct
26 Correct 18 ms 23916 KB Output is correct
27 Correct 16 ms 23916 KB Output is correct
28 Correct 15 ms 23916 KB Output is correct
29 Correct 16 ms 23916 KB Output is correct
30 Correct 19 ms 23916 KB Output is correct
31 Correct 17 ms 23916 KB Output is correct
32 Correct 15 ms 23916 KB Output is correct
33 Correct 15 ms 23916 KB Output is correct
34 Correct 14 ms 23916 KB Output is correct
35 Correct 14 ms 23916 KB Output is correct
36 Correct 16 ms 23924 KB Output is correct
37 Correct 15 ms 23916 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 15 ms 23788 KB Output is correct
2 Correct 15 ms 23788 KB Output is correct
3 Correct 17 ms 23788 KB Output is correct
4 Correct 15 ms 23788 KB Output is correct
5 Correct 17 ms 23788 KB Output is correct
6 Correct 14 ms 23788 KB Output is correct
7 Correct 15 ms 23916 KB Output is correct
8 Correct 15 ms 23788 KB Output is correct
9 Correct 15 ms 23788 KB Output is correct
10 Correct 14 ms 23788 KB Output is correct
11 Correct 15 ms 23788 KB Output is correct
12 Correct 15 ms 23788 KB Output is correct
13 Correct 15 ms 23788 KB Output is correct
14 Correct 15 ms 23788 KB Output is correct
15 Correct 15 ms 23788 KB Output is correct
16 Correct 15 ms 23788 KB Output is correct
17 Correct 15 ms 23916 KB Output is correct
18 Correct 15 ms 23788 KB Output is correct
19 Correct 17 ms 23788 KB Output is correct
20 Correct 18 ms 23916 KB Output is correct
21 Correct 16 ms 23916 KB Output is correct
22 Correct 15 ms 24044 KB Output is correct
23 Correct 15 ms 23916 KB Output is correct
24 Correct 16 ms 23916 KB Output is correct
25 Correct 16 ms 23916 KB Output is correct
26 Correct 18 ms 23916 KB Output is correct
27 Correct 16 ms 23916 KB Output is correct
28 Correct 15 ms 23916 KB Output is correct
29 Correct 16 ms 23916 KB Output is correct
30 Correct 19 ms 23916 KB Output is correct
31 Correct 17 ms 23916 KB Output is correct
32 Correct 15 ms 23916 KB Output is correct
33 Correct 15 ms 23916 KB Output is correct
34 Correct 14 ms 23916 KB Output is correct
35 Correct 14 ms 23916 KB Output is correct
36 Correct 16 ms 23924 KB Output is correct
37 Correct 15 ms 23916 KB Output is correct
38 Correct 66 ms 29036 KB Output is correct
39 Correct 67 ms 29036 KB Output is correct
40 Correct 69 ms 29164 KB Output is correct
41 Correct 66 ms 29036 KB Output is correct
42 Correct 67 ms 29164 KB Output is correct
43 Correct 66 ms 29036 KB Output is correct
44 Correct 67 ms 29096 KB Output is correct
45 Correct 67 ms 29236 KB Output is correct
46 Correct 74 ms 29036 KB Output is correct
47 Correct 62 ms 28608 KB Output is correct
48 Correct 60 ms 28524 KB Output is correct
49 Correct 58 ms 28012 KB Output is correct
50 Correct 58 ms 28012 KB Output is correct
51 Correct 66 ms 29164 KB Output is correct
52 Correct 66 ms 29164 KB Output is correct
53 Correct 66 ms 29036 KB Output is correct
54 Correct 61 ms 29164 KB Output is correct
55 Correct 68 ms 29164 KB Output is correct
56 Correct 56 ms 27372 KB Output is correct
57 Correct 34 ms 25580 KB Output is correct
58 Correct 46 ms 27372 KB Output is correct
59 Correct 48 ms 27372 KB Output is correct
60 Correct 39 ms 25580 KB Output is correct
61 Correct 45 ms 26860 KB Output is correct
62 Correct 66 ms 29164 KB Output is correct
63 Correct 67 ms 29164 KB Output is correct
64 Correct 66 ms 29164 KB Output is correct
65 Correct 80 ms 29116 KB Output is correct
66 Correct 66 ms 29048 KB Output is correct
67 Correct 65 ms 29036 KB Output is correct
68 Correct 68 ms 29036 KB Output is correct
69 Correct 68 ms 29036 KB Output is correct
70 Correct 68 ms 29152 KB Output is correct
71 Correct 66 ms 29036 KB Output is correct
72 Correct 68 ms 29164 KB Output is correct
73 Correct 65 ms 29164 KB Output is correct