結果
問題 | No.264 じゃんけん |
ユーザー |
![]() |
提出日時 | 2015-10-05 03:15:34 |
言語 | Perl (5.40.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 337 bytes |
コンパイル時間 | 319 ms |
コンパイル使用メモリ | 6,816 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 19:37:26 |
合計ジャッジ時間 | 543 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
コンパイルメッセージ
Main.pl syntax OK
ソースコード
@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" }