結果
問題 | No.69 文字を自由に並び替え |
ユーザー | ribennge |
提出日時 | 2018-08-27 23:33:49 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 893 bytes |
コンパイル時間 | 2,801 ms |
コンパイル使用メモリ | 74,208 KB |
実行使用メモリ | 55,836 KB |
最終ジャッジ日時 | 2023-09-19 08:26:26 |
合計ジャッジ時間 | 5,861 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 124 ms
55,544 KB |
testcase_01 | AC | 124 ms
55,668 KB |
testcase_02 | AC | 126 ms
55,788 KB |
testcase_03 | AC | 122 ms
55,576 KB |
testcase_04 | WA | - |
testcase_05 | AC | 129 ms
55,588 KB |
testcase_06 | AC | 125 ms
55,356 KB |
testcase_07 | AC | 124 ms
55,512 KB |
testcase_08 | AC | 124 ms
55,812 KB |
testcase_09 | AC | 125 ms
55,360 KB |
testcase_10 | AC | 127 ms
55,660 KB |
testcase_11 | AC | 124 ms
55,596 KB |
testcase_12 | AC | 127 ms
55,500 KB |
testcase_13 | AC | 124 ms
55,616 KB |
testcase_14 | AC | 124 ms
55,836 KB |
ソースコード
import java.util.Scanner; class No_64{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String a = sc.next(); String b = sc.next(); int cnt = 0; int judge1 = 1; int judge2 = 1; for(int i = 0;i < a.length();i++){ char x = a.charAt(i); for(int t = 0;t < a.length();t++){ char y = b.charAt(t); if(x == y){ break; } cnt++; } if(cnt == a.length()){ judge1 = 0; break; } cnt = 0; } for(int i = 0;i < a.length();i++){ char x = b.charAt(i); for(int t = 0;t < a.length();t++){ char y = a.charAt(t); if(x == y){ break; } cnt++; } if(cnt == a.length()){ judge2 = 0; break; } cnt = 0; } if(judge1 == 1 && judge2 == 1){ System.out.println("YES"); }else{ System.out.println("NO"); } } }