結果

問題 No.538 N.G.S.
ユーザー motimoti
提出日時 2018-05-30 02:41:03
言語 Perl
(5.38.2)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 14,364 KB
実行使用メモリ 14,384 KB
最終ジャッジ日時 2023-09-12 20:34:24
合計ジャッジ時間 5,442 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
14,164 KB
testcase_01 AC 64 ms
14,300 KB
testcase_02 AC 58 ms
14,172 KB
testcase_03 AC 60 ms
14,072 KB
testcase_04 AC 58 ms
14,136 KB
testcase_05 AC 58 ms
14,044 KB
testcase_06 AC 58 ms
14,152 KB
testcase_07 AC 58 ms
14,312 KB
testcase_08 AC 59 ms
14,120 KB
testcase_09 AC 59 ms
14,160 KB
testcase_10 AC 58 ms
14,040 KB
testcase_11 AC 58 ms
14,276 KB
testcase_12 AC 58 ms
14,260 KB
testcase_13 AC 58 ms
14,112 KB
testcase_14 AC 58 ms
14,128 KB
testcase_15 AC 58 ms
14,052 KB
testcase_16 AC 58 ms
14,056 KB
testcase_17 AC 59 ms
14,148 KB
testcase_18 AC 60 ms
14,052 KB
testcase_19 AC 59 ms
14,088 KB
testcase_20 AC 59 ms
14,288 KB
testcase_21 AC 59 ms
14,036 KB
testcase_22 AC 59 ms
14,180 KB
testcase_23 AC 59 ms
14,188 KB
testcase_24 AC 59 ms
14,308 KB
testcase_25 AC 59 ms
14,232 KB
testcase_26 AC 60 ms
14,276 KB
testcase_27 AC 59 ms
14,340 KB
testcase_28 AC 60 ms
14,040 KB
testcase_29 AC 60 ms
14,136 KB
testcase_30 AC 60 ms
14,132 KB
testcase_31 AC 60 ms
14,108 KB
testcase_32 AC 60 ms
14,196 KB
testcase_33 AC 59 ms
14,136 KB
testcase_34 AC 60 ms
14,196 KB
testcase_35 AC 59 ms
14,384 KB
testcase_36 AC 60 ms
14,152 KB
testcase_37 AC 60 ms
14,176 KB
testcase_38 AC 60 ms
14,292 KB
testcase_39 AC 61 ms
14,080 KB
testcase_40 AC 62 ms
14,136 KB
testcase_41 AC 62 ms
14,352 KB
testcase_42 AC 60 ms
14,128 KB
testcase_43 AC 59 ms
14,196 KB
testcase_44 AC 59 ms
14,076 KB
testcase_45 AC 60 ms
14,132 KB
testcase_46 AC 60 ms
14,156 KB
testcase_47 AC 59 ms
14,300 KB
testcase_48 AC 60 ms
14,212 KB
testcase_49 AC 60 ms
14,184 KB
testcase_50 AC 58 ms
14,316 KB
testcase_51 AC 59 ms
14,312 KB
testcase_52 AC 58 ms
14,348 KB
testcase_53 AC 59 ms
14,372 KB
testcase_54 AC 58 ms
14,108 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl

use bignum;

my ($b1, $b2, $b3) = split / /, <>; chomp $b3;
if ($b2 - $b1 == 0) {
  print $b1;
} else {
  my $r = ($b3 - $b2) / ($b2 - $b1);
  my $d = $b3 - $r * $b2;
  my $res = $r * $b3 + $d;
  print int($res - 0.5) if $res < 0;
  print int($res + 0.5) if $res >= 0;
}
0