結果
| 問題 |
No.3114 0→1
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-19 22:48:20 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 539 bytes |
| コンパイル時間 | 13,110 ms |
| コンパイル使用メモリ | 171,304 KB |
| 実行使用メモリ | 191,172 KB |
| 最終ジャッジ日時 | 2025-04-19 22:48:40 |
| 合計ジャッジ時間 | 17,460 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 30 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (121 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System.Text.RegularExpressions;
int n = int.Parse(Console.ReadLine());
string instr = Console.ReadLine();
int count = 0;
if (Regex.IsMatch(instr, @"000"))
{
count += Regex.Matches(instr, @"000").Count * 2;
instr = Regex.Replace(instr, @"000", "101");
}
if (Regex.IsMatch(instr, @"010"))
{
count += Regex.Matches(instr, @"010").Count;
instr = Regex.Replace(instr, @"010", "011");
}
if (Regex.IsMatch(instr, @"00"))
{
count += Regex.Matches(instr, @"00").Count;
instr = Regex.Replace(instr, @"00", "01");
}