A. Candy Bagstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGerald has n younger brothers and their number happens to be even. One day he bought n2 candy bags. One bag has one candy, one bag has
A. Cakeminatortime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a rectangular cake, represented as an r × c grid. Each cell either has an evil strawberry, or is empty. For example, a 3
B. Eight Point Setstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise
A. Down the Hatch!time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEverybody knows that the Berland citizens are keen on health, especially students. Berland students are so tough that all they
B. Road Constructiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA country has n cities. Initially, there is no road in the country. One day, the king decides to construct some roads
快速冪乘用的是二分的思想a^b%c,當b比較大時可將其分解當b為偶數時,a^b%c=(a^(b/2)*a^(b/2))%c;當b為奇數時,a^b%c=(a^(b/2)*a^(b/2)*a)%cAOJ-569-乘的更快http://icpc.ahu.edu.cn/OJ/Problem.aspx?id=569赤裸裸的快速冪乘#include<stdio.h>#include<string.h>#include<stdlib.h>#define Mod 99991_
#include <cstring>#include <cstdio>#include <cstdlib>#include <algorithm>#include <iostream>//#define INPUTusing namespace std;/** Problem : poj1011 - Sticks Begin Time : 13:00 p.m. 15th/mar/2012 End Time : 15:1