結果

問題 No.69 文字を自由に並び替え
ユーザー funakoshifunakoshi
提出日時 2019-06-21 16:18:37
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 1,602 bytes
コンパイル時間 2,305 ms
コンパイル使用メモリ 100,652 KB
実行使用メモリ 22,536 KB
最終ジャッジ日時 2023-08-21 00:19:42
合計ジャッジ時間 3,297 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
20,420 KB
testcase_01 AC 46 ms
20,500 KB
testcase_02 AC 46 ms
18,436 KB
testcase_03 AC 46 ms
20,424 KB
testcase_04 AC 48 ms
22,388 KB
testcase_05 AC 47 ms
20,464 KB
testcase_06 AC 47 ms
20,480 KB
testcase_07 AC 47 ms
20,436 KB
testcase_08 AC 47 ms
18,380 KB
testcase_09 AC 47 ms
22,536 KB
testcase_10 AC 47 ms
22,516 KB
testcase_11 AC 47 ms
20,544 KB
testcase_12 AC 47 ms
20,380 KB
testcase_13 AC 47 ms
20,516 KB
testcase_14 AC 47 ms
22,424 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.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++)
            {
               if(cnt[i]!=cnt2[i])
                {
                    flg = false;
                    break;
                }
            }
            if(flg==true)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
            
        }
    }
}
0