結果
| 問題 |
No.2099 [Cherry Alpha B] Time Machine
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2022-10-14 22:05:40 |
| 言語 | Perl (5.40.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 282 bytes |
| コンパイル時間 | 101 ms |
| コンパイル使用メモリ | 6,688 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-26 14:38:01 |
| 合計ジャッジ時間 | 2,364 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 37 WA * 35 |
コンパイルメッセージ
Warning: Use of "int" without parentheses is ambiguous at Main.pl line 9. Main.pl syntax OK
ソースコード
$t=<>;
($x,$a)=glob<>;
($y,$b)=glob<>;
if($t>=0){
$q=int$t/$a;
$c+=$q*$x;
$t-=$q*$a;
}else{
$q=int+(1-$t)/$b+1;
$c+=$q*$y;
$t+=$q*$b;
}
$d=$c+$t;
while(1){
$t+=$y;
$c+=$b;
$q=int$t/$a;
$c+=$q*$x;
$t-=$q*$a;
if($c>$d){
last;
}
if($d>$c+$t){
$d=$c+$t;
}
}
print$d;
tails