結果

問題 No.1020 Reverse
ユーザー kotatsugamekotatsugame
提出日時 2020-04-10 21:26:54
言語 Ruby
(3.3.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 75 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 11,316 KB
実行使用メモリ 16,196 KB
最終ジャッジ日時 2023-10-13 23:11:26
合計ジャッジ時間 2,919 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,116 KB
testcase_01 AC 81 ms
15,136 KB
testcase_02 AC 86 ms
15,268 KB
testcase_03 AC 81 ms
15,188 KB
testcase_04 AC 81 ms
15,184 KB
testcase_05 AC 81 ms
15,232 KB
testcase_06 AC 82 ms
15,076 KB
testcase_07 AC 84 ms
15,608 KB
testcase_08 AC 88 ms
15,748 KB
testcase_09 AC 85 ms
15,716 KB
testcase_10 AC 88 ms
15,936 KB
testcase_11 AC 88 ms
15,944 KB
testcase_12 AC 85 ms
15,952 KB
testcase_13 AC 86 ms
15,968 KB
testcase_14 AC 85 ms
15,856 KB
testcase_15 AC 85 ms
16,196 KB
testcase_16 AC 86 ms
16,088 KB
testcase_17 AC 84 ms
15,488 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,k,s=`dd`.split
t=s[0,k=k.to_i-1]
puts s[k..]+(1>(n.to_i-k)%2?t:t.reverse)
0