QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#189435 | #6768. Nihongo wa Muzukashii Desu | ucup-team004 | AC ✓ | 1ms | 3468kb | C++20 | 1.2kb | 2023-09-27 15:00:08 | 2023-09-27 15:00:08 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
void solve() {
std::string s;
std::cin >> s;
int n = s.size();
if (n >= 7 && s.substr(n - 7) == "chimasu") {
s = s.substr(0, n - 7) + "tte";
} else if (n >= 6 && s.substr(n - 6) == "rimasu") {
s = s.substr(0, n - 6) + "tte";
} else if (n >= 6 && s.substr(n - 6) == "mimasu") {
s = s.substr(0, n - 6) + "nde";
} else if (n >= 6 && s.substr(n - 6) == "bimasu") {
s = s.substr(0, n - 6) + "nde";
} else if (n >= 6 && s.substr(n - 6) == "nimasu") {
s = s.substr(0, n - 6) + "nde";
} else if (n >= 6 && s.substr(n - 6) == "kimasu") {
if (s == "ikimasu") {
s = "itte";
} else {
s = s.substr(0, n - 6) + "ite";
}
} else if (n >= 6 && s.substr(n - 6) == "gimasu") {
s = s.substr(0, n - 6) + "ide";
} else if (n >= 7 && s.substr(n - 7) == "shimasu") {
s = s.substr(0, n - 7) + "shite";
} else {
assert(false);
}
std::cout << s << "\n";
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3468kb
input:
10 machimasu kaerimasu nomimasu yobimasu shinimasu kakimasu ikimasu kikimasu isogimasu kashimasu
output:
matte kaette nonde yonde shinde kaite itte kiite isoide kashite
result:
wrong output format Extra information in the output file