結果

問題 No.442 和と積
ユーザー motimoti
提出日時 2018-05-21 01:36:09
言語 Perl
(5.38.2)
結果
AC  
実行時間 38 ms / 1,000 ms
コード長 207 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 10,976 KB
実行使用メモリ 10,892 KB
最終ジャッジ日時 2023-09-18 07:01:23
合計ジャッジ時間 1,970 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
10,684 KB
testcase_01 AC 37 ms
10,860 KB
testcase_02 AC 37 ms
10,680 KB
testcase_03 AC 37 ms
10,608 KB
testcase_04 AC 37 ms
10,844 KB
testcase_05 AC 37 ms
10,664 KB
testcase_06 AC 37 ms
10,856 KB
testcase_07 AC 37 ms
10,644 KB
testcase_08 AC 37 ms
10,872 KB
testcase_09 AC 37 ms
10,776 KB
testcase_10 AC 37 ms
10,596 KB
testcase_11 AC 38 ms
10,652 KB
testcase_12 AC 37 ms
10,724 KB
testcase_13 AC 37 ms
10,660 KB
testcase_14 AC 37 ms
10,892 KB
testcase_15 AC 36 ms
10,648 KB
testcase_16 AC 37 ms
10,800 KB
testcase_17 AC 37 ms
10,872 KB
testcase_18 AC 37 ms
10,604 KB
testcase_19 AC 37 ms
10,784 KB
testcase_20 AC 37 ms
10,664 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl

use strict;
use warnings;
use Math::BigInt;

my ($x, $y) = split / /, <>; chomp $y;
my $g = Math::BigInt::bgcd($x, $y);
my $gcd = $g * Math::BigInt::bgcd($x/$g + $y/$g, $g);
print $gcd;
0