結果
| 問題 |
No.52 よくある文字列の問題
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2018-01-27 16:39:02 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 5,000 ms |
| コード長 | 796 bytes |
| コンパイル時間 | 1,137 ms |
| コンパイル使用メモリ | 113,712 KB |
| 実行使用メモリ | 25,280 KB |
| 最終ジャッジ日時 | 2024-09-22 05:34:24 |
| 合計ジャッジ時間 | 1,752 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / 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.Generic;
using System.Linq;
namespace y
{
class Program
{
static void Main(string[] args)
{
var li1 = new List<string>();
var s = Console.ReadLine();
li1.Add("," + s);
for (int i = 0; i < s.Length; i++)
{
var li2 = new List<string>();
foreach (var item in li1)
{
string[] ss = item.Split(',');
li2.Add(ss[0] + ss[1][0] + "," + ss[1].Remove(0,1));
li2.Add(ss[0] + ss[1][ss[1].Length - 1] + "," + ss[1].Remove(ss[1].Length - 1, 1));
}
li1 = li2;
}
Console.WriteLine(li1.Distinct().Count());
}
}
}
No