結果

問題 No.35 タイパー高橋
ユーザー beatdjambeatdjam
提出日時 2016-09-30 10:51:21
言語 PHP
(8.3.4)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 724 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 18,776 KB
実行使用メモリ 18,792 KB
最終ジャッジ日時 2023-08-13 15:20:42
合計ジャッジ時間 893 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,728 KB
testcase_01 AC 16 ms
18,792 KB
testcase_02 AC 16 ms
18,708 KB
testcase_03 AC 16 ms
18,648 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    $input_lines = trim(fgets(STDIN));
    $input_lines = str_replace(array("\r\n","\r","\n"), "", $input_lines);
    do {
        $tmpStr[] = $input_lines;
        $input_lines = trim(fgets(STDIN));
        $input_lines = str_replace(array("\r\n","\r","\n"), "", $input_lines);
    } while ($input_lines !== "");
    
    array_shift($tmpStr);
    
    $speed = 1000 / 12;
    
    $count = 0;
    $failCount = 0;
    foreach($tmpStr as $value){
    	$s = explode(" ", $value);
    	$tmp = $s[0];
    	$val = floor($tmp / $speed)  > strlen($s[1])? 
    							strlen($s[1]) : floor($tmp / $speed);
    	
    	$count += $val;
    	$failCount += strlen($s[1]) - $val;
    }
    echo $count . " " . $failCount;
    
    
0