結果

問題 No.687 E869120 and Constructing Array 1
ユーザー neko_the_shadowneko_the_shadow
提出日時 2021-09-08 10:30:59
言語 Perl
(5.38.2)
結果
AC  
実行時間 6 ms / 1,000 ms
コード長 395 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 5,184 KB
最終ジャッジ日時 2023-08-26 15:13:55
合計ジャッジ時間 1,198 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,184 KB
testcase_01 AC 5 ms
5,112 KB
testcase_02 AC 5 ms
5,144 KB
testcase_03 AC 6 ms
5,136 KB
testcase_04 AC 5 ms
4,992 KB
testcase_05 AC 5 ms
5,036 KB
testcase_06 AC 5 ms
5,024 KB
testcase_07 AC 5 ms
5,184 KB
testcase_08 AC 5 ms
4,976 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use strict;
use warnings;
use feature qw/state/;

sub output {
    print "@_\n";
}

sub input {
    state @que;
    if (@que == 0) {
        chomp(my $line = <>);
        push @que, split / /, $line;
    }
    return shift @que;
}

my $N = input;
foreach my $a1 (1..10) {
    foreach my $a2 (1..10) {
        if ($a1+$a2 == $N) {
            output $a1, $a2;
            exit;
        } 
    }
}
0