結果
| 問題 | No.3497 Sign up for traP |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-17 20:56:02 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 656 bytes |
| 記録 | |
| コンパイル時間 | 2,213 ms |
| コンパイル使用メモリ | 330,692 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-17 20:56:20 |
| 合計ジャッジ時間 | 3,590 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
static bool allowed(unsigned char c) {
if (isalnum(c)) return true;
return c == '_' || c == '-';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s;
if (!(cin >> s)) return 0;
if (s.size() < 1 || s.size() > 32) {
cout << "400\n";
return 0;
}
for (unsigned char c : s) {
if (!allowed(c)) {
cout << "400\n";
return 0;
}
}
if (s.front() == '_' || s.front() == '-' || s.back() == '_' || s.back() == '-') {
cout << "400\n";
return 0;
}
cout << "200\n";
return 0;
}