結果
| 問題 |
No.69 文字を自由に並び替え
|
| コンテスト | |
| ユーザー |
funakoshi
|
| 提出日時 | 2019-06-21 16:18:37 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 5,000 ms |
| コード長 | 1,602 bytes |
| コンパイル時間 | 827 ms |
| コンパイル使用メモリ | 110,180 KB |
| 実行使用メモリ | 25,676 KB |
| 最終ジャッジ日時 | 2024-12-14 07:27:39 |
| 合計ジャッジ時間 | 1,795 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 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");
}
}
}
}
funakoshi