結果

問題 No.52 よくある文字列の問題
ユーザー mbanmban
提出日時 2017-01-04 15:24:17
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 30 ms / 5,000 ms
コード長 946 bytes
コンパイル時間 866 ms
コンパイル使用メモリ 109,832 KB
実行使用メモリ 26,160 KB
最終ジャッジ日時 2023-10-22 04:06:35
合計ジャッジ時間 1,831 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
26,100 KB
testcase_01 AC 27 ms
26,076 KB
testcase_02 AC 29 ms
26,140 KB
testcase_03 AC 28 ms
26,076 KB
testcase_04 AC 29 ms
26,160 KB
testcase_05 AC 28 ms
26,160 KB
testcase_06 AC 29 ms
26,160 KB
testcase_07 AC 29 ms
26,160 KB
testcase_08 AC 28 ms
26,160 KB
testcase_09 AC 28 ms
26,076 KB
testcase_10 AC 27 ms
26,096 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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;


class Magatro
{
    static string S = Console.ReadLine();
    static void Main()
    {
        HashSet<string> Hs = new HashSet<string>();
        int loop = (int)Math.Pow(2, S.Length);
        for(int i = 0; i < loop; i++)
        {
            int L = 0;
            int R = S.Length - 1;
            int q = i;
            string T = "";
            for(int j = 0; j < S.Length; j++)
            {
                if (q % 2 == 1)
                {
                    T += S[L];
                    L++;
                }
                else
                {
                    T += S[R];
                    R--;
                }
                q /= 2;
            }
            Hs.Add(T);
        }
        Console.WriteLine(Hs.Count);
    }

}

0