답안 #556611

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
556611 2022-05-03T11:59:48 Z hibiki Exhibition (JOI19_ho_t2) C++11
100 / 100
65 ms 4892 KB
#include<bits/stdc++.h>
using namespace std;

#define PB push_back
#define F first
#define S second

int n,m;
vector<int> frame;
vector<pair<int,int> > pic;

int main()
{
    scanf("%d %d",&n,&m);
    for(int i=0;i<n;i++)
    {
        int a,b;
        scanf("%d %d",&a,&b);
        pic.PB({b,a});
    }
    for(int i=0;i<m;i++)
    {
        int a;
        scanf("%d",&a);
        frame.PB(a);
    }

    sort(pic.begin(),pic.end());
    sort(frame.begin(),frame.end());

    int use=0,frame_i=m-1;
    for(int i=n-1;i>=0;i--)
    {
        if(frame_i<0)break;
        if(pic[i].S<=frame[frame_i])
        {
            use++;
            frame_i--;
        }
    }
    printf("%d\n",use);
}

Compilation message

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:14:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     scanf("%d %d",&n,&m);
      |     ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:18:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |         scanf("%d %d",&a,&b);
      |         ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:24:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |         scanf("%d",&a);
      |         ~~~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 304 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 300 KB Output is correct
18 Correct 1 ms 300 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 304 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 300 KB Output is correct
18 Correct 1 ms 300 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 2 ms 288 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 1 ms 308 KB Output is correct
35 Correct 1 ms 212 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 304 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 300 KB Output is correct
18 Correct 1 ms 300 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 2 ms 288 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 1 ms 308 KB Output is correct
35 Correct 1 ms 212 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 52 ms 4892 KB Output is correct
39 Correct 52 ms 4876 KB Output is correct
40 Correct 44 ms 4836 KB Output is correct
41 Correct 52 ms 4800 KB Output is correct
42 Correct 51 ms 4800 KB Output is correct
43 Correct 52 ms 4776 KB Output is correct
44 Correct 53 ms 4812 KB Output is correct
45 Correct 51 ms 4768 KB Output is correct
46 Correct 52 ms 4792 KB Output is correct
47 Correct 47 ms 4448 KB Output is correct
48 Correct 48 ms 4448 KB Output is correct
49 Correct 43 ms 4028 KB Output is correct
50 Correct 43 ms 3956 KB Output is correct
51 Correct 52 ms 4856 KB Output is correct
52 Correct 53 ms 4852 KB Output is correct
53 Correct 51 ms 4772 KB Output is correct
54 Correct 48 ms 4816 KB Output is correct
55 Correct 51 ms 4804 KB Output is correct
56 Correct 34 ms 3132 KB Output is correct
57 Correct 21 ms 1744 KB Output is correct
58 Correct 34 ms 3016 KB Output is correct
59 Correct 38 ms 3064 KB Output is correct
60 Correct 20 ms 1744 KB Output is correct
61 Correct 32 ms 2856 KB Output is correct
62 Correct 51 ms 4800 KB Output is correct
63 Correct 54 ms 4852 KB Output is correct
64 Correct 51 ms 4840 KB Output is correct
65 Correct 52 ms 4888 KB Output is correct
66 Correct 53 ms 4800 KB Output is correct
67 Correct 53 ms 4884 KB Output is correct
68 Correct 65 ms 4888 KB Output is correct
69 Correct 52 ms 4836 KB Output is correct
70 Correct 53 ms 4776 KB Output is correct
71 Correct 52 ms 4840 KB Output is correct
72 Correct 56 ms 4880 KB Output is correct
73 Correct 48 ms 4852 KB Output is correct