結果

問題 No.292 芸名
ユーザー maimai8maimai8
提出日時 2020-09-21 15:33:46
言語 OCaml
(5.2.1)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 443 ms
コンパイル使用メモリ 21,700 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 02:04:44
合計ジャッジ時間 895 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

let () =
  Scanf.scanf "%s %d %d\n" @@ fun s t u ->
  let len = String.length s in
  let ans = 
    if t = u then String.sub s 0 t ^ String.sub s (t+1) (len-t-1)
    else if u < t
    then String.sub s 0 u ^ String.sub s (u+1) (t-u-1) ^ String.sub s (t+1) (len-t-1)
    else String.sub s 0 t ^ String.sub s (t+1) (u-t-1) ^ String.sub s (u+1) (len-u-1) 
  in Printf.printf "%s\n" ans
0