結果

問題 No.69 文字を自由に並び替え
ユーザー kazu116kazu116
提出日時 2019-05-10 16:06:15
言語 Swift
(5.10.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 382 bytes
コンパイル時間 2,884 ms
コンパイル使用メモリ 114,916 KB
実行使用メモリ 7,652 KB
最終ジャッジ日時 2023-08-20 12:23:45
合計ジャッジ時間 1,930 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,368 KB
testcase_01 AC 4 ms
7,596 KB
testcase_02 AC 3 ms
7,580 KB
testcase_03 AC 3 ms
7,580 KB
testcase_04 AC 3 ms
7,648 KB
testcase_05 AC 3 ms
7,576 KB
testcase_06 AC 3 ms
7,512 KB
testcase_07 AC 3 ms
7,488 KB
testcase_08 AC 3 ms
7,568 KB
testcase_09 AC 3 ms
7,428 KB
testcase_10 AC 3 ms
7,552 KB
testcase_11 AC 3 ms
7,520 KB
testcase_12 AC 3 ms
7,652 KB
testcase_13 AC 3 ms
7,516 KB
testcase_14 AC 3 ms
7,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

var str1:[String] = readLine()!.map{String($0)}
var str2:[String] = readLine()!.map{String($0)}

str1.sort {$0 < $1}
str2.sort {$0 < $1}

var sortStr1:String = ""
for i in 0..<str1.count {
    sortStr1 = sortStr1 + str1[i]
}
var sortStr2:String = ""
for i in 0..<str2.count {
    sortStr2 = sortStr2 + str2[i]
}

if sortStr1 == sortStr2 {
    print("YES")
}
else {
    print("NO")
}
0