Bestcoder #80】的更多相关文章

首先吐槽一下,ca爷出的这套题到处都是坑,bestcoder变成besthack,Ranting已经掉得不能看了 A题: 链接:http://acm.hdu.edu.cn/showproblem.php?pid=5665 分析:这题题目写错,一wa,最后发现是求的非负数 #include <iostream> #include <cstdio> #include <cstring> #include <string> #include <vector&…
Sequence  Accepts: 59  Submissions: 650  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) Problem Description \ \ \ \    Holion August will eat every thing he has found. \ \ \ \    Now there are many foods,but he does…
HDU 5666 Segment 题意:给你条斜率为-1,常数项为q(q为质数)的直线,连接原点与直线上整数格点,问你在有多少个格点在形成的无数个三角形内,而不在线段上,结果对P取模. 思路:bestcoder题解上有思路,一条以(0,0)为起点,(x,y)为终点的线段上格点的个数(不包含端点时),一定是gcd(x,y)−1,题目由于p为质数,所以所有线段上都没有格点,需要注意的是p为质数,情况就很少了,然后就是数据太大的问题,改一改快速幂就可以了. #include <cstdio> #in…
[1003 Sequence] 指数循环节,注意a mod p = 0的情况.此时你的循环节如果返回0,这时你会输出1,而实际上应该是0 #include <algorithm> #include <iostream> #include <cstring> #include <cstdio> using namespace std; typedef long long ll; ll n, a, b, c, p; struct Matrix{ ll a[3][…
Segment  Accepts: 418  Submissions: 2020  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) 问题描述 \ \ \ \    Rivendell非常神,喜欢研究奇怪的问题. \ \ \ \    今天他发现了一个有趣的问题.找到一条线段x+y=qx+y=q,令它和坐标轴在第一象限围成了一个三角形,然后画线连接了坐标原点和线段上坐标为整数的格点.…
Lucky Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1443    Accepted Submission(s): 767 Problem Description     Chaos August likes to study the lucky numbers. For a set of numbers S,we set the…
#include<cstdio> #include<string> #include<iostream> #include<vector> #include<set> #include<map> #include<math.h> #include<queue> #include<stdlib.h> #include<cstring> #include<algorithm> u…
BestCoder Round #7 Start Time : 2014-08-31 19:00:00    End Time : 2014-08-31 21:00:00Contest Type : Register Public   Contest Status : Ended Current Server Time : 2014-08-31 21:12:12 Solved Pro.ID Title Ratio(Accepted / Submitted)   1001 Little Pony…
Rikka with Phi  Accepts: 5  Submissions: 66  Time Limit: 16000/8000 MS (Java/Others)  Memory Limit: 131072/131072 K (Java/Others) Problem Description Rikka and Yuta are interested in Phi function (which is known as Euler's totient function). Yuta giv…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4956 Poor Hanamichi Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7    Accepted Submission(s): 4 Problem Description Hanamichi is taking part in…