結果

問題 No.2420 Simple Problem
ユーザー emoanyemoany
提出日時 2023-08-12 15:22:49
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 314 bytes
コンパイル時間 1,077 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 7,680 KB
最終ジャッジ日時 2024-04-30 09:06:01
合計ジャッジ時間 18,653 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,424 KB
testcase_01 AC 229 ms
7,424 KB
testcase_02 AC 19 ms
7,552 KB
testcase_03 AC 93 ms
7,552 KB
testcase_04 AC 422 ms
7,552 KB
testcase_05 AC 274 ms
7,552 KB
testcase_06 AC 528 ms
7,424 KB
testcase_07 AC 525 ms
7,424 KB
testcase_08 AC 527 ms
7,552 KB
testcase_09 AC 531 ms
7,424 KB
testcase_10 AC 524 ms
7,552 KB
testcase_11 AC 525 ms
7,424 KB
testcase_12 AC 530 ms
7,552 KB
testcase_13 AC 524 ms
7,424 KB
testcase_14 AC 527 ms
7,552 KB
testcase_15 AC 525 ms
7,424 KB
testcase_16 AC 524 ms
7,552 KB
testcase_17 AC 526 ms
7,424 KB
testcase_18 AC 521 ms
7,424 KB
testcase_19 AC 523 ms
7,680 KB
testcase_20 AC 524 ms
7,424 KB
testcase_21 AC 524 ms
7,552 KB
testcase_22 AC 525 ms
7,552 KB
testcase_23 AC 530 ms
7,424 KB
testcase_24 AC 526 ms
7,424 KB
testcase_25 AC 532 ms
7,552 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 17 ms
7,424 KB
testcase_33 AC 226 ms
7,424 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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