結果
問題 | No.69 文字を自由に並び替え |
ユーザー |
|
提出日時 | 2021-01-07 23:48:14 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 73 ms / 5,000 ms |
コード長 | 596 bytes |
コンパイル時間 | 2,647 ms |
コンパイル使用メモリ | 76,432 KB |
実行使用メモリ | 51,448 KB |
最終ジャッジ日時 | 2024-11-14 05:40:41 |
合計ジャッジ時間 | 4,149 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.stream.Collectors; import java.util.stream.Stream; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String strA = br.readLine(); String strB = br.readLine(); boolean result = Stream.of(strA.split("")).sorted().collect(Collectors.joining()) .equals(Stream.of(strB.split("")).sorted().collect(Collectors.joining())); System.out.println(result ? "YES" : "NO"); } }