結果

問題 No.69 文字を自由に並び替え
ユーザー shiCanoko_oshiCanoko_o
提出日時 2019-07-14 02:20:13
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 38 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 5,504 KB
最終ジャッジ日時 2024-05-02 22:17:18
合計ジャッジ時間 681 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,376 KB
testcase_01 AC 3 ms
5,376 KB
testcase_02 AC 4 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 4 ms
5,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 4 ms
5,376 KB
testcase_09 AC 4 ms
5,376 KB
testcase_10 AC 4 ms
5,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 4 ms
5,376 KB
testcase_14 AC 4 ms
5,376 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){
    $count++;
    for my $character_B(@letter_B){
        if ($character_A =~ /$character_B/){
            $count_same++;
        }
    }
}

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