結果

問題 No.559 swapAB列
ユーザー ducktailducktail
提出日時 2017-12-20 16:07:32
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 5,364 KB
実行使用メモリ 11,864 KB
最終ジャッジ日時 2023-08-22 10:54:06
合計ジャッジ時間 1,417 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,748 KB
testcase_01 AC 17 ms
11,832 KB
testcase_02 AC 18 ms
11,832 KB
testcase_03 AC 17 ms
11,668 KB
testcase_04 AC 18 ms
11,864 KB
testcase_05 AC 18 ms
11,668 KB
testcase_06 AC 18 ms
11,740 KB
testcase_07 AC 18 ms
11,732 KB
testcase_08 AC 18 ms
11,736 KB
testcase_09 AC 17 ms
11,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (main args)
  (let* ([ls (string->list (read-line))])
    (print
     (let loop ([l ls]
                [i 0]
                [ia 0]
                [c 0])
       (cond [(null? l) c]
             [(char=? #\A (car l)) (loop (cdr l) (+ i 1) (+ ia 1) (+ c (- i ia)))]
             [else (loop (cdr l) (+ i 1) ia c)]))))
  0)
0