結果

問題 No.69 文字を自由に並び替え
ユーザー shiCanoko_oshiCanoko_o
提出日時 2019-07-14 02:17:13
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 504 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 4,704 KB
最終ジャッジ日時 2023-08-15 10:45:25
合計ジャッジ時間 898 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,620 KB
testcase_01 AC 2 ms
4,592 KB
testcase_02 AC 2 ms
4,704 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,476 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,632 KB
testcase_10 AC 3 ms
4,540 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 3 ms
4,592 KB
testcase_14 AC 2 ms
4,424 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

my $letter_A = <>;
my $letter_B =<>;
chomp ($letter_A, $letter_B);

my @letter_A = split(//, $letter_A);
my @letter_B = split(//, $letter_B);

@letter_A = sort {$a cmp $b} @letter_A;
@letter_B = sort {$a cmp $b} @letter_B;

my $count = 0;
my $count_same = 0;

for my $character_A(@letter_A){
    for my $character_B(@letter_B){
        $count++;
        if ($letter_A =~ /$letter_B/){
            $count_same++;
        }
    }
}

if ($count == $count_same){
    print "YES\n";
}else{
    print "NO\n";
}
0