結果

問題 No.69 文字を自由に並び替え
ユーザー n.yn.y
提出日時 2022-05-30 16:43:57
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,987 bytes
コンパイル時間 813 ms
コンパイル使用メモリ 106,380 KB
実行使用メモリ 23,636 KB
最終ジャッジ日時 2023-10-21 00:22:19
合計ジャッジ時間 2,468 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
23,612 KB
testcase_01 AC 22 ms
23,612 KB
testcase_02 WA -
testcase_03 AC 23 ms
23,612 KB
testcase_04 AC 23 ms
23,612 KB
testcase_05 WA -
testcase_06 AC 23 ms
23,612 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 23 ms
23,612 KB
testcase_10 AC 23 ms
23,612 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 23 ms
23,612 KB
testcase_14 AC 23 ms
23,612 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.Diagnostics;

namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //文字入力
            string A = Console.ReadLine();
            string B = Console.ReadLine();
            //文字入力用配列
            string[] a = new string[A.Length];
            string[] b = new string[B.Length];

            //文字列の一部分の取得
            for(int i=0;i<A.Length;i++)
            {
                string strA = A.Substring(i, 1);
                string strB = B.Substring(i, 1);
                a[i] = strA;
                b[i] = strB;
            }

            bool flg = true;
            int count = 0;
            for(int i=0;i<A.Length;i++)
            {
                for (int j = 0; j < B.Length; j++)
                {
                    if (a[i] != b[j])
                    {
                        flg = false;
                        count++;
                    }
                    else
                    {
                        flg = true;
                        
                    }
                    if (count == A.Length)
                    {
                        break;
                    }

                }
                //if(count>=1)
                //{
                //    flg = true;
                //}
                //count = 0;


            }
            if (flg == false)
            {
                Console.WriteLine("NO");
            }
            else
            {
                Console.WriteLine("YES");

            }
            //for (int i = 0; i < A.Length; i++)
            //{
            //    if (s[i] == null)
            //    {
            //        Console.WriteLine("NO");
            //        break;
            //    }
            //    else if(s[i]==)
            //    {
            //        Console.WriteLine("YES");
            //        break;
            //    }
            //}
        }
    }
}
0