結果

問題 No.69 文字を自由に並び替え
ユーザー togaerrortogaerror
提出日時 2015-04-18 01:40:06
言語 Perl
(5.38.2)
結果
AC  
実行時間 6 ms / 5,000 ms
コード長 337 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 5,104 KB
最終ジャッジ日時 2023-08-20 22:48:15
合計ジャッジ時間 1,030 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
5,076 KB
testcase_01 AC 6 ms
5,100 KB
testcase_02 AC 4 ms
4,912 KB
testcase_03 AC 5 ms
4,980 KB
testcase_04 AC 5 ms
4,912 KB
testcase_05 AC 5 ms
4,800 KB
testcase_06 AC 4 ms
4,984 KB
testcase_07 AC 5 ms
4,780 KB
testcase_08 AC 5 ms
5,104 KB
testcase_09 AC 5 ms
4,952 KB
testcase_10 AC 4 ms
5,020 KB
testcase_11 AC 5 ms
4,912 KB
testcase_12 AC 5 ms
4,920 KB
testcase_13 AC 5 ms
5,020 KB
testcase_14 AC 5 ms
5,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/perl

use strict;
use warnings;

my $stra = <>;
my $strb = <>;
chomp $stra;
chomp $strb;
my @arraya = split //, $stra;
my @arrayb = split //, $strb;

@arraya = sort @arraya;
@arrayb = sort @arrayb;

for(my $i = 0; $i < length $stra; $i++) {
	if($arraya[$i] ne $arrayb[$i]) {
		print "NO\n";
		exit;
	}
}

print "YES\n";

exit;
0