結果

問題 No.69 文字を自由に並び替え
ユーザー kzyKTkzyKT
提出日時 2015-03-23 17:21:51
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 54 ms / 5,000 ms
コード長 1,026 bytes
コンパイル時間 3,301 ms
コンパイル使用メモリ 107,608 KB
実行使用メモリ 22,532 KB
最終ジャッジ日時 2023-08-20 22:47:33
合計ジャッジ時間 4,859 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
20,416 KB
testcase_01 AC 51 ms
20,424 KB
testcase_02 AC 52 ms
20,580 KB
testcase_03 AC 53 ms
22,528 KB
testcase_04 AC 52 ms
18,484 KB
testcase_05 AC 54 ms
22,448 KB
testcase_06 AC 53 ms
22,452 KB
testcase_07 AC 53 ms
20,512 KB
testcase_08 AC 53 ms
20,516 KB
testcase_09 AC 53 ms
22,464 KB
testcase_10 AC 51 ms
20,408 KB
testcase_11 AC 52 ms
20,648 KB
testcase_12 AC 52 ms
20,584 KB
testcase_13 AC 52 ms
22,412 KB
testcase_14 AC 52 ms
22,532 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace A {
	class main {
		public main() { }
		public static int Main() {
			new main().run();
			return 0;
		}
		void run() {
			Scanner cin = new Scanner();
			String s = cin.next ();
			String t = cin.next ();
			char[] c1=s.ToCharArray();
			char[] c2=t.ToCharArray();
			Array.Sort(c1);
			Array.Sort(c2);
			s=new String(c1);
			t=new String(c2);
			if (s == t) Console.WriteLine ("YES");
			else Console.WriteLine ("NO");
		}
	}

	class Scanner {
		string[] s;
		int i;

		char[] cs = new char[] { ' ' };

		public Scanner() {
			s = new string[0];
			i = 0;
		}
		public string next() {
			if (i < s.Length) return s[i++];
			s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
			i = 0;
			return s[i++];
		}
		public int nextInt() {
			return int.Parse(next());
		}
		public long nextLong() {
			return long.Parse(next());
		}
		public double nextDouble() {
			return double.Parse(next());
		}
	}
}
0