結果
| 問題 | 
                            No.238 Mr. K's Another Gift
                             | 
                    
| コンテスト | |
| ユーザー | 
                             No
                         | 
                    
| 提出日時 | 2017-05-24 20:39:02 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,253 bytes | 
| コンパイル時間 | 813 ms | 
| コンパイル使用メモリ | 111,264 KB | 
| 実行使用メモリ | 27,680 KB | 
| 最終ジャッジ日時 | 2024-09-19 16:27:18 | 
| 合計ジャッジ時間 | 5,129 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 1 | 
| other | AC * 26 WA * 14 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
namespace Yuki
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int i = 0;
            int j = s.Length - 1;
            int c = -1;
            int d = -1;
            bool f = true;
            while (i <= j)
            {
                if (s[i] != s[j])
                {
                    c = i;
                    d = j;
                    f = false;
                    break;
                }
                i++;
                j--;
            }
            if (f)
            {
                Console.Write(s.Insert(s.Length / 2, s[s.Length / 2].ToString()));
            }
            else
            {
                string a = s.Insert(c, s[d].ToString());
                string b = s.Insert(d, s[c].ToString());
                if (s.ToArray<char>() == b.Reverse<char>())
                {
                    Console.WriteLine(a);
                }else if (s.ToArray<char>() == b.Reverse<char>())
                {
                    Console.WriteLine(b);
                }
                else
                {
                    Console.WriteLine("NA");
                }
            }
        }
    }
}
            
            
            
        
            
No