結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー kuroi_13kuroi_13
提出日時 2018-04-12 14:35:59
言語 Perl
(5.38.2)
結果
AC  
実行時間 185 ms / 2,000 ms
コード長 243 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 13,840 KB
最終ジャッジ日時 2023-09-09 04:17:02
合計ジャッジ時間 1,658 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
5,056 KB
testcase_01 AC 5 ms
4,996 KB
testcase_02 AC 5 ms
4,996 KB
testcase_03 AC 5 ms
5,244 KB
testcase_04 AC 7 ms
5,100 KB
testcase_05 AC 22 ms
5,852 KB
testcase_06 AC 94 ms
9,292 KB
testcase_07 AC 185 ms
13,840 KB
testcase_08 AC 150 ms
13,656 KB
testcase_09 AC 109 ms
13,728 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use strict;
use warnings;

my $str = <>;
chomp $str;

my %p = (m => length($str)+1, c => scalar(() = $str =~ m/o/g));

for my $i(split '', $str){
  print sprintf("%.13f", $p{c}/--$p{m} * 100)."\n";
  if($i eq 'o' and $p{c}){
    $p{c}--;
  }
}
0