Note: To advance to the next rounds, you will need to score 25 points. Solving just this problem will not give you enough points. Problem Recently you went to a magic show. You were very impressed by one of the tricks, so you decided to try to figure…
Problem A. Magic Trick Small input6 points You have solved this input set.   Note: To advance to the next rounds, you will need to score 25 points. Solving just this problem will not give you enough points. Problem Recently you went to a magic show.…
Introduction Cookie Clicker is a Javascript game by Orteil, where players click on a picture of a giant cookie. Clicking on the giant cookie gives them cookies. They can spend those cookies to buy buildings. Those buildings help them get even more co…
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…
Google Code Jam 2008 资格赛的第一题:Saving the Universe. 问题描述如下: Problem The urban legend goes that if you go to the Google homepage and search for "Google", the universe will implode. We have a secret to share... It is true! Please don't try it, or te…
Problem B. Cookie Clicker Alpha   Introduction Cookie Clicker is a Javascript game by Orteil, where players click on a picture of a giant cookie. Clicking on the giant cookie gives them cookies. They can spend those cookies to buy buildings. Those bu…
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…
This problem is the hardest problem to understand in this round. If you are new to Code Jam, you should probably try to solve the other problems first. Problem Naomi and Ken sometimes play games together. Before they play, each of them gets Nidentica…
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…
本题的 Large dataset 本人尚未解决. https://code.google.com/codejam/contest/90101/dashboard#s=p2 Problem So you've registered. We sent you a welcoming email, to welcome you to code jam. But it's possible that you still don't feel welcomed to code jam. That's w…
Problem A permutation of size N is a sequence of N numbers, each between 0 and N-1, where each number appears exactly once. They may appear in any order. There are many (N factorial, to be precise, but it doesn't matter in this problem) permutations…
二,RoundC import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStreamReader; import java.io.PrintStream; import java.util.ArrayList; import java.util.…
二,RoundC import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStreamReader; import java.io.PrintStream; import java.util.ArrayList; import java.util.…
拿下 ABD, 顺利晋级, 预赛的时候C没有仔细想,推荐C题,一个非常不错的构造题目! A Magic Trick 简单的题目来取得集合的交并 1: #include <iostream> 2: #include <algorithm> 3: #include <set> 4: #include <vector> 5: using namespace std; 6: int main() 7: { 8: freopen("A-small-attem…
为了熟悉一下code jam的平台,今天简单试了一下,做了一下Qualification Round Africa 2010的三道题目,都是很基础的. A题:给一个数n和一系列数a[],从a[]中找出两个数的和等于n,输出这两个数的下标. #include <cstdio> #define MAXN 2010 int p[MAXN]; int main() { #ifdef LOCAL freopen("A-large-practice.in", "r"…
Problem Minesweeper is a computer game that became popular in the 1980s, and is still included in some versions of the Microsoft Windows operating system. This problem has a similar idea, but it does not assume you have played Minesweeper. In this pr…
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…
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…
https://code.google.com/codejam/contest/3274486/dashboard Problem The kitchen at the Infinite House of Pancakes has just received an order for a stack of K pancakes! The chef currently has N pancakes available, where N ≥ K. Each pancake is a cylinder…
https://code.google.com/codejam/contest/90101/dashboard#s=p1 Problem Geologists sometimes divide an area of land into different regions based on where rainfall flows down to. These regions are called drainage basins. Given an elevation map (a 2-dimen…
https://code.google.com/codejam/contest/90101/dashboard#s=p0 Problem After years of study, scientists at Google Labs have discovered an alien language transmitted from a faraway planet. The alien language is very unique in that every word consists of…
Problem You are waiting in a long line to get a haircut at a trendy barber shop. The shop has B barbers on duty, and they are numbered 1 through B. It always takes the kth barber exactly Mk minutes to cut a customer's hair, and a barber can only cut…
题目链接:https://code.google.com/codejam/contest/11254486/dashboard#s=p2 大意是教授的学生每个人在纸条上写一个自己的topic,每个topic由两个单词组成,那么纸上留下了若干个topic.topic分为 "faked" 或者 "un-faked",所谓faked意思就是其实这个topic的第一个和第二个单词都是随便由之前纸上已经有的topic来构成的,当然,不能是由原来的同一个topic组成,这样就重…
Problem Shota the farmer has a problem. He has just moved into his newly built farmhouse, but it turns out that the outlets haven't been configured correctly for all of his devices. Being a modern farmer, Shota owns a large number of smartphones and…
Problem You're about to play a simplified "battleship" game with your little brother. The board for this game is a rectangular grid with R rows and C columns. At the start of the game, you will close your eyes, and you will keep them closed unti…