Submission #816282


Source Code Expand

Copy
import itertools,math,bisect,pprint,sys

n, k = map(int, raw_input().split())
d = map(int, raw_input().split())
def use_d(n):
    for i in list(str(n)):
        if int(i) in d:
            return True
    else:
        return False
while n < 100000:
    if use_d(n):
        n += 1
    else:
        print n
        sys.exit()

Submission Info

Submission Time
Task C - Iroha's Obsession
User kaixiang
Language Python (2.7.6)
Score 300
Code Size 343 Byte
Status AC
Exec Time 1305 ms
Memory 3836 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status AC
AC × 10
Set Name Test Cases
Sample
All subtask0_sample_01.txt, subtask0_sample_02.txt, subtask1_X_01.txt, subtask1_X_02.txt, subtask1_X_03.txt, subtask1_X_04.txt, subtask1_X_05.txt, subtask1_X_06.txt, subtask1_X_07.txt, subtask1_X_08.txt
Case Name Status Exec Time Memory
subtask0_sample_01.txt AC 1305 ms 3836 KB
subtask0_sample_02.txt AC 26 ms 2692 KB
subtask1_X_01.txt AC 45 ms 2692 KB
subtask1_X_02.txt AC 207 ms 2692 KB
subtask1_X_03.txt AC 37 ms 2692 KB
subtask1_X_04.txt AC 26 ms 2692 KB
subtask1_X_05.txt AC 26 ms 2692 KB
subtask1_X_06.txt AC 46 ms 2692 KB
subtask1_X_07.txt AC 26 ms 2692 KB
subtask1_X_08.txt AC 26 ms 2692 KB