Submission #544983


Source Code Expand

#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>
#include <iostream>
using namespace std;

#define MAX 100001

int main()
{
    int n,m;
    int a,b;
    scanf("%d %d", &n , &m);

    if (m > n) {
        printf("NO\n");
        return 0;
    }
    priority_queue<int> A;
    priority_queue<int> B;

    for (int i =0; i<n; i++) {
        scanf("%d", &a);
        A.push(a);
    }
    for (int i =0; i<m; i++) {
        scanf("%d", &b);
        B.push(b);
    }
    while (!B.empty()) {
        if (A.top() < B.top()) {
            printf("NO\n");
            return 0;
        }
        A.pop(); B.pop();
    }
    printf("YES\n");
    return 0;
}

Submission Info

Submission Time
Task C - Hotel
User tatsuno127
Language C++ (GCC 4.9.2)
Score 100
Code Size 714 Byte
Status AC
Exec Time 101 ms
Memory 2020 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:14:28: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &n , &m);
                            ^
./Main.cpp:24:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &a);
                        ^
./Main.cpp:28:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &b);
                        ^

Judge Result

Set Name Sample Dataset1 Dataset2
Score / Max Score 0 / 0 60 / 60 40 / 40
Status
AC × 4
AC × 29
AC × 55
Set Name Test Cases
Sample 0-sample-1.txt, 0-sample-2.txt, 0-sample-3.txt, 0-sample-4.txt
Dataset1 0-sample-1.txt, 0-sample-2.txt, 0-sample-3.txt, 0-sample-4.txt, 1-max-0.txt, 1-max-1.txt, 1-max-2.txt, 1-max-3.txt, 1-max-4.txt, 1-random-00.txt, 1-random-01.txt, 1-random-02.txt, 1-random-03.txt, 1-random-04.txt, 1-random-05.txt, 1-random-06.txt, 1-random-07.txt, 1-random-08.txt, 1-random-09.txt, 1-random-10.txt, 1-random-11.txt, 1-random-12.txt, 1-random-13.txt, 1-random-14.txt, 1-random-15.txt, 1-random-16.txt, 1-random-17.txt, 1-random-18.txt, 1-random-19.txt
Dataset2 0-sample-1.txt, 0-sample-2.txt, 0-sample-3.txt, 0-sample-4.txt, 1-max-0.txt, 1-max-1.txt, 1-max-2.txt, 1-max-3.txt, 1-max-4.txt, 1-random-00.txt, 1-random-01.txt, 1-random-02.txt, 1-random-03.txt, 1-random-04.txt, 1-random-05.txt, 1-random-06.txt, 1-random-07.txt, 1-random-08.txt, 1-random-09.txt, 1-random-10.txt, 1-random-11.txt, 1-random-12.txt, 1-random-13.txt, 1-random-14.txt, 1-random-15.txt, 1-random-16.txt, 1-random-17.txt, 1-random-18.txt, 1-random-19.txt, 2-max-0.txt, 2-max-1.txt, 2-max-2.txt, 2-max-3.txt, 2-max-4.txt, 2-max-5.txt, 2-random-00.txt, 2-random-01.txt, 2-random-02.txt, 2-random-03.txt, 2-random-04.txt, 2-random-05.txt, 2-random-06.txt, 2-random-07.txt, 2-random-08.txt, 2-random-09.txt, 2-random-10.txt, 2-random-11.txt, 2-random-12.txt, 2-random-13.txt, 2-random-14.txt, 2-random-15.txt, 2-random-16.txt, 2-random-17.txt, 2-random-18.txt, 2-random-19.txt
Case Name Status Exec Time Memory
0-sample-1.txt AC 43 ms 920 KiB
0-sample-2.txt AC 28 ms 932 KiB
0-sample-3.txt AC 30 ms 924 KiB
0-sample-4.txt AC 29 ms 868 KiB
1-max-0.txt AC 25 ms 928 KiB
1-max-1.txt AC 27 ms 924 KiB
1-max-2.txt AC 27 ms 928 KiB
1-max-3.txt AC 25 ms 924 KiB
1-max-4.txt AC 27 ms 928 KiB
1-random-00.txt AC 27 ms 792 KiB
1-random-01.txt AC 26 ms 920 KiB
1-random-02.txt AC 27 ms 920 KiB
1-random-03.txt AC 27 ms 932 KiB
1-random-04.txt AC 27 ms 852 KiB
1-random-05.txt AC 26 ms 852 KiB
1-random-06.txt AC 26 ms 928 KiB
1-random-07.txt AC 26 ms 912 KiB
1-random-08.txt AC 27 ms 824 KiB
1-random-09.txt AC 26 ms 920 KiB
1-random-10.txt AC 26 ms 928 KiB
1-random-11.txt AC 26 ms 924 KiB
1-random-12.txt AC 27 ms 928 KiB
1-random-13.txt AC 27 ms 920 KiB
1-random-14.txt AC 25 ms 928 KiB
1-random-15.txt AC 26 ms 920 KiB
1-random-16.txt AC 28 ms 804 KiB
1-random-17.txt AC 26 ms 924 KiB
1-random-18.txt AC 27 ms 928 KiB
1-random-19.txt AC 25 ms 924 KiB
2-max-0.txt AC 67 ms 1968 KiB
2-max-1.txt AC 68 ms 1968 KiB
2-max-2.txt AC 68 ms 1960 KiB
2-max-3.txt AC 68 ms 1964 KiB
2-max-4.txt AC 100 ms 2020 KiB
2-max-5.txt AC 101 ms 1968 KiB
2-random-00.txt AC 27 ms 824 KiB
2-random-01.txt AC 28 ms 932 KiB
2-random-02.txt AC 76 ms 1708 KiB
2-random-03.txt AC 25 ms 868 KiB
2-random-04.txt AC 43 ms 1304 KiB
2-random-05.txt AC 45 ms 1248 KiB
2-random-06.txt AC 44 ms 1204 KiB
2-random-07.txt AC 26 ms 924 KiB
2-random-08.txt AC 25 ms 928 KiB
2-random-09.txt AC 49 ms 1456 KiB
2-random-10.txt AC 26 ms 820 KiB
2-random-11.txt AC 27 ms 868 KiB
2-random-12.txt AC 63 ms 1968 KiB
2-random-13.txt AC 26 ms 924 KiB
2-random-14.txt AC 34 ms 1080 KiB
2-random-15.txt AC 28 ms 928 KiB
2-random-16.txt AC 26 ms 792 KiB
2-random-17.txt AC 47 ms 1328 KiB
2-random-18.txt AC 27 ms 804 KiB
2-random-19.txt AC 38 ms 1208 KiB