結果
| 問題 | No.3497 Sign up for traP |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-17 20:56:02 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 402µs | |
| コード長 | 656 bytes |
| 記録 | |
| コンパイル時間 | 1,988 ms |
| コンパイル使用メモリ | 331,080 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-07 22:26:19 |
| 合計ジャッジ時間 | 3,769 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}