結果
| 問題 |
No.380 悪の台本
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-04-17 23:54:12 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,260 bytes |
| コンパイル時間 | 3,744 ms |
| コンパイル使用メモリ | 286,732 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-04-17 23:54:48 |
| 合計ジャッジ時間 | 3,836 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 2 WA * 6 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define NO { cout << "WRONG!\n"; continue; }
#define YES { cout << "CORRECT (maybe)\n"; continue; }
string st;
bool check(char c) {
return !isdigit(c) && !isalpha(c);
}
signed main() {
// ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
map<string, string> mp;
mp["digi"] = " nyo", mp["petit"] = " nyu", mp["gema"] = " gema", mp["piyo"] = " pyo";
while (getline(cin, st) && st != "") {
// cout << "st: \"" << st << "\"\n";
int pos = -1;
for (int i = (int)st.size() - 1; i >= 0; i -- )
if (st[i] == ' ') pos = i;
if (pos == -1) NO
string name = st.substr(0, pos);
string s = st.substr(pos + 1, (int)st.size() - pos);
int cnt = 0;
while (s.size() && check(s.back())) cnt ++ , s.pop_back();
if (cnt > 3) NO
// cout << "name: \"" << name << "\"\n";
// cout << "s: \"" << s << "\"\n";
if (name == "rabi") {
int cnt = 0;
for (auto i : s)
if (!check(i)) cnt = 1;
if (cnt) YES else NO
}
else if (mp.count(name)) {
for (auto& i : s) i = tolower(i);
for (auto& i : s)
if (check(i)) i = ' ';
if (s.size() >= mp[name].size() && s.substr((int)s.size() - mp[name].size(), mp[name].size()) == mp[name]) YES
else NO
}
else NO
}
return 0;
}
vjudge1