結果
| 問題 |
No.380 悪の台本
|
| コンテスト | |
| ユーザー |
not_522
|
| 提出日時 | 2016-12-16 02:07:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,306 bytes |
| コンパイル時間 | 2,047 ms |
| コンパイル使用メモリ | 182,796 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-06 23:19:01 |
| 合計ジャッジ時間 | 3,592 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 2 WA * 1 RE * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
struct Initializer {
Initializer() {
cin.tie(0);
ios::sync_with_stdio(0);
cout << fixed << setprecision(15);
}
} initializer;
int main() {
map<string, string> m;
m["digi"] = "nyo";
m["petit"] = "nyu";
m["gema"] = "gema";
m["piyo"] = "pyo";
string line, name;
while (getline(cin, line)) {
stringstream ss(line);
ss >> name;
if (line == name || !isalpha(line[0])) {
cout << "WRONG!" << endl;
continue;
}
line = line.substr(name.size() + 1);
if (name == "rabi") {
if (find_if(line.begin(), line.end(), [](char c){return !isalnum(c);}) != line.end()) {
cout << "WRONG!" << endl;
} else {
cout << "CORRECT (maybe)" << endl;
}
} else {
if (!m.count(name)) {
cout << "WRONG!" << endl;
continue;
}
for (char& c : line) c = tolower(c);
reverse(line.begin(), line.end());
int cnt = find_if(line.begin(), line.end(), [](char c){return isalnum(c);}) - line.begin();
reverse(line.begin(), line.end());
if (cnt <= 3 && m[name] == line.substr(line.size() - cnt - m[name].size(), m[name].size())) {
cout << "CORRECT (maybe)" << endl;
} else {
cout << "WRONG!" << endl;
}
}
}
}
not_522