답안 #670454

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
670454 2022-12-09T07:12:46 Z berr Exhibition (JOI19_ho_t2) C++17
0 / 100
1 ms 340 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long


signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, m; cin>>n>>m;


    vector<int> c(m);
    vector<array<int, 2>> a(n);


    for(int i = 0; i < n; i++){
        cin >> a[i][0] >> a[i][1];
    }

    for(int i = 0; i < m; i++){
        cin>>c[i];
    }


    sort(a.begin(), a.end());
    sort(c.begin(), c.end());


    int s=0;

    for(int i=20; i>=0; i--){
        int tmp= s + (1<<i);

        if(tmp<=m){
            vector<array<int, 2>> t(tmp);

            for(int l=0; l<tmp; l++){
                t[l]=a[l]; swap(t[l][0], t[l][1]);
            }

            sort(t.begin(), t.end());

            int flag=1;

            int l=0;
            for(int j=m-tmp; j<m; j++)
            {   
                
                if(t[l][1]>c[j]) flag=0; l++;
            }


            if(flag) s=tmp;
        }
    }


    cout<<s;
}

Compilation message

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:49:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   49 |                 if(t[l][1]>c[j]) flag=0; l++;
      |                 ^~
joi2019_ho_t2.cpp:49:42: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   49 |                 if(t[l][1]>c[j]) flag=0; l++;
      |                                          ^
# 결과 실행 시간 메모리 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 0 ms 212 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Incorrect 0 ms 212 KB Output isn't correct
14 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 0 ms 212 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Incorrect 0 ms 212 KB Output isn't correct
14 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 0 ms 212 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Incorrect 0 ms 212 KB Output isn't correct
14 Halted 0 ms 0 KB -