QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#551492#3671. Email DestructionTEAM1_AUCA#WA 0ms3792kbC++23946b2024-09-07 17:06:532024-09-07 17:06:53

Judging History

This is the latest submission verdict.

  • [2024-09-07 17:06:53]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3792kb
  • [2024-09-07 17:06:53]
  • Submitted

answer

#include <bits/stdc++.h>

using namespace std;

#define forn(i, a, b) for (int i{a}; i < (b); ++i)
#define pb push_back
#define eb emplace_back

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;

void solve() {
    int n, k; cin >> n >> k >> ws;
    map<string, int> mn;
    string re = "Re: ";
    forn(_, 0, k) {
        string s;
        getline(cin, s);
        for (int i = 0; i < s.size(); ++i)
            if (s[i] != re[i % re.size()])
                mn[s.substr(i)] = max(mn[s.substr(i)], i / 4 + 1);
    }
    int res = 0;
    for (auto& [_, i] : mn)
        res += i;
    cerr << res << '\n';
    if (n >= res) {
        cout << "YES\n";
    } else {
        cout << "NO\n";
    }
}

signed main() {
    cin.tie(0)->sync_with_stdio(0);
    int t = 1;
//    cin >> t >> ws;
    while (t --> 0) {
        solve();
    }
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3792kb

input:

7 3
Re: Re: Re: hello
Re: world
hello

output:

NO

result:

wrong answer expected YES, found NO