Submission details
Task:Leimasin
Sender:tkok
Submission time:2025-09-27 15:05:38 +0300
Language:Python3 (CPython3)
Status:READY
Result:33
Feedback
groupverdictscore
#1ACCEPTED33
#20
#30
Test results
testverdicttimegroup
#1ACCEPTED0.03 s1, 2, 3details
#2ACCEPTED0.03 s1, 2, 3details
#3ACCEPTED0.02 s1, 2, 3details
#4ACCEPTED0.02 s1, 2, 3details
#5--2, 3details
#6--2, 3details
#7ACCEPTED0.25 s2, 3details
#8ACCEPTED0.09 s2, 3details
#9--3details
#10--3details
#11--3details
#12--3details
#13--3details
#14ACCEPTED0.73 s3details

Code

n, m, k = [int(x) for x in input().split()]

tulos = ["." for x in range(n)]
leima = input()
leima_pituus = len(leima)
positions = [int(x) - 1 for x in input().split()]

# per kirjain, tsekkaa lopusta alkuun leimat ja ensimmäinen joka osuu tähän, ota siitä oikea leima
for i in range(n - 1, -1, -1):
    for pos in reversed(positions):
        if pos <= i and pos + leima_pituus > i:
            # osuu
            tulos[i] = leima[i - pos]
            break

print("".join(tulos))

Test details

Test 1

Group: 1, 2, 3

Verdict: ACCEPTED

input
1000 1 100
a
585 600 750 170 794 845 341 39...

correct output
............a....aa..............

user output
............a....aa..............

Test 2

Group: 1, 2, 3

Verdict: ACCEPTED

input
1000 4 100
zhrb
795 569 744 662 315 869 913 21...

correct output
.........................zhrb....

user output
.........................zhrb....

Test 3

Group: 1, 2, 3

Verdict: ACCEPTED

input
1000 100 100
wkmtgzytnfwptwukbartgunjyrkyml...

correct output
wkmtgzywkmtgzytnfwptwukbartgun...

user output
wkmtgzywkmtgzytnfwptwukbartgun...

Test 4

Group: 1, 2, 3

Verdict: ACCEPTED

input
1000 1000 100
njplbyvkaytbcyzbylzntnmpfapvfg...

correct output
njplbyvkaytbcyzbylzntnmpfapvfg...

user output
njplbyvkaytbcyzbylzntnmpfapvfg...

Test 5

Group: 2, 3

Verdict:

input
100000 1 1000
a
61541 4948 46214 29629 8779 76...

correct output
.................................

user output
(empty)

Test 6

Group: 2, 3

Verdict:

input
100000 10 1000
ntsconpqnv
17118 69319 2115 8873 892 9994...

correct output
.....................ntsconpqn...

user output
(empty)

Test 7

Group: 2, 3

Verdict: ACCEPTED

input
100000 10000 1000
wcyeepjmmvavmoncfxclqrsebjzwbf...

correct output
.................................

user output
.................................

Test 8

Group: 2, 3

Verdict: ACCEPTED

input
100000 100000 1000
chdcxwwznawllrxcxlckeziomcsjhc...

correct output
chdcxwwznawllrxcxlckeziomcsjhc...

user output
chdcxwwznawllrxcxlckeziomcsjhc...

Test 9

Group: 3

Verdict:

input
1000000 1 500000
a
406018 635983 429225 943593 90...

correct output
.a...aa.....a.aaaa.a.aaa..aa.a...

user output
(empty)

Test 10

Group: 3

Verdict:

input
1000000 10 500000
frvhrhlrxi
85148 459715 677814 98302 4081...

correct output
frvhfrvhrhlrxihrhlrxifrvhrfrvf...

user output
(empty)

Test 11

Group: 3

Verdict:

input
1000000 1000 500000
hklmkntjqgilackgurwlerwvvfjwwr...

correct output
.hklhklmkntjqgilackgurwlerwvvf...

user output
(empty)

Test 12

Group: 3

Verdict:

input
1000000 10000 500000
yxajftmelgwiofcugtrvcltdemhyuu...

correct output
yxajftyxayxajftmelgwiofcugtrvc...

user output
(empty)

Test 13

Group: 3

Verdict:

input
1000000 100000 500000
yyzteckvutdnprlklyxgenyqpznght...

correct output
.yyyyzteckvutdnpryyzteckvutdnp...

user output
(empty)

Test 14

Group: 3

Verdict: ACCEPTED

input
1000000 1000000 500000
hhgvveiosloznsihxtccfjbizayyhl...

correct output
hhgvveiosloznsihxtccfjbizayyhl...

user output
hhgvveiosloznsihxtccfjbizayyhl...