結果

問題 No.201 yukicoderじゃんけん
ユーザー
提出日時 2016-01-20 20:56:33
言語 PHP
(8.3.4)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 738 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 32,732 KB
実行使用メモリ 32,612 KB
最終ジャッジ日時 2023-10-21 13:37:02
合計ジャッジ時間 1,997 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
32,612 KB
testcase_01 AC 42 ms
32,612 KB
testcase_02 AC 44 ms
32,612 KB
testcase_03 AC 48 ms
32,612 KB
testcase_04 AC 43 ms
32,612 KB
testcase_05 AC 43 ms
32,612 KB
testcase_06 AC 43 ms
32,612 KB
testcase_07 AC 43 ms
32,612 KB
testcase_08 AC 43 ms
32,612 KB
testcase_09 AC 43 ms
32,612 KB
testcase_10 AC 43 ms
32,612 KB
testcase_11 AC 43 ms
32,612 KB
testcase_12 AC 42 ms
32,612 KB
testcase_13 AC 43 ms
32,612 KB
testcase_14 AC 43 ms
32,612 KB
testcase_15 AC 44 ms
32,612 KB
testcase_16 AC 43 ms
32,612 KB
testcase_17 AC 43 ms
32,612 KB
testcase_18 AC 43 ms
32,612 KB
testcase_19 AC 43 ms
32,612 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

$input1 = trim(fgets(STDIN));

list($player1,$player1Point,$player1hand) = explode(" ", $input1);

$str1 = strlen($player1Point);

$input2 = trim(fgets(STDIN));

list($player2,$player2Point,$player2hand) = explode(" ", $input2);

$str2 = strlen($player2Point);



if($str1 > $str2){
    $str2 = str_pad($str2,$str1,"0",STR_PAD_LEFT);
}else{
    $str1 = str_pad($str1,$str2,"0",STR_PAD_LEFT);
}

if($str1 < $str2){
    echo $player2."\n";
}else if($str1 > $str2){
    echo $player1."\n";
}

if($player1Point < $player2Point && $str1 == $str2){
    echo $player2."\n";
}else if($player1Point > $player2Point && $str1 == $str2){
    echo $player1."\n";
}else if($player1Point == $player2Point && $str1 == $str2){
    echo "-1"."\n";
}
0