結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー tsunabittsunabit
提出日時 2019-06-23 10:42:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,578 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 3,254 ms
コンパイル使用メモリ 72,236 KB
実行使用メモリ 75,840 KB
最終ジャッジ日時 2023-08-27 03:21:56
合計ジャッジ時間 12,947 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,072 KB
testcase_01 AC 124 ms
55,792 KB
testcase_02 AC 126 ms
56,224 KB
testcase_03 AC 147 ms
55,940 KB
testcase_04 AC 273 ms
57,076 KB
testcase_05 AC 477 ms
63,672 KB
testcase_06 AC 1,089 ms
71,104 KB
testcase_07 AC 1,578 ms
75,840 KB
testcase_08 AC 1,442 ms
72,472 KB
testcase_09 AC 1,404 ms
75,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No667 {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	String s = sc.next();
    	int ata = s.replace("x", "").length();
    	String[] str = s.split("");
    	
    	for(int i = 0; i < s.length(); i++) {
    		System.out.println(String.format("%.7f", ((double)ata / (s.length() - i)) * 100));
    		if("o".equals(str[i])) ata--;
    	}
    }
}
0