結果

問題 No.3497 Sign up for traP
コンテスト
ユーザー Haruka
提出日時 2026-04-18 17:18:31
言語 C#
(.NET 10.0.201)
コンパイル:
dotnet_c
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 697 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 11,922 ms
コンパイル使用メモリ 172,268 KB
実行使用メモリ 193,772 KB
最終ジャッジ日時 2026-04-18 17:18:55
合計ジャッジ時間 12,209 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (135 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

using System.Text.RegularExpressions;

public class CTF{
    public static void Main()
    {
        var input = Console.ReadLine();
        
        System.Console.WriteLine(Validate(input));
    }
    
    private static int Validate(string input)
    {
        var length = input.Length;
        if (length >= 1 && length <= 32)
        {
            if (Regex.IsMatch(input, @"^[0-9a-zA-Z_\-]+$"))
            {
                var start = input[0];
                var end = input[length - 1];
                if (end != '_' && end != '-' && start != '_' && start != '-') 
                {
                    return 200;
                }
            }
        }
        return 400;
    }
}
0