結果
問題 | No.69 文字を自由に並び替え |
ユーザー | 親子丼 |
提出日時 | 2016-03-29 10:36:03 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 54 ms / 5,000 ms |
コード長 | 1,106 bytes |
コンパイル時間 | 2,130 ms |
コンパイル使用メモリ | 104,452 KB |
実行使用メモリ | 22,656 KB |
最終ジャッジ日時 | 2023-08-20 23:16:58 |
合計ジャッジ時間 | 3,821 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 52 ms
20,440 KB |
testcase_01 | AC | 52 ms
20,588 KB |
testcase_02 | AC | 53 ms
22,656 KB |
testcase_03 | AC | 54 ms
20,640 KB |
testcase_04 | AC | 54 ms
20,512 KB |
testcase_05 | AC | 53 ms
20,640 KB |
testcase_06 | AC | 54 ms
20,608 KB |
testcase_07 | AC | 54 ms
22,564 KB |
testcase_08 | AC | 54 ms
22,648 KB |
testcase_09 | AC | 54 ms
20,612 KB |
testcase_10 | AC | 52 ms
20,548 KB |
testcase_11 | AC | 53 ms
20,580 KB |
testcase_12 | AC | 54 ms
20,648 KB |
testcase_13 | AC | 54 ms
20,580 KB |
testcase_14 | AC | 52 ms
20,436 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; class yukicoder { static void Main(string[] args) { var r = new Reader(); var A = r.next(); var B = r.next(); var list = new List<char>(); foreach ( var c in B ) list.Add(c); foreach(var c in A ) { if ( list.Contains(c) ) { list.Remove(c); } else { Console.WriteLine("NO"); return; } } Console.WriteLine("YES"); } } class Reader { string[] s; int i; char[] cs = new char[] { ' ' }; public Reader() { s = new string[0]; i = 0; } public string next() { if ( i < s.Length ) return s[i++]; var input = Console.ReadLine(); while ( input == "" ) input = Console.ReadLine(); s = input.Split(cs, StringSplitOptions.RemoveEmptyEntries); i = 0; return next(); } }