結果
| 問題 | No.175 simpleDNA |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-03 09:21:07 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,118 bytes |
| コンパイル時間 | 8,072 ms |
| コンパイル使用メモリ | 170,880 KB |
| 実行使用メモリ | 167,212 KB |
| 最終ジャッジ日時 | 2025-12-03 09:21:19 |
| 合計ジャッジ時間 | 11,268 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 |
| other | -- * 6 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (109 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
public class Program
{
public static void Main()
{
int num = int.Parse(Console.ReadLine() ?? string.Empty);
int num2 = int.Parse(Console.ReadLine() ?? string.Empty);
string[] str = (Console.ReadLine() ?? string.Empty).Trim().Split(' ');
//string str = Console.ReadLine() ?? string.Empty;
List<string> list = new List<string>();
AB(num, list, "");
int count = 0;
for (int i = 0; i < list.Count; i++)
{
for (int j = 0; j < str.Length; j++)
{
if (list[i].LastIndexOf(str[j]) == num - 3)
{
count++;
}
}
}
Console.WriteLine(count);
}
static void AB(int length, List<string> list, string str)
{
if (str.Length == length)
{
list.Add(str);
return;
}
char[] ab = ['A', 'B'];
string dna = str;
for (int i = 0; i < ab.Length; i++)
{
//dna += ab[i]; //修正
AB(length, list, dna + ab[i]);
}
}
}