結果
問題 |
No.52 よくある文字列の問題
|
ユーザー |
![]() |
提出日時 | 2017-01-04 15:24:17 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 28 ms / 5,000 ms |
コード長 | 946 bytes |
コンパイル時間 | 836 ms |
コンパイル使用メモリ | 111,772 KB |
実行使用メモリ | 28,180 KB |
最終ジャッジ日時 | 2024-09-22 05:28:21 |
合計ジャッジ時間 | 1,675 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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); } }