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 | 3528kb | C++20 | 1.2kb | 2023-09-27 15:00:08 | 2023-09-27 15:25:21 |
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: 100
Accepted
time: 1ms
memory: 3480kb
input:
10 machimasu kaerimasu nomimasu yobimasu shinimasu kakimasu ikimasu kikimasu isogimasu kashimasu
output:
matte kaette nonde yonde shinde kaite itte kiite isoide kashite
result:
ok 10 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
63 machimasu kaerimasu nomimasu yobimasu shinimasu kakimasu ikimasu isogimasu kashimasu hatarakimasu yasumimasu owarimasu yomimasu kikimasu torimasu okurimasu kirimasu karimasu arimasu kakarimasu asobimasu oyogimasu kawakimasu sukimasu mochimasu hanashimasu hurimasu hairimasu suwarimasu tachimasu ke...
output:
matte kaette nonde yonde shinde kaite itte isoide kashite hataraite yasunde owatte yonde kiite totte okutte kitte katte atte kakatte asonde oyoide kawaite suite motte hanashite hutte haitte suwatte tatte keshite shitte sunde omoikishite oite utte tsukutte notte oshite oroshite dashite kaeshite meide...
result:
ok 63 lines