Submission #59862056


Source Code Expand

Copy
s = input()
q = int(input())
k = map(int, input().split())
length = len(s)
for i in k:
idx = i - 1
group, pos = divmod(idx, length)
popcount = group.bit_count()
res = s[pos]
if popcount % 2 == 1:
res = res.swapcase()
print(res, end=" ")
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
s = input()
q = int(input())
k = map(int, input().split())

length = len(s)

for i in k:
    idx = i - 1
    group, pos = divmod(idx, length)
    popcount = group.bit_count()
    
    res = s[pos]

    if popcount % 2 == 1:
        res = res.swapcase()
        
    print(res, end=" ")

Submission Info

Submission Time
Task D - Strange Mirroring
User SUPERFIRE777
Language Python (PyPy 3.10-v7.3.12)
Score 350
Code Size 301 Byte
Status AC
Exec Time 249 ms
Memory 111300 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 350 / 350
Status
AC × 3
AC × 63
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_40.txt, test_41.txt, test_42.txt, test_43.txt, test_44.txt, test_45.txt, test_46.txt, test_47.txt, test_48.txt, test_49.txt, test_50.txt, test_51.txt, test_52.txt, test_53.txt, test_54.txt, test_55.txt, test_56.txt, test_57.txt, test_58.txt, test_59.txt, test_60.txt
Case Name Status Exec Time Memory
sample_01.txt AC 57 ms 76308 KB
sample_02.txt AC 58 ms 76648 KB
sample_03.txt AC 59 ms 76428 KB
test_01.txt AC 77 ms 83220 KB
test_02.txt AC 92 ms 94916 KB
test_03.txt AC 68 ms 82084 KB
test_04.txt AC 79 ms 90048 KB
test_05.txt AC 77 ms 90156 KB
test_06.txt AC 114 ms 109680 KB
test_07.txt AC 111 ms 108576 KB
test_08.txt AC 116 ms 109612 KB
test_09.txt AC 69 ms 82716 KB
test_10.txt AC 83 ms 88280 KB
test_11.txt AC 62 ms 76908 KB
test_12.txt AC 239 ms 111300 KB
test_13.txt AC 77 ms 84060 KB
test_14.txt AC 121 ms 109072 KB
test_15.txt AC 99 ms 98920 KB
test_16.txt AC 109 ms 106000 KB
test_17.txt AC 122 ms 110300 KB
test_18.txt AC 226 ms 110448 KB
test_19.txt AC 203 ms 106588 KB
test_20.txt AC 91 ms 91140 KB
test_21.txt AC 91 ms 92744 KB
test_22.txt AC 120 ms 108800 KB
test_23.txt AC 103 ms 96720 KB
test_24.txt AC 115 ms 110396 KB
test_25.txt AC 119 ms 109192 KB
test_26.txt AC 119 ms 110288 KB
test_27.txt AC 74 ms 82020 KB
test_28.txt AC 111 ms 105508 KB
test_29.txt AC 88 ms 92232 KB
test_30.txt AC 107 ms 86932 KB
test_31.txt AC 113 ms 106268 KB
test_32.txt AC 113 ms 106260 KB
test_33.txt AC 104 ms 106628 KB
test_34.txt AC 111 ms 106516 KB
test_35.txt AC 98 ms 106620 KB
test_36.txt AC 249 ms 110972 KB
test_37.txt AC 126 ms 110704 KB
test_38.txt AC 127 ms 110808 KB
test_39.txt AC 126 ms 110812 KB
test_40.txt AC 126 ms 111048 KB
test_41.txt AC 119 ms 110960 KB
test_42.txt AC 122 ms 110104 KB
test_43.txt AC 127 ms 110236 KB
test_44.txt AC 127 ms 110512 KB
test_45.txt AC 128 ms 110472 KB
test_46.txt AC 126 ms 110212 KB
test_47.txt AC 130 ms 110616 KB
test_48.txt AC 120 ms 110700 KB
test_49.txt AC 127 ms 111212 KB
test_50.txt AC 127 ms 110688 KB
test_51.txt AC 126 ms 110836 KB
test_52.txt AC 126 ms 111124 KB
test_53.txt AC 126 ms 110804 KB
test_54.txt AC 119 ms 110932 KB
test_55.txt AC 126 ms 110676 KB
test_56.txt AC 126 ms 111048 KB
test_57.txt AC 125 ms 110880 KB
test_58.txt AC 125 ms 110800 KB
test_59.txt AC 126 ms 110900 KB
test_60.txt AC 234 ms 106676 KB


2025-04-06 (Sun)
00:47:14 +00:00