Submission #1880893


Source Code Expand

def solve():
    N = int(input())
    D = list(map(int, input().split()))
    M = int(input())
    T = list(map(int, input().split()))
    prepared_map = {}
    necessary_map = {}
    for i in D:
        if not i in prepared_map.keys():
            prepared_map[i] = 1
        else:
            prepared_map[i] = prepared_map[i] + 1
        if not i in necessary_map.keys():
            necessary_map[i] = 0
    for i in T:
        if not i in necessary_map.keys():
            necessary_map[i] = 1
        else:
            necessary_map[i] = necessary_map[i] + 1
        if not i in prepared_map.keys():
            prepared_map[i] = 0
    if all(prepared_map[k] >= necessary_map[k] for k in necessary_map.keys()):
        print("YES")
    else:
        print("NO")

solve()

Submission Info

Submission Time
Task B - Problem Set
User a_key_bako
Language Python (3.4.3)
Score 200
Code Size 804 Byte
Status AC
Exec Time 344 ms
Memory 55776 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 17 ms 3064 KB
01-02.txt AC 17 ms 3064 KB
01-03.txt AC 17 ms 3064 KB
01-04.txt AC 17 ms 3064 KB
01-05.txt AC 18 ms 3064 KB
01-06.txt AC 17 ms 3064 KB
01-07.txt AC 17 ms 3064 KB
01-08.txt AC 17 ms 3064 KB
01-09.txt AC 17 ms 3064 KB
02-01.txt AC 173 ms 46136 KB
02-02.txt AC 206 ms 47696 KB
02-03.txt AC 344 ms 55776 KB
02-04.txt AC 170 ms 47968 KB
02-05.txt AC 309 ms 55776 KB
02-06.txt AC 131 ms 25356 KB
02-07.txt AC 236 ms 32848 KB
02-08.txt AC 238 ms 35408 KB
02-09.txt AC 241 ms 35284 KB
02-10.txt AC 257 ms 35452 KB
sample-01.txt AC 17 ms 3064 KB
sample-02.txt AC 17 ms 3064 KB
sample-03.txt AC 17 ms 3064 KB
sample-04.txt AC 17 ms 3064 KB