PAT甲1124 简单模拟

题目链接

代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include<iostream>
#include<set>
using namespace std;
const int maxn=1004;
string s[maxn];
string ans[maxn];
set<string> st;
int main()
{
int m,n,k;
cin>>m>>n>>k;
for(int i=1;i<=m;i++)
cin>>s[i];
if(k>m)
{
cout<<"Keep going...";
}
else
{
int i=k;
while(i<=m)
{
string name=s[i];
if(st.find(s[i])!=st.end())
i++;
else
{
cout<<s[i]<<endl;
st.insert(s[i]);
i+=n;
}
}
}
return 0;
}
-------------本文结束感谢您这么好看还看我的文章-------------