Round 1A 2020 - Code Jam 2020】的更多相关文章

Problem A. Pattern Matching 把每个字符串分成第一个之前,最后一个之后,中间的部分 三个部分 每个字符串的中间的部分可以直接拼接 前后两个部分需要判断下是否合法 #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstring> #include <…
题意 你初始位于\((0,0)\),然后你想要到\((x,y)\)去,第\(i\)步的步长是\(2^{i-1}\),要求用最少的步数走到\((x,y)\). 解题思路 首先可以推出,走\(i\)步可以走到一个正方形范围内横纵坐标之和为奇数的所有点. 如,走3步可以走到所有红色直线围成的正方形内横纵坐标之和为奇数的点. 这样,我们就可以直接算出是否可达以及若可达最少步数是多少. 然后考虑从最后一步开始从\((x,y)\)往\((0,0)\)走,枚举4个方向,向这个方向走了这一步之后到达的点的最少步…
题意 给你一个形如\(1,2,\cdots,R,1,2,\cdots,R,1\cdots\)的序列,共重复\(C\)次.你每次可以选择一个区间\([L,R]\)将其平移到序列首部,最终使得序列具有\([1,1,\cdots,1,2,2,\cdots,2,\cdots,R,R,\cdots,R]\)的形式.问最少需要多少次,并输出具体步骤. 解题思路 比赛的时候只来得及写前两道,这道题是赛后看dls录播后补的.啥都不说了,dlstxdy! 对于相邻且相同的元素,我们就把他合并成\(1\)个元素,要…
总结 这一题是道交互题,平时写的不多,没啥调试经验,GYM上遇到了少说交个十几发.一开始很快的想出了恰烂分的方法,但是没有着急写,果然很快就又把Test Set3的方法想到了,但是想到归想到,调了快一个多小时调不出来,一直拖到了结尾才调好,然后一个常量忘记初始化导致第三个点还RE了,幸好凭着烂分还是苟进下一轮了. 题意 在一个\(2e9 * 2e9\)的平面中,有一个圆,圆的圆心位于整数点,圆的半径\(R\)是整数且\(10^9/2 \leq R \leq 10^9\).你每次可以询问一个点,判…
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…
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…
Google Code Jam 2010 Round 1C Problem A. Rope Intranet https://code.google.com/codejam/contest/619102/dashboard#s=p0 Problem A. Rope Intranet A company is located in two very tall buildings. The company intranet connecting the buildings consists of m…
2020. Traffic Jam in Flower Town Time limit: 1.0 secondMemory limit: 64 MB Having returned from Sun City, Dunno told all his friends that every shorty may have a personal automobile. Immediately after that so many citizens took a fancy of becoming ro…
https://code.google.com/codejam/contest/619102/dashboard#s=p1&a=1 Problem Now that you have won Code Jam and been hired by Google as a software engineer, you have been assigned to work on their wildly popular programming contest website. Google is ex…