結果
| 問題 |
No.69 文字を自由に並び替え
|
| コンテスト | |
| ユーザー |
funakoshi
|
| 提出日時 | 2019-06-21 16:15:26 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,557 bytes |
| コンパイル時間 | 793 ms |
| コンパイル使用メモリ | 103,808 KB |
| 実行使用メモリ | 17,152 KB |
| 最終ジャッジ日時 | 2024-12-25 15:25:08 |
| 合計ジャッジ時間 | 1,893 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 1 |
コンパイルメッセージ
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");
}
}
}
}
funakoshi