結果

問題 No.273 回文分解
ユーザー nanophoto12nanophoto12
提出日時 2015-12-07 22:53:49
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 553 bytes
コンパイル時間 2,105 ms
コンパイル使用メモリ 102,612 KB
実行使用メモリ 23,744 KB
最終ジャッジ日時 2023-08-25 01:27:58
合計ジャッジ時間 5,572 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 54 ms
21,448 KB
testcase_04 WA -
testcase_05 AC 58 ms
23,744 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 56 ms
23,696 KB
testcase_09 WA -
testcase_10 AC 56 ms
23,632 KB
testcase_11 AC 53 ms
23,536 KB
testcase_12 AC 54 ms
21,504 KB
testcase_13 AC 55 ms
21,504 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 55 ms
23,572 KB
testcase_18 WA -
testcase_19 AC 54 ms
21,488 KB
testcase_20 AC 54 ms
21,644 KB
testcase_21 AC 54 ms
21,520 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 55 ms
19,452 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 55 ms
21,644 KB
testcase_28 AC 55 ms
21,532 KB
testcase_29 AC 56 ms
23,464 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 55 ms
23,548 KB
testcase_33 AC 54 ms
21,456 KB
testcase_34 AC 54 ms
21,608 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;

namespace No273
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			var s = Console.ReadLine ();
			var r = new string(s.Reverse ().ToArray());

			int maxMatch = 0;
			for (int i = 0; i < s.Length; i++) {
				int a = 0;
				for (int k = 0; k + i< s.Length; k++) {
					if (s [i + k] == r [k]) {
						a++;
						maxMatch = Math.Max (maxMatch, a);
					} else {
						a = 0;
					}
				}
			}
			Console.WriteLine (maxMatch.ToString ());
		}
	}
}
0