Submission details
Task:Leimasin
Sender:jubidubi
Submission time:2025-09-28 16:33:05 +0300
Language:C++ (C++11)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.00 s1, 2, 3details
#20.00 s1, 2, 3details
#30.01 s1, 2, 3details
#40.01 s1, 2, 3details
#50.04 s2, 3details
#60.05 s2, 3details
#70.19 s2, 3details
#80.19 s2, 3details
#9--3details
#10--3details
#11--3details
#12--3details
#13--3details
#14--3details

Code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int n, m, k;
  cin >> n >> m >> k;

  string stamp;
  cin >> stamp;

  vector<int> v(k);
  for (int i = 0; i < k; ++i) cin >> v[i];
  reverse(v.begin(), v.end());

  vector<char> c(n);
  for (int i = 0; i < n; ++i) c[i] = '.';

  set<int> s;
  for (int i = 1; i <= n; ++i) s.insert(i);

  for (int x : v) {
    vector<int> r;
    auto it = s.lower_bound(x);
    while (it != s.end() && *it - x < m) {
      r.push_back(*it);
      ++it;
    }

    for (int rx : r) {
      cout << rx << endl;
      s.erase(rx);
      c[rx - 1] = stamp[rx - x];
    }
  }

  for (char cc : c) cout << cc;
  cout << endl;
}

Test details

Test 1

Group: 1, 2, 3

Verdict:

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

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

user output
586
443
342
626
960
...

Test 2

Group: 1, 2, 3

Verdict:

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

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

user output
227
228
229
230
164
...

Test 3

Group: 1, 2, 3

Verdict:

input
1000 100 100
wkmtgzytnfwptwukbartgunjyrkyml...

correct output
wkmtgzywkmtgzytnfwptwukbartgun...

user output
872
873
874
875
876
...

Test 4

Group: 1, 2, 3

Verdict:

input
1000 1000 100
njplbyvkaytbcyzbylzntnmpfapvfg...

correct output
njplbyvkaytbcyzbylzntnmpfapvfg...

user output
1
2
3
4
5
...

Test 5

Group: 2, 3

Verdict:

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

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

user output
25515
9294
28579
23134
70790
...

Test 6

Group: 2, 3

Verdict:

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

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

user output
56002
56003
56004
56005
56006
...

Test 7

Group: 2, 3

Verdict:

input
100000 10000 1000
wcyeepjmmvavmoncfxclqrsebjzwbf...

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

user output
49521
49522
49523
49524
49525
...

Test 8

Group: 2, 3

Verdict:

input
100000 100000 1000
chdcxwwznawllrxcxlckeziomcsjhc...

correct output
chdcxwwznawllrxcxlckeziomcsjhc...

user output
1
2
3
4
5
...

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:

input
1000000 1000000 500000
hhgvveiosloznsihxtccfjbizayyhl...

correct output
hhgvveiosloznsihxtccfjbizayyhl...

user output
(empty)