結果

問題 No.3497 Sign up for traP
コンテスト
ユーザー gojoxd
提出日時 2026-04-18 14:45:06
言語 C
(gcc 15.3.0)
コンパイル:
gcc-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 107µs
コード長 709 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 90 ms
コンパイル使用メモリ 39,360 KB
実行使用メモリ 9,788 KB
最終ジャッジ日時 2026-10-15 08:04:23
合計ジャッジ時間 1,857 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main() {
    char S[105];
    scanf("%s", S);

    int len = strlen(S);

    // Condition 1: Length check
    if (len < 1 || len > 32) {
        printf("400\n");
        return 0;
    }

    // Condition 3: First and last character check
    if (S[0] == '_' || S[0] == '-' || S[len - 1] == '_' || S[len - 1] == '-') {
        printf("400\n");
        return 0;
    }

    // Condition 2: Allowed characters check
    for (int i = 0; i < len; i++) {
        if (!(isalnum(S[i]) || S[i] == '_' || S[i] == '-')) {
            printf("400\n");
            return 0;
        }
    }

    // If all conditions pass
    printf("200\n");

    return 0;
}
0