結果

問題 No.201 yukicoderじゃんけん
ユーザー
提出日時 2016-01-20 19:08:27
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 647 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 32,732 KB
実行使用メモリ 32,856 KB
最終ジャッジ日時 2023-10-21 13:36:27
合計ジャッジ時間 2,202 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
32,856 KB
testcase_01 AC 43 ms
32,856 KB
testcase_02 AC 43 ms
32,856 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 44 ms
32,856 KB
testcase_06 AC 47 ms
32,856 KB
testcase_07 AC 42 ms
32,856 KB
testcase_08 AC 43 ms
32,856 KB
testcase_09 AC 42 ms
32,856 KB
testcase_10 WA -
testcase_11 AC 43 ms
32,856 KB
testcase_12 AC 42 ms
32,856 KB
testcase_13 AC 43 ms
32,856 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 43 ms
32,856 KB
testcase_17 AC 43 ms
32,856 KB
testcase_18 AC 42 ms
32,856 KB
testcase_19 AC 43 ms
32,856 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){
    echo $player2."\n";
}else if($player1Point > $player2Point){
    echo $player1."\n";
}else{
    echo "-1"."\n";
}
0