結果

問題 No.264 じゃんけん
ユーザー wreulickewreulicke
提出日時 2015-10-05 03:15:34
言語 Perl
(5.38.2)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 337 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 4,652 KB
最終ジャッジ日時 2023-09-27 02:04:59
合計ジャッジ時間 865 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,648 KB
testcase_01 AC 3 ms
4,528 KB
testcase_02 AC 3 ms
4,528 KB
testcase_03 AC 3 ms
4,576 KB
testcase_04 AC 3 ms
4,572 KB
testcase_05 AC 2 ms
4,652 KB
testcase_06 AC 3 ms
4,580 KB
testcase_07 AC 2 ms
4,472 KB
testcase_08 AC 2 ms
4,648 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

@hands=split(" ",<>);
$myhand=$hands[0]+0;
$yourhand=$hands[1]+0;
print &judge($myhand,$yourhand);
sub judge{
  return "Drew" if $_[0]==$_[1];
  $isSwap=0;
  if($_[0]>$_[1]){
    $isSwap=1;
    ($_[0],$_[1])=($_[1],$_[0]);
  }
  $isWon=0;
  $isWon=1 if $_[1]-$_[0]==1;
  $isWon^=1 if $isSwap;
  return "Won" if $isWon;
  return "Lost"
}
0