結果

問題 No.3497 Sign up for traP
コンテスト
ユーザー pengin_2000
提出日時 2026-04-18 23:49:56
言語 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  
実行時間 0 ms / 2,000 ms
+ 997µs
コード長 590 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 79 ms
コンパイル使用メモリ 39,104 KB
実行使用メモリ 9,844 KB
最終ジャッジ日時 2026-10-15 08:05:16
合計ジャッジ時間 2,180 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<stdio.h>
int main()
{
	char s[102];
	scanf("%s", s);
	int n;
	for (n = 0; s[n] != '\0'; n++);
	if (n < 1 || 32 < n)
	{
		printf("400\n");
		return 0;
	}
	int i;
	for (i = 0; i < n; i++)
	{
		if ('A' <= s[i] && s[i] <= 'Z')
			continue;
		if ('a' <= s[i] && s[i] <= 'z')
			continue;
		if ('0' <= s[i] && s[i] <= '9')
			continue;
		if (s[i] == '_' || s[i] == '-')
			continue;
		printf("400\n");
		return 0;
	}
	if (s[0] == '_' || s[0] == '-')
	{
		printf("400\n");
		return 0;
	}
	if(s[n-1]=='_' || s[n-1]=='-')
	{ 
		printf("400\n");
		return 0;
	}
	printf("200\n");
	return 0;
}
0