QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#189435#6768. Nihongo wa Muzukashii Desuucup-team004AC ✓1ms3468kbC++201.2kb2023-09-27 15:00:082023-09-27 15:00:08

Judging History

你现在查看的是测评时间为 2023-09-27 15:00:08 的历史记录

  • [2023-09-27 15:25:21]
  • 管理员手动重测本题所有提交记录
  • 测评结果:AC
  • 用时:1ms
  • 内存:3528kb
  • [2023-09-27 15:00:08]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3468kb
  • [2023-09-27 15:00:08]
  • 提交

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