社区讨论
#3WA求调 QwQ
P5587打字练习参与者 1已保存回复 0
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 0 条
- 当前快照
- 1 份
- 快照标识符
- @mhjq8vkg
- 此快照首次捕获于
- 2025/11/04 06:44 4 个月前
- 此快照最后确认于
- 2025/11/04 06:44 4 个月前
RT
CPP/* La Vaguelette */
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
char a[100005], b[100005];
int ai, bi;
int main()
{
#ifdef LOCAL
freopen("./in.txt", "rb", stdin);
freopen("./out.txt", "wb", stdout);
#endif
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
string x;
while (1)
{
getline(cin, x);
if (x == "EOF")
break;
int n = x.length();
for (int i = 0; i < n; ++i)
{
if (x[i] == '<')
{
if (ai != 0 && a[ai - 1] != '\n')
a[--ai] = 0;
}
else
a[ai++] = x[i];
}
a[ai++] = '\n';
}
while (1)
{
getline(cin, x);
if (x == "EOF")
break;
int n = x.length();
for (int i = 0; i < n; ++i)
{
if (x[i] == '<')
{
if (bi != 0 && b[bi - 1] != '\n')
b[--bi] = 0;
}
else
b[bi++] = x[i];
}
b[bi++] = '\n';
}
int cnt = 0, t;
cin >> t;
for (ai = 0, bi = 0; a[ai] && b[bi]; ++ai, ++bi)
{
while (a[ai] == '\n' && b[bi] != '\n')
++bi;
while (a[ai] != '\n' && b[bi] == '\n')
++ai;
if (a[ai] == '\n')
{
++ai;
++bi;
}
if (a[ai] && a[ai] != '\n' && a[ai] == b[bi])
++cnt;
}
printf("%.0f\n", cnt * 60.0 / t);
return 0;
}
回复
共 0 条回复,欢迎继续交流。
正在加载回复...