1112. Stucked Keyboard (20)

1112. Stucked Keyboard (20)

思路:只要满足连续相同字符个数不是k的整数倍,那么一定是好键

#include <bits/stdc++.h>
using namespace std;
bool isWell[178],isprt[178];
int k,i;
char keys[1024];
string poskeys,ans;
int main()
{
    scanf("%d%s",&k,keys);
    while(keys[i])
    {
        int j=i+1;
        while(keys[j]==keys[i]) ++j;
        if((j-i)%k) isWell[keys[i]-'\0']=1;
        i=j;
    }
    i=0;
    while(keys[i])
    {
        int w=keys[i];
        ans+=w;
        if(isWell[w]) ++i;
        else
        {
            if(!isprt[w]) poskeys+=w,isprt[w]=1;
            i+=k;
        }
    }
    cout<<poskeys<<endl<<ans<<endl;
    return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
File&Image.Uploader.v.6.5.8.Portable.Registered-by-THE-MASTER-13 利用免费空间来分享档案是非常普遍的事情,有时候为了避免档案被删除,常常会将档案上传到多个免费空间存放分散风险,但是每上传到一个免费空间就要 做一次上传的操作会花掉你不少时间,透过「File&Image Uploader」就自动帮你将档案上传到百余个免费空间,而且只要操作一次就可以! 「File&Image Uploader」这款免费空间档案上传工具可以帮你节省繁琐的上传步骤,将上传的档案选取后,选取要使用的免费空间,就会自动完成上传,而且还会提供各个免空的档案下载网址。 软件名称:File&Image Uploader 软件版本:6.1.2 软件语系:多国语言(含正体中文) 官方网站:http://z-o-o-m.eu/ 6.5.8 [30.07.2013] [+] rapidstation.com + account, upshared.com + account [+] zenfiles.biz + account, videofox.net + account[*] ultramegabit.com, jheberg.net [+] FUNCTION: simple search in history [+] EXPERIMENTAL: you can force stop stucked upload (just press stop button 20 seconds after first stop)[*] small updates The most comprehensive and the best program of its kind Supports more than 250 servers (Czech and international) Possibility to use premium accounts Possibility of parallel uploading Usually much faster then uploading via browser or original file-upload tool No ads*, easy to use, multi-language environment Technical assistance (possibility to add functions, servers at the request) Don't forget to read help Please, report all suggestions and bugs! (in program use Help -> Bug & suggestion report) I will gladly accept all opinions and I'll try to make changes. I will accept any help (eg. translations) Development is still in progress, so DO NOT try to use it other way than it is supposed to You can spread program only if you add this whole text!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值