PAT 1124. Raffle for Weibo Followers (20) 模拟微博抽奖,Set应用
2018-01-26 00:41
525 查看
/************************* 题意: 微博,跳跃式的获奖 注意一个人只能获得一次 ************************/ /*********************** 解题思路: *************************/ /*********************** *********************/ #include<iostream> #include<stdio.h> #include<string> #include<vector> #include<queue> #include<stdlib.h> #include<algorithm> #include<string.h> #include<stack> #include<map> #include<set> #include<unordered_map> using namespace std; #define M 10005 #define INF 0x7ffffff string s[M]; set<string> Set; int main(){ int n,k, first, i ; cin>>n>>k>>first; for(i=0;i<n;i++){ cin>>s[i]; } int p ; if(first > n) cout<<"Keep going..."<<endl; else{ p = first - 1; while(p < n){ if(Set.find(s[p]) == Set.end()){ cout<<s[p]<<endl; Set.insert(s[p]); p += k; }else p++; } } return 0; }
相关文章推荐
- 1124. Raffle for Weibo Followers (20) PAT 甲级&&1069. 微博转发抽奖(20) PAT乙级
- PAT甲题题解-1124. Raffle for Weibo Followers-模拟,水题
- 【PAT】【Advanced Level】1124. Raffle for Weibo Followers (20)
- PAT (Advanced Level) 1124. Raffle for Weibo Followers (20) 解题报告
- PAT 1124. Raffle for Weibo Followers (20)
- PAT_A 1124. Raffle for Weibo Followers (20)
- PAT (Advanced Level)1124. Raffle for Weibo Followers (20)
- PAT:1124. Raffle for Weibo Followers (20)
- PAT (Advanced Level) Practise 1124 Raffle for Weibo Followers (20)
- PAT 甲级 1124. Raffle for Weibo Followers (20)
- 1124. Raffle for Weibo Followers (20) 模拟
- PAT甲级 1124. Raffle for Weibo Followers (20)
- PAT - 甲级 - 1124. Raffle for Weibo Followers (20)
- 1124. Raffle for Weibo Followers (20)
- pat 1124. Raffle for Weibo Followers
- PAT--1124. Raffle for Weibo Followers
- 1124. Raffle for Weibo Followers (20)
- 1124. Raffle for Weibo Followers (20)
- 1124. Raffle for Weibo Followers (20)
- PAT甲级 1124 - Raffle for Weibo Followers