結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー motimoti
提出日時 2018-05-20 23:46:42
言語 Perl
(5.38.2)
結果
AC  
実行時間 185 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 21,384 KB
最終ジャッジ日時 2023-09-11 00:13:19
合計ジャッジ時間 2,158 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,956 KB
testcase_01 AC 5 ms
4,904 KB
testcase_02 AC 5 ms
5,080 KB
testcase_03 AC 5 ms
4,960 KB
testcase_04 AC 6 ms
5,208 KB
testcase_05 AC 23 ms
6,728 KB
testcase_06 AC 93 ms
13,148 KB
testcase_07 AC 185 ms
21,336 KB
testcase_08 AC 84 ms
21,340 KB
testcase_09 AC 79 ms
21,384 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl

use strict;
use warnings;

my $s = <>; chomp $s;
my @array;
my $liveness = 0;
for my $ch (split //, $s) {
  push @array, $ch;
  if ($ch eq 'o') {
    $liveness++;
  }
}

my $all = @array;

for my $ch (@array) {
  print $liveness / $all * 100 . "\n";
  if ($ch eq 'o') {
    $liveness--;
  }
  $all--;
}
0