Submission #1498858
Source Code Expand
n,k=map(int,input().split()) s,p=list(input()),"" for i in range(k): cur,d,p,p2=0,1,str(s),p while cur>=0 and cur<n: if s[cur]=='A': s[cur]='B' d=-d cur+=d else: s[cur]='A' cur+=d if str(s)==p: print(''.join(s)) break elif str(s)==p2: if k%2==i%2: print(''.join(s)) else: print(''.join(filter(lambda x:x=='A' or x=='B',list(p)))) break else: print(''.join(s))
Submission Info
Submission Time | |
---|---|
Task | D - Half Reflector |
User | fts2001 |
Language | PyPy3 (2.4.0) |
Score | 0 |
Code Size | 421 Byte |
Status | TLE |
Exec Time | 2113 ms |
Memory | 134984 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 900 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | sample1.txt, sample2.txt, sample3.txt, in1.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.txt, in17.txt, in18.txt, in19.txt, in2.txt, in20.txt, in21.txt, in22.txt, in23.txt, in24.txt, in25.txt, in26.txt, in27.txt, in28.txt, in29.txt, in3.txt, in30.txt, in31.txt, in32.txt, in33.txt, in34.txt, in35.txt, in36.txt, in37.txt, in38.txt, in39.txt, in4.txt, in40.txt, in41.txt, in42.txt, in5.txt, in543.txt, in557.txt, in6.txt, in7.txt, in8.txt, in9.txt, sample1.txt, sample2.txt, sample3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in1.txt | AC | 215 ms | 41820 KB |
in10.txt | TLE | 2112 ms | 134404 KB |
in11.txt | TLE | 2111 ms | 130896 KB |
in12.txt | TLE | 2109 ms | 131456 KB |
in13.txt | TLE | 2112 ms | 134984 KB |
in14.txt | TLE | 2112 ms | 133212 KB |
in15.txt | TLE | 2111 ms | 132384 KB |
in16.txt | TLE | 2112 ms | 133380 KB |
in17.txt | TLE | 2111 ms | 131136 KB |
in18.txt | TLE | 2111 ms | 130132 KB |
in19.txt | TLE | 2112 ms | 133308 KB |
in2.txt | TLE | 2113 ms | 131348 KB |
in20.txt | TLE | 2110 ms | 130116 KB |
in21.txt | TLE | 2111 ms | 132576 KB |
in22.txt | TLE | 2111 ms | 134100 KB |
in23.txt | TLE | 2111 ms | 130516 KB |
in24.txt | TLE | 2110 ms | 131236 KB |
in25.txt | TLE | 2111 ms | 131724 KB |
in26.txt | TLE | 2111 ms | 131792 KB |
in27.txt | TLE | 2112 ms | 133716 KB |
in28.txt | TLE | 2111 ms | 134100 KB |
in29.txt | TLE | 2110 ms | 133716 KB |
in3.txt | TLE | 2111 ms | 133316 KB |
in30.txt | TLE | 2111 ms | 131156 KB |
in31.txt | TLE | 2111 ms | 132236 KB |
in32.txt | TLE | 2110 ms | 133420 KB |
in33.txt | TLE | 2111 ms | 130516 KB |
in34.txt | TLE | 2110 ms | 134484 KB |
in35.txt | TLE | 2111 ms | 134644 KB |
in36.txt | TLE | 2111 ms | 131416 KB |
in37.txt | TLE | 2110 ms | 134516 KB |
in38.txt | TLE | 2111 ms | 133716 KB |
in39.txt | TLE | 2111 ms | 132820 KB |
in4.txt | TLE | 2111 ms | 131256 KB |
in40.txt | TLE | 2110 ms | 131580 KB |
in41.txt | TLE | 2111 ms | 133716 KB |
in42.txt | TLE | 2112 ms | 132108 KB |
in5.txt | TLE | 2112 ms | 131536 KB |
in543.txt | TLE | 2110 ms | 133640 KB |
in557.txt | TLE | 2111 ms | 129492 KB |
in6.txt | AC | 162 ms | 38256 KB |
in7.txt | TLE | 2111 ms | 134448 KB |
in8.txt | TLE | 2112 ms | 130260 KB |
in9.txt | TLE | 2111 ms | 132364 KB |
sample1.txt | AC | 164 ms | 38256 KB |
sample2.txt | AC | 163 ms | 38256 KB |
sample3.txt | AC | 165 ms | 38256 KB |