結果

問題 No.1020 Reverse
ユーザー w0mbatw0mbat
提出日時 2020-04-24 20:09:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 82,256 KB
実行使用メモリ 81,280 KB
最終ジャッジ日時 2024-04-23 02:42:08
合計ジャッジ時間 2,393 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,712 KB
testcase_01 AC 40 ms
51,968 KB
testcase_02 AC 40 ms
51,584 KB
testcase_03 AC 40 ms
52,224 KB
testcase_04 AC 41 ms
51,584 KB
testcase_05 AC 41 ms
52,352 KB
testcase_06 AC 41 ms
52,096 KB
testcase_07 AC 59 ms
72,320 KB
testcase_08 AC 61 ms
76,032 KB
testcase_09 AC 61 ms
74,112 KB
testcase_10 AC 68 ms
80,768 KB
testcase_11 AC 64 ms
81,024 KB
testcase_12 AC 68 ms
80,768 KB
testcase_13 AC 67 ms
81,280 KB
testcase_14 AC 65 ms
80,768 KB
testcase_15 AC 63 ms
78,336 KB
testcase_16 AC 63 ms
79,744 KB
testcase_17 AC 64 ms
79,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int, input().split())
S=input()
ans=[]
t=0
for i in range(N-K+1):
    ans.append(S[i+K-1])
    t+=1
for i in range(K-1):
    j = K-2-i if t&1 else i
    ans.append(S[j])
print(''.join(ans)) 
0