首页 > 学院 > 开发设计 > 正文

1124. Raffle for Weibo Followers (20)

2019-11-06 07:29:32
字体:
来源:转载
供稿:网友

题目很简单,只是考的时候想的太多

#include<iostream>#include<vector>#include<string>#include<map>using namespace std;int main(){ vector<string> all; map<string, int> f; int M, N, S; cin >> M >> N >> S; all.resize(M); for (int t = 0;t < M;t++) cin >> all[t]; if (S > M) { PRintf("Keep going.../n"); return 0; }//没有的情况 int t = S-1;//开始点 while (t < M) { if (f[all[t]] != 1)//未出现过处理 { f[all[t]] = 1; cout << all[t] << endl; t += N; } else//已出现过处理 t++; }}
上一篇:BZOJ 1116 并查集

下一篇:回环变位

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表