Submission #3406463


Source Code Expand

/*input
5
3 1 4 1 5
3
5 4 3
7
100 200 500 700 1200 1600 2000
6
100 200 500 700 1600 1600
*/
#include "bits/stdc++.h"
#define db(x) cout<<#x<<"="<<(x)<<" "
#define el cout<<endl
using namespace std;

const int MXN = 1e6 + 10;
long long t, n, m, a, b;
map<int, int> cnt;
int main() {
    cin >> n;
    for (long long i = 0; i < n; ++i)
    {
        int x;
        cin >> x;
        ++cnt[x];
    }
    int flag = 0;
    cin >> m;
    for (long long i = 0; i < m; ++i)
    {
        int x;
        cin >> x;
        if (!cnt[x]--)
        {
            flag = 1;
        }
    }
    if (flag) puts("NO");
    else puts("YES");
    return 0;
}

Submission Info

Submission Time
Task B - Problem Set
User Laurant
Language C++14 (GCC 5.4.1)
Score 200
Code Size 684 Byte
Status AC
Exec Time 344 ms
Memory 9600 KB

Judge Result

Set Name sample dataset1 dataset2
Score / Max Score 0 / 0 100 / 100 100 / 100
Status
AC × 4
AC × 13
AC × 27
Set Name Test Cases
sample sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt
dataset1 sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt
dataset2 sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt
Case Name Status Exec Time Memory
01-01.txt AC 1 ms 256 KB
01-02.txt AC 1 ms 256 KB
01-03.txt AC 1 ms 256 KB
01-04.txt AC 1 ms 256 KB
01-05.txt AC 1 ms 256 KB
01-06.txt AC 1 ms 256 KB
01-07.txt AC 1 ms 256 KB
01-08.txt AC 1 ms 256 KB
01-09.txt AC 1 ms 256 KB
02-01.txt AC 181 ms 9600 KB
02-02.txt AC 185 ms 9600 KB
02-03.txt AC 342 ms 9600 KB
02-04.txt AC 187 ms 9600 KB
02-05.txt AC 344 ms 9600 KB
02-06.txt AC 106 ms 256 KB
02-07.txt AC 210 ms 256 KB
02-08.txt AC 219 ms 256 KB
02-09.txt AC 213 ms 256 KB
02-10.txt AC 218 ms 256 KB
sample-01.txt AC 1 ms 256 KB
sample-02.txt AC 1 ms 256 KB
sample-03.txt AC 1 ms 256 KB
sample-04.txt AC 1 ms 256 KB