# HDU4710 Balls Rearrangement （规律题）

http://acm.hdu.edu.cn/showproblem.php?pid=4710 【题意】 给出n，a，b三个值，求sum( | i%a - i%b | ) ，i属于【0，n-1】 【分析】 由于n值可达1e9，故不能直接循环累加。通过写出一些例子可看出，累加时，总是一段一段相同的值，直接累加 个数*数值，再跳过这些数即可。 【代码】 #include using na...

# bzoj2705 欧拉函数

bzoj2705 Longge的数学成绩非常好，并且他非常乐于挑战高难度的数学问题。现在问题来了：给定一个整数N，你需要求出∑gcd(i, N)(1<=i <=N)。 Input 一个整数，为N。 Output 一个整数，为所求的答案。 Sample Input 6 Sample Output 15 Hint 【数据范围】 对于60%的数据，0<N<=2^16。 对于100%的数据，0<N<=2^32。...

# HDU4810 亦或，组合数

Ms.Fang loves painting very much. She paints GFW(Great Funny Wall) every day. Every day before painting, she produces a wonderful color of pigments by mixing water and some bags of pigments. On the K-th day, she will select K specific bags of pigments and ...

# ICPC2017网络赛（乌鲁木齐）E: Half-consecutive Numbers （大数）

E: Half-consecutive Numbers time limit 2000ms memory limit 131072KB The numbers 1, 3, 6, 10, 15, 21, 28, 36, 45 and t = i(i +1), are called halfconsecutive. For given N, ﬁnd the smallest r which is no smaller than N such that t is square. i 2 1 r Inpu...

# 275. To xor or not to xor(高斯消元求最大亦或值)

275. To xor or not to xor time limit per test: 0.25 sec. memory limit per test: 65536 KB input: standard output: standard The sequence of non-negative integers A1, A2, ..., AN is given. You are to find some subsequence Ai1, Ai2, ..., Aik (1 <= i1 < i2 ...

# ACM高斯消元法 亦或方程组求秩 （HDU5833 Zhu and 772002）

#include #include #include #include #define set(a,i) memset(a,i,sizeof(a)) using namespace std; typedef long long ll; const int mod=1e9+7; ll qpow(ll n,ll m){n%=mod;ll ans=1;while(m){if(m%2)...

# poj3295Tautology 离散数学前缀表达式（栈+枚举）

poj3295：点击打开链接 Tautology Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 13200   Accepted: 5031 Description WFF 'N PROOF is a logic game played with d...

# poj2891 Strange Way to Express Integers (中国剩余定理+拓展欧几里得）

Strange Way to Express Integers Time Limit: 1000MS Memory Limit: 131072K Total Submissions: 15855 Accepted: 5242 Description Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is describ...

# acm杭电HDU5245 Joyful 概率问题 期望值（2015上海邀请赛）

Joyful Problem Description Sakura has a very magical tool to paint walls. One day, kAc asked Sakura to paint a wall that looks like anM×N matrix. The wall has M×N squares in all. In the whole problem we denotes (x,y) to be the square at the x-th row, y-th...

29条 共2页1 2 下一页 尾页
个人资料
• 访问：103698次
• 积分：3019
• 等级：
• 排名：第13770名
• 原创：197篇
• 转载：9篇
• 译文：0篇
• 评论：33条
博客专栏
 ACM算法 文章：17篇 阅读：7004
 ACM荣耀之路 文章：97篇 阅读：46059
阅读排行
最新评论