結果

問題 No.627 ランダムウォークの軌跡
ユーザー neko_the_shadowneko_the_shadow
提出日時 2021-09-08 10:13:51
言語 Perl
(5.38.2)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 472 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 5,368 KB
実行使用メモリ 5,236 KB
最終ジャッジ日時 2023-08-26 14:31:58
合計ジャッジ時間 2,425 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
4,880 KB
testcase_01 AC 6 ms
4,892 KB
testcase_02 AC 6 ms
5,008 KB
testcase_03 AC 5 ms
5,056 KB
testcase_04 AC 5 ms
5,068 KB
testcase_05 AC 6 ms
4,948 KB
testcase_06 AC 6 ms
5,124 KB
testcase_07 AC 5 ms
5,236 KB
testcase_08 AC 5 ms
5,164 KB
testcase_09 AC 6 ms
4,944 KB
testcase_10 AC 5 ms
5,144 KB
testcase_11 AC 5 ms
5,028 KB
testcase_12 AC 5 ms
4,892 KB
testcase_13 AC 5 ms
5,028 KB
testcase_14 AC 6 ms
5,000 KB
testcase_15 AC 6 ms
5,048 KB
testcase_16 AC 5 ms
5,076 KB
testcase_17 AC 5 ms
5,184 KB
testcase_18 AC 6 ms
4,896 KB
testcase_19 AC 6 ms
4,900 KB
testcase_20 AC 5 ms
5,028 KB
testcase_21 AC 6 ms
5,080 KB
testcase_22 AC 5 ms
5,016 KB
testcase_23 AC 6 ms
5,024 KB
testcase_24 AC 5 ms
4,892 KB
testcase_25 AC 5 ms
4,868 KB
testcase_26 AC 6 ms
4,868 KB
testcase_27 AC 5 ms
4,944 KB
testcase_28 AC 5 ms
4,948 KB
testcase_29 AC 5 ms
5,000 KB
testcase_30 AC 6 ms
5,132 KB
testcase_31 AC 5 ms
4,884 KB
testcase_32 AC 6 ms
5,164 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

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

sub output {
    my $line = join " ", @_;
    print "$line\n";
}

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

my $t = input;
my @x = (0);
for (my $i = 0; $i < $t; $i++) {
    push @x, input;
}
for (my $i = 0; $i < $t; $i++) {
    if (abs($x[$i] - $x[$i+1]) != 1) {
        output "F";
        exit;
    }
}
output "T";
0