华南理工大学2013年acm选拔赛第一场

SCUT_ACM集训队新生选拔赛
a7105
第一场
Problem List
Problem 2(橙)
Problem B Chaos’3(灰)
Problem 5(紫)
Problem .6(白)
Problem E OSU!........................7(青)
Problem F Super prime ...............10(金)
Problem 11(蓝)
Problem H Sutao 12(红)
Problem I 14(绿)
Problem J 15(黄)
Problem A Replace
Time Limit 1000ms
Description俄罗斯人
对于一个01字符串,做如下定义: 如果该串包含奇数个1,则说明它是不平等串,如果包含偶数个1个,则说明它是平等串。现在已知一个01字符串S,它的最后一位被替换掉了,如果S是平等串,则末位将被’f’替换,否则将被’u’替换,现在给你一个被替换过的串,你要做的是出原串并输出
Input
输入包含多组数据,以”#”结束
每组数据包含一个被替换过的01字符串,串的长度不超过1000
Output
对于每组数据,输出原串
Sample Input
田晓菲101f
010010u
报道性摘要
1f定西日报电子版
000f
110100101u
#
Sample Output
1010
0100101
11
0000
1101001010
Problem B Chaos’ trouble
Time Limit 5000ms
Description
众所周知Chaos是个大学霸,他每次考试都是满分,对此Chaos感到很无聊。这天他在纸上写了n个数字,然后想:我能不能考出这些分数呢?假设Chaos初始时可以考到的分数是m分,他第 i 次考试最多能进步max( k−i , 0)分( i 从1开始)。因为Chaos 是个学霸,他总能控制他考到的分数x,只要x不超过他所能考到的分数上限。
即假设他第i次考得的分数是 X i,则有0≤X i≤X i−1+max (k−i,0)。Chaos可以考无数次试。
现在给你Chaos写下的n个分数,请你判断这些分数Chaos是否全部有可能考到。(不要求按顺序)
都说了Chaos每次考试都是满分,那么他是怎么能够再进步呢?Chaos对此表示,作为一个学霸,他是无所不能的。
Input
输入包含多组数据
对于每组数据,第一行包括三个整数n,m和k(0≤n,m,k≤106)
第二行包括n个整数 a i(0≤a i≤1014),代表Chaos想要考到的分数。
Output
对于每组数据,如果Chaos能考到全部他想要考出的分数,输出“Yes”,否则输出“Impossible”,不包括引号
Sample Input
5 100 10
63 59 140 30 3
5 0 1
1 2 3 4 1000000000000
Sample Output
Yes
Impossible
Problem C Select
Time Limit 2000ms
Description
You are given a string A and a string B of the same length, less than 1000.
In one turn you can select any character of A and move it to the beginning of the string (i.e., before the first character of A).
Output the minimal number of turns needed to transform A into B. If it's impossible, output -1 instead.
Input
The first line of input contains an integer T, indicates the cases.
Next T lines each contains 2 strings A and B that contain only lowercase letters
Output彭佳屿
Output T lines each contains the answer required.
Sample Input
3
abc cba
a b
aaabbb bbbaaa
Sample Output
2
-1
3

本文发布于:2024-09-22 14:39:33,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/471082.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:分数   考到   数据   包含   字符串   想要
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议