@[weah964](/user/1036180) 把 `get` 改成 `gett`。
by wzj0829 @ 2024-04-16 18:17:51
@[weah964](/user/1036180) 改完是可以 AC 的。
by wzj0829 @ 2024-04-16 18:18:36
@[wzj0829](/user/1028403)
感谢,已过,是变量名和其他系统名冲突了吗?
by weah964 @ 2024-04-16 18:20:17
@[weah964](/user/1036180) 额这个嘛说实话我也布吉岛诶()不过应该是()
by wzj0829 @ 2024-04-16 18:21:00
@[weah964](/user/1036180) get是个函数。
https://c.biancheng.net/view/1534.html
by Robots75 @ 2024-04-16 18:27:43
@[weah964](/user/1036180) get是个输入函数(,不过一般用不到get进行输入
by yutong_Seafloor @ 2024-04-16 18:53:58
```
#include <bits/stdc++.h>
using namespace std;
int n, m, ans1, ans2, l = 1;
string s[100001];
map <string, bool> dic;
map <string, int> gett;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> s[0];
dic.insert(make_pair(s[0], true));
}
cin >> m;
for (int i = 1; i <= m; i++) {
cin >> s[i];
if (dic[s[i]])
gett[s[i]]++;
if (gett[s[i]] == 1)
ans1++, ans2 = i - l + 1;
while (l <= i)
if (!dic[s[l]])
l++;
else if (gett[s[l]] > 1)
gett[s[l++]]--;
else
break;
ans2 = min(ans2, i - l + 1);
}
cout << ans1 << '\n' << ans2;
return 0;
}
```
试试
by philip2011 @ 2024-04-16 18:56:05
@[philip2011](/user/620456)
六,我前面回复某人时已经说了`已过`
by weah964 @ 2024-04-16 21:00:23