結果
| 問題 | No.69 文字を自由に並び替え | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-03-17 03:11:19 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 25 ms / 5,000 ms | 
| コード長 | 1,002 bytes | 
| コンパイル時間 | 835 ms | 
| コンパイル使用メモリ | 107,568 KB | 
| 実行使用メモリ | 25,536 KB | 
| 最終ジャッジ日時 | 2024-12-14 06:31:11 | 
| 合計ジャッジ時間 | 1,854 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 15 | 
コンパイルメッセージ
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 yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string x = Console.ReadLine();
            string y = Console.ReadLine();
            int f = 1;
            for(int i = 0; i < y.Length && f == 1; i++)
            {
                f = 0;
                for (int j =0;j < x.Length && f == 0; j++)
                {
                    if(x[j] == y[i])
                    {
                        x = x.Remove(j, 1);
                        j--;
                        f = 1;
                    }
                }
            }
            if (f == 1)
            {
                Console.WriteLine("{0}", "YES");
            }
            else
            {
                Console.WriteLine("{0}", "NO");
            }
            Console.ReadLine();
        }
    }
}
            
            
            
        