結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー MaboyMaboy
提出日時 2021-06-21 16:59:15
言語 Swift
(5.10.0)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 218 bytes
コンパイル時間 1,558 ms
コンパイル使用メモリ 151,868 KB
実行使用メモリ 18,256 KB
最終ジャッジ日時 2023-09-05 01:54:37
合計ジャッジ時間 4,355 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
14,196 KB
testcase_01 AC 6 ms
13,912 KB
testcase_02 AC 6 ms
14,108 KB
testcase_03 AC 6 ms
14,004 KB
testcase_04 AC 7 ms
14,380 KB
testcase_05 AC 22 ms
14,832 KB
testcase_06 AC 105 ms
14,924 KB
testcase_07 AC 266 ms
16,096 KB
testcase_08 AC 313 ms
18,256 KB
testcase_09 AC 179 ms
14,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import Foundation
var n = readLine()!
var a = n.count
var c = a - n.replacingOccurrences(of: "o", with: "").count
while a > 0{
    print(Double(c) / Double(a) * 100)
    c -= n.removeFirst() == "o" ? 1 : 0
    a -= 1
}
0