Start: Jul, 05, 2019 08:40:00
2019年度暑期短学期达标测试
End: Jul, 05, 2019 11:40:00
Time elapsed:
Time remaining:

Problem_ID: G
Result: Accepted
Time: 65ms
Memory: 1756kB
Author: CT12811551281
In contest: 1281

#include<iostream>
using namespace std;

int main()
{
	int sz[10010],k;
	while(scanf("%1d",&sz[1])!=EOF)
	{
		int sum=1;char c;
		while(scanf("%c",&c),c!=' ')
		{
			sum++;
			sz[sum]=c-'0';
		}
		scanf("%d",&k);
		int flag=0;int a[10010];
		for(int i=1;i<=sum-k;i++)
		{	
			int max=0;
			for(int j=flag+1;j<=k+i;j++)
			{
			
				if(sz[j]>max)
				{
					flag=j;
					max=sz[j];
				}
			}
			a[i]=max;
		}
		for(int i=1;i<=sum-k;i++)
			printf("%d",a[i]);
		printf("\n");
	}
}