結果

問題 No.2420 Simple Problem
ユーザー emoany
提出日時 2023-08-12 15:22:49
言語 Perl
(5.40.0)
結果
WA  
実行時間 -
コード長 314 bytes
コンパイル時間 568 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 7,552 KB
最終ジャッジ日時 2024-11-20 01:43:03
合計ジャッジ時間 18,291 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 27 WA * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use strict;
use warnings;

use strict;
use warnings;
use POSIX 'ceil';

my $n = <>;
chomp $n;

my $cand = 1000000000;

for (my $i = 0; $i < $n; $i++) {
    my ($a, $b) = split /[ \n]/, <>;

    my $c = sqrt($a) + sqrt($b);
    if ($c == ceil($c)) {
	print $c + 1, "\n";
    } else {
	print ceil($c), "\n";
    }
}
0