結果

問題 No.3497 Sign up for traP
コンテスト
ユーザー gojoxd
提出日時 2026-04-18 14:45:06
言語 C
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 709 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 499 ms
コンパイル使用メモリ 38,852 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-18 14:45:08
合計ジャッジ時間 1,602 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

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