
数学
文章平均质量分 57
NineFailure
这个作者很懒,什么都没留下…
展开
-
HDU1019
多个数的最小公倍数原创 2016-06-29 16:24:40 · 308 阅读 · 0 评论 -
Codeforces Round #309 (Div. 2)C
Kyoya Ootori has a bag with n colored balls that are colored with k different colors. The colors are labeled from 1 to k. Balls of the same color are indistinguishable. He draws balls from the bag one原创 2017-03-04 10:47:07 · 244 阅读 · 0 评论 -
CodeForces - 810C
Leha decided to move to a quiet town Vičkopolis, because he was tired by living in Bankopolis. Upon arrival he immediately began to expand his network of hacked computers. During the week Leha managed原创 2017-05-22 22:03:28 · 539 阅读 · 0 评论 -
CodeForces - 735D
Mr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year is equal to n (n ≥ 2) burles and the amount of tax he has to pay is calculated as the maximu原创 2017-05-12 15:07:25 · 336 阅读 · 0 评论 -
CodeForces - 798C
Mike has a sequence A = [a1, a2, …, an] of length n. He considers the sequence B = [b1, b2, …, bn] beautiful if the gcd of all its elements is bigger than 1, i.e. .Mike wants to change his sequence in原创 2017-05-15 17:26:32 · 409 阅读 · 0 评论 -
CodeForces - 616E
Calculate the value of the sum: n mod 1 + n mod 2 + n mod 3 + … + n mod m. As the result can be very large, you should print the value modulo 109 + 7 (the remainder when divided by 109 + 7).The modulo原创 2017-05-17 08:07:27 · 372 阅读 · 0 评论 -
CodeForces - 560E (13/600)
Giant chess is quite common in Geraldion. We will not delve into the rules of the game, we’ll just say that the game takes place on an h × w field, and it is painted in two colors, but not like in ches原创 2017-06-12 10:04:49 · 409 阅读 · 0 评论 -
HDU2067(52/600)
卡特兰会在33左右爆long long 所以一般不用直接递推#include<bits/stdc++.h>using namespace std;#define int unsigned long longint kate[60]; main(){ kate[1]=kate[0]=1; for(int a=2;a<=35;a++) { for(i原创 2017-07-20 10:19:43 · 288 阅读 · 0 评论 -
Ural 1114(49/600)
N boxes are lined up in a sequence (1 ≤ N ≤ 20). You have A red balls and B blue balls (0 ≤ A ≤ 15, 0 ≤ B ≤ 15). The red balls (and the blue ones) are exactly the same. You can place the balls in the b原创 2017-07-18 16:08:58 · 391 阅读 · 0 评论 -
BZOJ2005(74/600)
栋栋有一块长方形的地,他在地上种了一种能量植物,这种植物可以采集太阳光的能量。在这些植物采集能量后, 栋栋再使用一个能量汇集机器把这些植物采集到的能量汇集到一起。 栋栋的植物种得非常整齐,一共有n列,每列 有m棵,植物的横竖间距都一样,因此对于每一棵植物,栋栋可以用一个坐标(x, y)来表示,其中x的范围是1至n, 表示是在第x列,y的范围是1至m,表示是在第x列的第y棵。 由于能量汇集机器较原创 2017-07-31 19:10:17 · 269 阅读 · 0 评论 -
HDU3625(82/600)
A murder happened in the hotel. As the best detective in the town, you should examine all the N rooms of the hotel immediately. However, all the doors of the rooms are locked, and the keys are just loc原创 2017-08-07 17:24:07 · 252 阅读 · 0 评论 -
HDU2049(51/600)
错排公式 fn=(n-1)(fn-1 +fn-2)#include<bits/stdc++.h>using namespace std;#define int unsigned long longint f[90]; main(){ int T; cin>>T; while(T--) { int n,m; cin>>原创 2017-07-19 19:08:47 · 251 阅读 · 0 评论 -
BZOJ2301(75/600)
对于给出的 n 个询问,每次求有多少个数对 (x,y) ,满足 a ≤ x ≤ b , c ≤ y ≤ d ,且 gcd(x,y) = k , gcd(x,y) 函数为 x 和 y 的最大公约数。Input 第一行一个整数n,接下来n行每行五个整数,分别表示a、b、c、d、kOutput 共n行,每行一个整数表示满足要求的数对(x,y)的个数Sample Input 22 5 1 5 11 5原创 2017-08-01 10:55:25 · 295 阅读 · 0 评论 -
codeforces 839D(89/600)
D. Winter is here time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Winter is here at the North and the White Walkers are close. John Snow h原创 2017-08-13 23:51:04 · 515 阅读 · 0 评论 -
Codeforces Round #308 (Div. 2)C
C. Vanya and Scales time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vanya has a scales for weighing loads and weights of masses w0, w1, w2,原创 2017-03-02 12:58:50 · 276 阅读 · 0 评论 -
Codeforces Round #307 (Div. 2)D
D. GukiZ and Binary Operations time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output We all know that GukiZ often plays with arrays.Now he is thi原创 2017-03-01 11:51:17 · 363 阅读 · 0 评论 -
light oj 1005 不知道是个什么玩意
A rook is a piece used in the game of chess which is played on a board of square grids. A rook can only move vertically or horizontally from its current position and two rooks attack each other if one原创 2016-09-06 20:19:01 · 522 阅读 · 0 评论 -
lightoj 1007 欧拉函数
Mathematically some problems look hard. But with the help of the computer, some problems can be easily solvable.In this problem, you will be given two integers a and b. You have to find the summation o原创 2016-09-23 15:19:43 · 298 阅读 · 0 评论 -
HDU5902
问题描述 Alex发明了一个有趣的游戏. 一开始他在黑板上写了nn个正整数, 然后他开始重复进行如下的操作:他选择黑板上三个数字aa, bb和cc, 把他们从黑板上擦掉.他从这三个数aa, bb和cc中选择了两个数, 并计算出他们的最大公约数, 记这个数为dd (dd 可以是\gcd(a,b)gcd(a,b), \gcd(a,c)gcd(a,c)或者\gcd(b, c)gcd(b,c)).他原创 2016-09-26 21:37:40 · 465 阅读 · 0 评论 -
lightoj 1014 求一个数的所有因子
这个题一开始我求了k的所有质因子和其指数的值 用dfs求得所有因子但是超时了… 百度一下暴力… 好了记住以后这种破玩意就是暴力… mdzz#include<iostream>#include<cstdio>#include<memory.h>#include<algorithm>#include<iomanip>#include<map>using namespace std;原创 2016-09-28 17:54:49 · 592 阅读 · 0 评论 -
HDU1576 解方程....
Problem Description要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。 每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。Output对应每组数据输出(A/B)%9973。Sample Input2 1000原创 2016-09-30 13:37:31 · 366 阅读 · 0 评论 -
HDU5685 乘法逆元应用
Description 度熊手上有一本字典存储了大量的单词,有一次,他把所有单词组成了一个很长很长的字符串。现在麻烦来了,他忘记了原来的字符串都是什么,神奇的是他竟然记得原来那些字符串的哈希值。一个字符串的哈希值,由以下公式计算得到: 代表 S[i] 字符的 ASCII 码。 请帮助度熊计算大字符串中任意一段的哈希值是多少。 Input 多组测试数据,每组测试数据第一行是一个正整数,代表询问的原创 2016-11-12 08:41:57 · 437 阅读 · 0 评论 -
poj 1061 扩展GCD
Description 两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为原创 2016-11-12 12:21:13 · 365 阅读 · 0 评论 -
HDU5584 证明题..
Description A frog has just learned some number theory, and can’t wait to show his ability to his girlfriend. Now the frog is sitting on a grid map of infinite rows and columns. Rows are numbered 1, 2原创 2016-11-12 20:45:08 · 415 阅读 · 0 评论 -
HDU5667 矩阵快速幂
题目给了个公式是相乘的 这个玩意一看就只能快速幂 毕竟10^18…递推瞬间爆炸 然后快速幂也能看出来 相乘的没法搞 那就log 完成然后不停的tle…. 在求出指数的时候…再用个费马小定理 要不然就gg#include<stdio.h>#include<math.h>#include<iostream>#include<string.h>#include<queue>#in原创 2016-11-13 12:46:53 · 469 阅读 · 0 评论 -
HDU5668 中国剩余定理+约瑟夫环
Description Satiya August is in charge of souls. He finds souls,and lets them become a circle.He ordered them to play Joseph Games.The souls will count off from the soul .The soul who is numbered wi原创 2016-11-16 20:06:40 · 717 阅读 · 0 评论 -
HDU4828 卡特兰数+逆元
Description 度度熊最近很喜欢玩游戏。这一天他在纸上画了一个2行N列的长方形格子。他想把1到2N这些数依次放进去,但是为了使格子看起来优美,他想找到使每行每列都递增的方案。不过画了很久,他发现方案数实在是太多了。度度熊想知道,有多少种放数字的方法能满足上面的条件? Input 第一行为数据组数T(1<=T<=100000)。 然后T行,每行为一个数N(1<=N<=10原创 2016-11-14 14:20:35 · 446 阅读 · 0 评论 -
poj 1006 剩余定理
无脑套板子…. 好像不需要理解什么意思的样子…. 具体就是知道余数(除数积/当前)(除数积/当前 mod当前的逆元)求和…. 就可以了… 板子有学长写好的…#include<iostream>#include<algorithm>#include<cmath>#include<string>#include<cstdio>using namespace std;long l原创 2016-11-14 16:23:41 · 415 阅读 · 0 评论 -
Codeforces Round #324 (Div. 2)D
D. Dima and Lisa time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Dima loves representing an odd number as the sum of multiple primes, and L原创 2017-01-15 11:36:36 · 321 阅读 · 0 评论 -
CodeForces - 785D(92/600)
As you probably know, Anton goes to school. One of the school subjects that Anton studies is Bracketology. On the Bracketology lessons students usually learn different sequences that consist of round b原创 2017-08-15 08:13:32 · 622 阅读 · 0 评论