http://acdream.info/problem?pid=1006 #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> #define ll long long #define maxn 10000 #define mod 10000000007 using namespace std; double a,b; int t; int main() { sc…
ACdream 1214---矩阵连乘 Problem Description You might have noticed that there is the new fashion among rich people to have their yards tiled with black and white tiles, forming a pattern. The company Broken Tiles is well known as the best tiling company…
LCM Challenge Time Limit:1000MS Memory Limit:64000KB 64bit IO Format:%lld & %llu Submit Status Practice ACdream 1077 Description Some days ago, I learned the concept of LCM (least common multiple). I've played with it for several times and I…
A - A Very Easy Triangle Counting Game Time Limit:1000MS Memory Limit:64000KB 64bit IO Format:%lld & %llu Submit Status Practice ACdream 1008 Description Speedcell and Shoutmon love triangles very much.One day,they are playing a game named “T…
Bet Time Limit:1000MS Memory Limit:64000KB 64bit IO Format:%lld & %llu Submit Status Practice ACdream 1066 Description Josnch星球是一个赌博之风盛行的星球. 每个人一出生就有一定数额的钱,之后的所有收入只能由赌博获得(OMG,如果RP不好,输光了所有的钱...) 假设赌博公司的某场赌博有 N 个结果,每个结果能获得的赔率比分别是 a[1],a[2]...a[…
Read Phone Number Time Limit:1000MS Memory Limit:64000KB 64bit IO Format:%lld & %llu Submit Status Practice ACdream 1188 Description Do you know how to read the phone numbers in English? Now let me tell you. For example, In China, the phone n…
Sudoku Checker Time Limit:1000MS Memory Limit:64000KB 64bit IO Format:%lld & %llu Submit Status Practice ACdream 1195 Description Sudoku is a popular single player game. The objective is to fill a 9x9 matrix with digits so that each column, e…
Alice and Bob Time Limit:3000MS Memory Limit:128000KB 64bit IO Format:%lld & %llu Submit Status Practice ACdream 1112 Description Here is Alice and Bob again ! Alice and Bob are playing a game. There are several numbers. First, Alice choose…
题目链接:http://acdream.info/problem?pid=1157 Problem Description 由3钟类型操作:1)D L R(1 <= L <= R <= 1000000000) 增加一条线段[L,R]2)C i (1-base) 删除第i条增加的线段,保证每条插入线段最多插入一次,且这次删除操作一定合法3) Q L R(1 <= L <= R <= 1000000000) 查询目前存在的线段中有多少条线段完全包含[L,R]这个线段,线段X…
题目链接:http://acdream.info/problem?pid=1128 Problem Description wuyiqi陷入了一个迷宫中,这个迷宫是由N*M个格子组成的矩阵.每个格子上堆放了一定数量的箱子.(i,j)表示第i行,第j列的格子.wuyiqi可以将一个格子上的箱子移动到相邻的格子上,或者在这个格子上销毁.也就是在(i,j)的箱子可以移动到(i-1,j).(i+1,j).(i,j-1)和(i,j+1),但是不能移动到矩阵范围外.将(i,j)的格子上的一个箱子移动到相邻格…
http://acdream.info/problem?pid=1093 女神的正多面体 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 128000/64000 KB (Java/Others) SubmitStatistic Next Problem Problem Description EOF女神灰常喜欢整齐的东西,例如多面体中最喜欢的就是正多面体.正多面体的定义为:指每个面都是全等的正多边形的多面体.欧拉大人告诉我们,正多面体只…
小晴天老师系列——竖式乘法 Time Limit: 4000/2000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) Problem Description 小晴天是ACdream团队中最牛的老师之一,他最擅长数学运算~这天他翻开一本<AC is not a dream>杂志,发现最后一页有一道很经典的思维题,题目很简单,每个框填写一个数字,构成一个竖式,每个数的最高位不能为0,但是有一些数字被隐藏掉了,然后让你…
http://acdream.info/problem?pid=1007 两个 long long 相乘会超long long #include <cstdio> #include <cstring> #include <algorithm> #define ll long long #define maxn 10000 #define mod 10000000007 using namespace std; ll a[maxn]; ll n,k,t; ll fMul(…
题意:http://acdream.info/problem?pid=1112 Problem Description Here is Alice and Bob again ! Alice and Bob are playing a game. There are several numbers.First, Alice choose a number n.Then he can replace n (n > 1)with one of its positive factor but not…
称号:acdream 1222 Quantization Problem 题意:给出一个序列 a ,然后给出一个 n * m 的矩阵,让你从这个矩阵中选出一个序列k,使得sum(abs(ki - ai))尽可能的小,首先第一个数仅仅能在矩阵的第一行选第 x 个.然后以后每一个在第 x%n 行选,依次选出最小就可以. 每一个点能够选多次. 分析:这个题目难度在于题意,题意读懂了就简单了. 非常明显的一个dp题目,我们定义状态:dp [i][j] :选第 i 个数 在第 j 列的最小和 则转移方程:…
A - ACfun Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) SubmitStatus Problem Description 题目链接点击打开链接 As a former ACMer, "AC" is a special abbreviated word which can bring much pleasure to me. Sometimes it means…