結果
| 問題 | No.3487 Restricted Shiritori |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-01 21:28:15 |
| 言語 | C# (.NET 10.0.201) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 2,000 ms |
| コード長 | 583 bytes |
| 記録 | |
| コンパイル時間 | 9,384 ms |
| コンパイル使用メモリ | 172,284 KB |
| 実行使用メモリ | 203,772 KB |
| 最終ジャッジ日時 | 2026-04-01 21:28:39 |
| 合計ジャッジ時間 | 12,841 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (126 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
#nullable enable
#region
var (_input, _iter) = (Array.Empty<string>(), 0);
T I<T>() where T : IParsable<T>
{
while (_iter >= _input.Length) (_input, _iter) = (Console.ReadLine()!.Trim().Split(' '), 0);
return T.Parse(_input[_iter++], null);
}
#endregion
var s = I<string>();
var e = I<string>();
var n = I<int>();
if (n == 1)
{
if (s == e)
{
Console.WriteLine(s);
return;
}
Console.WriteLine(-1);
return;
}
var ans = new List<char>(){ s[0] };
while (ans.Count < n - 1) ans.Add('a');
ans.Add(e[0]);
Console.WriteLine(new string([..ans]));