QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#551492 | #3671. Email Destruction | TEAM1_AUCA# | WA | 0ms | 3792kb | C++23 | 946b | 2024-09-07 17:06:53 | 2024-09-07 17:06:53 |
Judging History
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