1124 Raffle for Weibo Followers (20 分)【难度: 简单 / 知识点: 模拟】
2023-09-11 14:15:52 时间
https://pintia.cn/problem-sets/994805342720868352/problems/994805350803292160
#include<bits/stdc++.h>
using namespace std;
const int N=1e3+10;
int n,k,st;
string s[N];
map<string,int>mp;
int main(void)
{
cin>>n>>k>>st;
for(int i=1;i<=n;i++) cin>>s[i];
bool flag=0;
for(int i=st;i<=n;i+=k)
{
if(!mp[s[i]]) cout<<s[i]<<endl,mp[s[i]]++,flag=1;
else
{
while(i<=n&&mp[s[i]]) i++;
if(i<=n) cout<<s[i]<<endl,mp[s[i]]++,flag=1;
}
}
if(!flag) puts("Keep going...");
return 0;
}
相关文章
- python爬虫知识点总结(十一)使用Selenium模拟浏览器抓取淘宝商品美食信息
- 关于rman duplicate 一些比較重要的知识点--系列三
- 1111 Online Map (30 分)【难度: 一般 / 知识点: Dijkstra最短路】
- 1100 Mars Numbers (20 分)【难度: 一般 / 知识点: 模拟】
- 1097 Deduplication on a Linked List (25 分)【难度: 一般 / 知识点: 链表 模拟】
- 1089 Insert or Merge (25 分)【难度: 一般 / 知识点: 模拟】
- 1140 Look-and-say Sequence (20 分)【难度: 一般 / 知识点: 模拟】
- 1128 N Queens Puzzle (20 分)【难度: 一般 / 知识点: 模拟】
- 1119 Pre- and Post-order Traversals (30 分)【难度: 难 / 知识点: 树的构建】
- 1061 Dating (20 分)【难度: 一般 / 知识点: 模拟】
- 1060 Are They Equal (25 分)【难度: 一般 / 知识点: 模拟 字符串处理】
- 1047 Student List for Course (25 分)【难度: 简单 / 知识点: 模拟】
- 1045 Favorite Color Stripe (30 分)【难度: 中 / 知识点: DP】
- 1026 Table Tennis (30 分) 未完成【难度: 难 / 知识点: 模拟】
- 1011 World Cup Betting (20 分)【难度: 简单 / 知识点: 模拟】
- 1009 Product of Polynomials (25 分)【难度: 简单 / 知识点: 模拟】
- 1008 Elevator (20 分)【难度: 简单 / 知识点: 模拟】
- 关于Android的Service知识点,你知道吗?
- 转 php 前端知识点
- node的小知识点
- 带你熟知c#基础知识点--思维导图
- 【计算机二级Python】易忘知识点总结
- 读metronic文档学到的几个知识点