QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#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;
}
Details
Tip: Click on the bar to expand more detailed information
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