結果

問題 No.559 swapAB列
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-06-13 04:55:13
言語 Nim
(2.0.2)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 168 bytes
コンパイル時間 2,449 ms
コンパイル使用メモリ 67,564 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-13 03:49:14
合計ジャッジ時間 2,893 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

var
  S = stdin.readLine
  i, cnt = 0

while i < S.len:
  let j = i + 1
  if S[i .. j] == "BA":
    swap S[i], S[j]
    cnt += 1
    i = 0
  else:
    i += 1

echo cnt
0