CSES - Practice Contest 2024 - Results
Submission details
Task:Interesting number
Sender:\(._.)/
Submission time:2024-09-28 16:57:41 +0300
Language:Python3 (PyPy3)
Status:READY
Result:ACCEPTED
Test results
testverdicttime
#1ACCEPTED0.09 sdetails
#2ACCEPTED0.07 sdetails

Code

t = int(input())
nums = [2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929]
for i in range(t):
    n = int(input())
    xs = list(map(int, input().split()))
    for j in range(n):
        if xs[j] in nums:
            print(xs[j])


Test details

Test 1

Verdict: ACCEPTED

input
1000
9
300 988 956 931 116 3 386 202 ...

correct output
3
3
181
919
191
...

user output
3
3
181
919
191
...
Truncated

Test 2

Verdict: ACCEPTED

input
1
100000
72 247 605 249 10 422 594 490 ...

correct output
191

user output
191