結果
| 問題 |
No.69 文字を自由に並び替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-30 16:43:57 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,987 bytes |
| コンパイル時間 | 795 ms |
| コンパイル使用メモリ | 103,808 KB |
| 実行使用メモリ | 17,408 KB |
| 最終ジャッジ日時 | 2024-09-21 00:52:45 |
| 合計ジャッジ時間 | 1,792 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 WA * 6 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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;
// }
//}
}
}
}