結果

問題 No.201 yukicoderじゃんけん
ユーザー
提出日時 2016-01-20 20:56:33
言語 PHP
(843.2)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 738 bytes
コンパイル時間 1,164 ms
コンパイル使用メモリ 31,116 KB
実行使用メモリ 31,604 KB
最終ジャッジ日時 2024-09-21 14:51:47
合計ジャッジ時間 2,580 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
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