Submission #207925

# Submission time Handle Problem Language Result Execution time Memory
207925 2020-03-09T12:45:54 Z DodgeBallMan Exhibition (JOI19_ho_t2) C++14
100 / 100
94 ms 5012 KB
#include <bits/stdc++.h>
#define pii pair<int, int>
#define x first
#define y second

using namespace std;

int n, m, ans, now;
vector<int> fra;
vector<pii> pic;
int main()
{
    scanf("%d %d",&n,&m);
    for( int i = 0, a, b ; i < n ; i++ ) {
        scanf("%d %d",&a,&b);
        pic.emplace_back( pii( b, a ) );
    }
    for( int i = 0, a ; i < m ; i++ ) {
        scanf("%d",&a);
        fra.emplace_back( a );
    }
    sort( pic.begin(), pic.end(), greater<pii>() ), sort( fra.begin(), fra.end(), greater<int>() );
    for( int i = 0 ; i < m ; i++ ) {
        while( pic[now].y > fra[i] && now < n ) now++;
        if( now == n ) break;
        ans++, now++;
    }
    printf("%d",ans);
    return 0;
}

Compilation message

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:15: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:19:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&a);
         ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 248 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Correct 5 ms 256 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 5 ms 376 KB Output is correct
11 Correct 5 ms 256 KB Output is correct
12 Correct 5 ms 256 KB Output is correct
13 Correct 5 ms 256 KB Output is correct
14 Correct 5 ms 256 KB Output is correct
15 Correct 5 ms 256 KB Output is correct
16 Correct 5 ms 256 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
18 Correct 5 ms 256 KB Output is correct
19 Correct 6 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 248 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Correct 5 ms 256 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 5 ms 376 KB Output is correct
11 Correct 5 ms 256 KB Output is correct
12 Correct 5 ms 256 KB Output is correct
13 Correct 5 ms 256 KB Output is correct
14 Correct 5 ms 256 KB Output is correct
15 Correct 5 ms 256 KB Output is correct
16 Correct 5 ms 256 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
18 Correct 5 ms 256 KB Output is correct
19 Correct 6 ms 256 KB Output is correct
20 Correct 5 ms 376 KB Output is correct
21 Correct 6 ms 376 KB Output is correct
22 Correct 6 ms 376 KB Output is correct
23 Correct 5 ms 376 KB Output is correct
24 Correct 8 ms 376 KB Output is correct
25 Correct 5 ms 376 KB Output is correct
26 Correct 6 ms 416 KB Output is correct
27 Correct 6 ms 376 KB Output is correct
28 Correct 6 ms 376 KB Output is correct
29 Correct 6 ms 376 KB Output is correct
30 Correct 6 ms 376 KB Output is correct
31 Correct 5 ms 376 KB Output is correct
32 Correct 6 ms 376 KB Output is correct
33 Correct 6 ms 376 KB Output is correct
34 Correct 6 ms 376 KB Output is correct
35 Correct 5 ms 376 KB Output is correct
36 Correct 6 ms 504 KB Output is correct
37 Correct 7 ms 536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 248 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Correct 5 ms 256 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 5 ms 376 KB Output is correct
11 Correct 5 ms 256 KB Output is correct
12 Correct 5 ms 256 KB Output is correct
13 Correct 5 ms 256 KB Output is correct
14 Correct 5 ms 256 KB Output is correct
15 Correct 5 ms 256 KB Output is correct
16 Correct 5 ms 256 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
18 Correct 5 ms 256 KB Output is correct
19 Correct 6 ms 256 KB Output is correct
20 Correct 5 ms 376 KB Output is correct
21 Correct 6 ms 376 KB Output is correct
22 Correct 6 ms 376 KB Output is correct
23 Correct 5 ms 376 KB Output is correct
24 Correct 8 ms 376 KB Output is correct
25 Correct 5 ms 376 KB Output is correct
26 Correct 6 ms 416 KB Output is correct
27 Correct 6 ms 376 KB Output is correct
28 Correct 6 ms 376 KB Output is correct
29 Correct 6 ms 376 KB Output is correct
30 Correct 6 ms 376 KB Output is correct
31 Correct 5 ms 376 KB Output is correct
32 Correct 6 ms 376 KB Output is correct
33 Correct 6 ms 376 KB Output is correct
34 Correct 6 ms 376 KB Output is correct
35 Correct 5 ms 376 KB Output is correct
36 Correct 6 ms 504 KB Output is correct
37 Correct 7 ms 536 KB Output is correct
38 Correct 94 ms 4972 KB Output is correct
39 Correct 78 ms 4840 KB Output is correct
40 Correct 73 ms 4968 KB Output is correct
41 Correct 83 ms 4972 KB Output is correct
42 Correct 83 ms 4920 KB Output is correct
43 Correct 81 ms 4844 KB Output is correct
44 Correct 84 ms 4968 KB Output is correct
45 Correct 83 ms 4844 KB Output is correct
46 Correct 79 ms 4840 KB Output is correct
47 Correct 75 ms 4460 KB Output is correct
48 Correct 72 ms 4460 KB Output is correct
49 Correct 69 ms 4076 KB Output is correct
50 Correct 66 ms 4076 KB Output is correct
51 Correct 81 ms 4972 KB Output is correct
52 Correct 82 ms 4972 KB Output is correct
53 Correct 81 ms 4840 KB Output is correct
54 Correct 69 ms 4968 KB Output is correct
55 Correct 76 ms 4976 KB Output is correct
56 Correct 52 ms 3176 KB Output is correct
57 Correct 33 ms 1780 KB Output is correct
58 Correct 49 ms 3180 KB Output is correct
59 Correct 53 ms 3304 KB Output is correct
60 Correct 34 ms 1908 KB Output is correct
61 Correct 50 ms 2928 KB Output is correct
62 Correct 82 ms 4840 KB Output is correct
63 Correct 81 ms 4844 KB Output is correct
64 Correct 86 ms 4972 KB Output is correct
65 Correct 81 ms 4892 KB Output is correct
66 Correct 85 ms 4840 KB Output is correct
67 Correct 82 ms 4840 KB Output is correct
68 Correct 83 ms 4844 KB Output is correct
69 Correct 89 ms 5012 KB Output is correct
70 Correct 82 ms 4972 KB Output is correct
71 Correct 80 ms 4840 KB Output is correct
72 Correct 82 ms 4844 KB Output is correct
73 Correct 78 ms 4856 KB Output is correct