首页 > TAG信息列表 > A1124
PAT A1124 Raffle for Weibo Followers [模拟+STL]
题目描述 链接 小明PAT考了满分,高兴之余决定发起微博转发抽奖活动,从转发的网友中按顺序每隔N个人就发出一个红包。请你编写程序帮助他确定中奖名单。注意:可能有人转发多次,但不能中奖多次。所以如果处于当前中奖位置的网友已经中过奖,则跳过他顺次取下一位。按照输入的顺序输出中奖PAT A1124~A1127
一、PAT A1124 Raffle for Weibo Followers 简单的模拟,细心一点就好啦。参考代码如下。 #include<iostream> #include<string> #include<unordered_map> using namespace std; unordered_map <string, bool> is_choose; int main() { int n, m, s; string name; cinPAT A1124 Raffle for Weibo Followers (20 分)
John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from every N followers who forwarded his post, and give away gifts. Now you are supposed to help him generate