結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー tentententen
提出日時 2020-10-09 11:45:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 357 ms / 2,000 ms
コード長 635 bytes
コンパイル時間 1,923 ms
コンパイル使用メモリ 71,472 KB
実行使用メモリ 63,164 KB
最終ジャッジ日時 2023-09-27 12:36:11
合計ジャッジ時間 6,350 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
55,840 KB
testcase_01 AC 113 ms
55,716 KB
testcase_02 AC 112 ms
55,788 KB
testcase_03 AC 111 ms
56,072 KB
testcase_04 AC 119 ms
56,064 KB
testcase_05 AC 171 ms
58,152 KB
testcase_06 AC 258 ms
59,220 KB
testcase_07 AC 357 ms
63,164 KB
testcase_08 AC 310 ms
60,008 KB
testcase_09 AC 224 ms
59,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] arr = sc.next().toCharArray();
        double length = arr.length;
        int good = 0;
        for (char c : arr) {
            if (c == 'o') {
                good++;
            }
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < arr.length; i++) {
            sb.append(good / length * 100).append("\n");
            if (arr[i] == 'o') {
                good--;
            }
            length -= 1;
        }
        System.out.print(sb);
    }
}
0