GCJ Qualification Round 2016 C题】的更多相关文章

这题就是找规律.小数据还是挺容易想的.大数据得再深入分析一下. 题意挺绕的. 其实就是字符串转换.字符串只能有两种字母,L或G.给定K和C,就能通过规则生成目标字符串. 那么,如果知道了K和C,以及目标字符串,那么是能够倒推出原字符串的. 现在问题是,目标字符串也不全给你看,限定你最多看s个.但是呢,也不要求你完全倒推出原字符串,而是只需要知道原字符串里是不是至少有一个G字符即可. 小数据极其简单,为什么呢,因为S=K,而看S个目标串字符完全可以倒推出原字符串啊. 因为原串的第1个字符,会在目标…
题意是给定了一个叫“jamcoin”的定义,让你生成足够数量满足条件的jamcoin. jamcoin其实就可以理解成一个二进制整数,题目要求的要么长度为16位,要么为32位,一头一尾两个位必须是1,然后就是这个数字串在各种进制下表示的数都不能是质数. 我的做法很简单,因为大致口算了一下,满足条件的jamcoin应该挺多的,随便找50个或500个就好了.就从最小的串开始检查,找到一个就输出一个,直到找到要求的个数为止. 检查的方法也很简单,就是把这个串表示的数用素数表去除,能找到整数这个数的,就…
经典的翻饼问题,直接做:从下往上看,已翻好的饼忽略掉:从上往下,连续的已翻好的一起翻过来:整个翻过来. /* * Author : ben */ #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> #include <iostream> #include <algorithm> #include…
Facebook Hacker Cup 2014 Qualification Round比赛Square Detector题的解题报告.单击这里打开题目链接(国内访问需要那个,你懂的). 原题如下: Square Detector Problem Description You want to write an image detection system that is able to recognize different geometric shapes. In the first ver…
2014 Qualification Round Solutions 2013年11月25日下午 1:34 ...最简单的一题又有bug...自以为是真是很厉害! 1. Square Detector (20 Points) When facing a problem in a programming contest there are three main things to consider when planning your solution. In order of importanc…
Google Code Jam Qualification Round Africa 2010 的第一题,很简单. Problem You receive a credit C at a local store and would like to buy two items. You first walk through the store and create a list L of all available items. From this list you would like to b…
题目地址:http://blog.csdn.net/shiyuankongbu/article/details/10004443 /* 题意:在i前面找回文子串,在i后面找回文子串相互配对,问有几对 DP:很巧妙的从i出发向两头扩展判断是否相同来找回文串 dpr[i] 代表记录从0到i间的回文子串的个数,dpl[i] 代表记录i之后的回文子串个数 两两相乘就行了 详细解释:http://blog.csdn.net/shiyuankongbu/article/details/10004443 */…
Google Code Jam Africa 2010 Qualification Round Problem B. Reverse Words https://code.google.com/codejam/contest/351101/dashboard#s=p1 Problem Given a list of space separated words, reverse the order of the words. Each line of text contains L letters…
Google Code Jam Qualification Round Africa 2010 Problem A. Store Credit https://code.google.com/codejam/contest/351101/dashboard#s=p0 Problem You receive a credit C at a local store and would like to buy two items. You first walk through the store an…
A. Home Numbers 题目连接: http://www.codeforces.com/contest/638/problem/A Description The main street of Berland is a straight line with n houses built along it (n is an even number). The houses are located at both sides of the street. The houses with od…