結果

問題 No.273 回文分解
ユーザー NoNo
提出日時 2015-11-04 18:49:54
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 849 bytes
コンパイル時間 2,098 ms
コンパイル使用メモリ 101,260 KB
実行使用メモリ 22,640 KB
最終ジャッジ日時 2023-08-25 01:26:47
合計ジャッジ時間 5,993 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 51 ms
22,480 KB
testcase_02 AC 49 ms
20,612 KB
testcase_03 AC 49 ms
22,500 KB
testcase_04 AC 49 ms
20,448 KB
testcase_05 AC 49 ms
20,440 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 48 ms
20,488 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 50 ms
20,624 KB
testcase_15 AC 49 ms
20,524 KB
testcase_16 AC 49 ms
22,628 KB
testcase_17 AC 49 ms
22,496 KB
testcase_18 AC 51 ms
22,524 KB
testcase_19 AC 50 ms
20,624 KB
testcase_20 AC 50 ms
20,704 KB
testcase_21 AC 50 ms
20,572 KB
testcase_22 AC 50 ms
20,520 KB
testcase_23 AC 51 ms
20,448 KB
testcase_24 AC 51 ms
20,432 KB
testcase_25 AC 51 ms
22,432 KB
testcase_26 AC 51 ms
20,580 KB
testcase_27 AC 51 ms
22,624 KB
testcase_28 AC 52 ms
22,564 KB
testcase_29 WA -
testcase_30 AC 51 ms
20,488 KB
testcase_31 AC 51 ms
22,564 KB
testcase_32 AC 51 ms
20,456 KB
testcase_33 AC 51 ms
22,628 KB
testcase_34 AC 52 ms
20,452 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Yuki
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string a;
            int max = s.Length == 2 && s[0].Equals(s[1]) ? 1 : 0;

            for (int i = 0; i < s.Length; i++)
            {
                a = s[i].ToString();
                for (int j = i + 1; j < s.Length; j++)
                {
                    a += s[j];
                    if (a.Length == s.Length) break;
                    char[] b = a.ToCharArray();
                    Array.Reverse(b);
                    if (a.Equals(new string(b)) && a.Length > max) max = a.Length;
                }
            }
            Console.WriteLine(max);
        }
    }
}
0