結果
| 問題 |
No.539 インクリメント
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2018-01-21 20:03:23 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,147 bytes |
| コンパイル時間 | 2,630 ms |
| コンパイル使用メモリ | 104,448 KB |
| 実行使用メモリ | 95,392 KB |
| 最終ジャッジ日時 | 2024-12-25 21:48:47 |
| 合計ジャッジ時間 | 10,426 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 1 TLE * 2 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Text.RegularExpressions;
namespace y
{
class Program
{
static void Main(string[] args)
{
int t = int.Parse(Console.ReadLine());
string[] ans = new string[t];
for (int i = 0; i < t; i++)
{
string s = Console.ReadLine();
MatchCollection m = Regex.Matches(s, @"[0-9]+");
string a = "";
foreach (var v in m)
{
if (v.ToString().Length >= a.Length) a = v.ToString();
}
if (a.Length != 0)
{
string y = "";
for (int j = 0; j < a.Length; j++)
{
y += "0";
}
int h = s.LastIndexOf(a);
s = s.Remove(h, a.Length);
s = s.Insert(h, (int.Parse(a) + 1).ToString(y));
}
ans[i] = s;
}
foreach (var item in ans)
{
Console.WriteLine(item);
}
}
}
}
No