답안 #340504

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
340504 2020-12-27T19:21:55 Z Kerim Exhibition (JOI19_ho_t2) C++17
100 / 100
74 ms 4588 KB
#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x)  cerr<< #x <<" = "<< x<<endl;
using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
PII a[MAXN];int b[MAXN];
int main(){
    //freopen("sample-1.in", "r", stdin);
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
    	scanf("%d%d",&a[i].ss,&a[i].ff);
    for(int i=0;i<m;i++)
    	scanf("%d",b+i);
	sort(a,a+n);sort(b,b+m);
	int p=m-1;
	for(int i=n-1;i>=0;i--)	
		if(p>=0 and a[i].ss<=b[p])
			p--;
	printf("%d\n",m-p-1);
	return 0;
}

Compilation message

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:27:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   27 |     for(int i=0;i<m;i++)
      |     ^~~
joi2019_ho_t2.cpp:29:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   29 |  sort(a,a+n);sort(b,b+m);
      |  ^~~~
joi2019_ho_t2.cpp:24:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   24 |     scanf("%d%d",&n,&m);
      |     ~~~~~^~~~~~~~~~~~~~
joi2019_ho_t2.cpp:26:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   26 |      scanf("%d%d",&a[i].ss,&a[i].ff);
      |      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:28:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   28 |      scanf("%d",b+i);
      |      ~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 1 ms 512 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 1 ms 492 KB Output is correct
14 Correct 1 ms 364 KB Output is correct
15 Correct 1 ms 364 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 1 ms 364 KB Output is correct
18 Correct 1 ms 364 KB Output is correct
19 Correct 1 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 1 ms 512 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 1 ms 492 KB Output is correct
14 Correct 1 ms 364 KB Output is correct
15 Correct 1 ms 364 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 1 ms 364 KB Output is correct
18 Correct 1 ms 364 KB Output is correct
19 Correct 1 ms 364 KB Output is correct
20 Correct 1 ms 364 KB Output is correct
21 Correct 1 ms 364 KB Output is correct
22 Correct 1 ms 492 KB Output is correct
23 Correct 1 ms 364 KB Output is correct
24 Correct 1 ms 364 KB Output is correct
25 Correct 1 ms 364 KB Output is correct
26 Correct 1 ms 364 KB Output is correct
27 Correct 1 ms 364 KB Output is correct
28 Correct 1 ms 364 KB Output is correct
29 Correct 1 ms 384 KB Output is correct
30 Correct 1 ms 364 KB Output is correct
31 Correct 1 ms 364 KB Output is correct
32 Correct 1 ms 364 KB Output is correct
33 Correct 1 ms 364 KB Output is correct
34 Correct 1 ms 364 KB Output is correct
35 Correct 1 ms 364 KB Output is correct
36 Correct 1 ms 364 KB Output is correct
37 Correct 1 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 1 ms 512 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 1 ms 492 KB Output is correct
14 Correct 1 ms 364 KB Output is correct
15 Correct 1 ms 364 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 1 ms 364 KB Output is correct
18 Correct 1 ms 364 KB Output is correct
19 Correct 1 ms 364 KB Output is correct
20 Correct 1 ms 364 KB Output is correct
21 Correct 1 ms 364 KB Output is correct
22 Correct 1 ms 492 KB Output is correct
23 Correct 1 ms 364 KB Output is correct
24 Correct 1 ms 364 KB Output is correct
25 Correct 1 ms 364 KB Output is correct
26 Correct 1 ms 364 KB Output is correct
27 Correct 1 ms 364 KB Output is correct
28 Correct 1 ms 364 KB Output is correct
29 Correct 1 ms 384 KB Output is correct
30 Correct 1 ms 364 KB Output is correct
31 Correct 1 ms 364 KB Output is correct
32 Correct 1 ms 364 KB Output is correct
33 Correct 1 ms 364 KB Output is correct
34 Correct 1 ms 364 KB Output is correct
35 Correct 1 ms 364 KB Output is correct
36 Correct 1 ms 364 KB Output is correct
37 Correct 1 ms 364 KB Output is correct
38 Correct 60 ms 4460 KB Output is correct
39 Correct 57 ms 4332 KB Output is correct
40 Correct 54 ms 4460 KB Output is correct
41 Correct 61 ms 4460 KB Output is correct
42 Correct 60 ms 4460 KB Output is correct
43 Correct 60 ms 4460 KB Output is correct
44 Correct 60 ms 4460 KB Output is correct
45 Correct 60 ms 4332 KB Output is correct
46 Correct 59 ms 4332 KB Output is correct
47 Correct 54 ms 3948 KB Output is correct
48 Correct 52 ms 3948 KB Output is correct
49 Correct 50 ms 3564 KB Output is correct
50 Correct 48 ms 3564 KB Output is correct
51 Correct 60 ms 4400 KB Output is correct
52 Correct 62 ms 4588 KB Output is correct
53 Correct 60 ms 4332 KB Output is correct
54 Correct 53 ms 4460 KB Output is correct
55 Correct 70 ms 4460 KB Output is correct
56 Correct 41 ms 3052 KB Output is correct
57 Correct 24 ms 1644 KB Output is correct
58 Correct 39 ms 3052 KB Output is correct
59 Correct 37 ms 3052 KB Output is correct
60 Correct 24 ms 1644 KB Output is correct
61 Correct 38 ms 2668 KB Output is correct
62 Correct 61 ms 4460 KB Output is correct
63 Correct 61 ms 4460 KB Output is correct
64 Correct 61 ms 4460 KB Output is correct
65 Correct 61 ms 4460 KB Output is correct
66 Correct 60 ms 4460 KB Output is correct
67 Correct 60 ms 4460 KB Output is correct
68 Correct 74 ms 4588 KB Output is correct
69 Correct 62 ms 4460 KB Output is correct
70 Correct 62 ms 4476 KB Output is correct
71 Correct 60 ms 4460 KB Output is correct
72 Correct 73 ms 4460 KB Output is correct
73 Correct 58 ms 4460 KB Output is correct