結果
問題 | No.69 文字を自由に並び替え |
ユーザー | funakoshi |
提出日時 | 2019-06-21 16:15:26 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,557 bytes |
コンパイル時間 | 2,049 ms |
コンパイル使用メモリ | 106,672 KB |
実行使用メモリ | 22,632 KB |
最終ジャッジ日時 | 2023-08-26 16:31:31 |
合計ジャッジ時間 | 3,936 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 50 ms
20,492 KB |
testcase_01 | AC | 50 ms
20,616 KB |
testcase_02 | AC | 50 ms
22,632 KB |
testcase_03 | AC | 51 ms
20,704 KB |
testcase_04 | AC | 50 ms
22,460 KB |
testcase_05 | AC | 50 ms
18,372 KB |
testcase_06 | AC | 49 ms
20,428 KB |
testcase_07 | AC | 50 ms
20,452 KB |
testcase_08 | AC | 50 ms
20,492 KB |
testcase_09 | AC | 50 ms
20,416 KB |
testcase_10 | AC | 50 ms
22,524 KB |
testcase_11 | AC | 50 ms
18,452 KB |
testcase_12 | AC | 50 ms
22,440 KB |
testcase_13 | AC | 51 ms
22,440 KB |
testcase_14 | WA | - |
コンパイルメッセージ
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; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoderTest { class Program { static void Main(string[] args) { string[] us = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }; int[] cnt = new int[us.Length]; int[] cnt2 = new int[us.Length]; for (int i=0;i<cnt.Length;i++) { cnt[i] = 0; cnt2[i] = 0; } string A = Console.ReadLine(); string B = Console.ReadLine(); for(int i =0;i<A.Length;i++) { string temp = A.Substring(i, 1); string temp2 = B.Substring(i, 1); for(int j=0;j<us.Length;j++) { if(temp==us[j]) { cnt[j]++; } if(temp2==us[j]) { cnt2[j]++; } } } bool flg = true; for(int i=0;i<cnt.Length;i++) { int temp=cnt[i] - cnt2[i]; if(temp<0) { flg = false; Console.WriteLine("NO"); } } if(flg==true) { Console.WriteLine("YES"); } } } }