結果

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

ソースコード

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