题目链接:https://code.google.com/codejam/contest/11254486/dashboard#s=p2 大意是教授的学生每个人在纸条上写一个自己的topic,每个topic由两个单词组成,那么纸上留下了若干个topic.topic分为 "faked" 或者 "un-faked",所谓faked意思就是其实这个topic的第一个和第二个单词都是随便由之前纸上已经有的topic来构成的,当然,不能是由原来的同一个topic组成,这样就重…
https://code.google.com/codejam/contest/635101/dashboard#s=p1   Problem A flock of chickens are running east along a straight, narrow road. Each one is running with its own constant speed. Whenever a chick catches up to the one in front of it, it has…
https://code.google.com/codejam/contest/635101/dashboard#s=p0   Problem On Unix computers, data is stored in directories. There is one root directory, and this might have several directories contained inside of it, each with different names. These di…
题意:给出两个数字位数相同,分别中间有若干位不知道,用问号表示.现在要求补全这两个数字,使得差值的绝对值最小,多解则取第一个数字的值最小的,再多解就取第二个数字最小的. 分析: 类似数位dp,但是很多状态可以直接得出最终解,个别状态需要状态转移. 我们从高位到低位依次确定两个数的每个位是几.一旦确定了两个数的一个位不一样,则可以立即将小的一方的后续问号全部写9,大的一方后续问号全部写0.这样才能让差值最小. 那我们观察每个位的时候要如何确定其值呢?分如下几种情况. 1.两个数的该位都是问号,那么…
二进制数位DP,涉及到数字的按位与操作. 查看官方解题报告 #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; #define MAX_LEN 50 long long A, B, K; int a[MAX_LEN], b[MAX_LEN], k[MAX_LEN]; ][][]; void input() { scan…
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…
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…
Problem B. Infinite House of Pancakes Problem's Link:   https://code.google.com/codejam/contest/6224486/dashboard#s=p1 Mean: 有无限多个盘子,其中有n个盘子里面放有饼,每分钟你可以选择两种操作中的一种: 1.n个盘子里面的饼同时减少1: 2.选择一个盘子里面的饼,分到其他盘子里面去: 目标是让盘子里的饼在最少的分钟数内吃完,问最少的分钟数. analyse: 可以分析出,先…
Problem A. Standing Ovation Problem's Link:   https://code.google.com/codejam/contest/6224486/dashboard#s=p0 Mean: 题目说的是有许多观众,每个观众有一定的羞涩值,只有现场站起来鼓掌的人数达到该值才会站起来鼓掌,问最少添加多少羞涩值任意的人,才能使所有人都站起来鼓掌. analyse: 贪心模拟一下,从前往后扫一遍就行. Time complexity: O(n) Source cod…
https://code.google.com/codejam/contest/544101/dashboard#s=p0     Problem In the exciting game of Join-K, red and blue pieces are dropped into an N-by-N table. The table stands up vertically so that pieces drop down to the bottom-most empty slots in…