![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
---- 各种模板 -----
文章平均质量分 61
叶孤心丶
这个作者很懒,什么都没留下…
展开
-
UVA Integer Inquiry(大数加法)
Integer InquiryTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit StatusDescription Integer Inquiry One of the first users of BI原创 2014-12-01 22:36:55 · 798 阅读 · 0 评论 -
HDU 1757 A Simple Math Problem(矩阵快速幂)
A Simple Math ProblemTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionLele now is thinking about a simple function f(x). If x原创 2015-03-06 18:11:11 · 529 阅读 · 0 评论 -
POJ 2442 Sequence(堆的应用)
SequenceTime Limit: 6000MS Memory Limit: 65536KTotal Submissions: 8269 Accepted: 2705DescriptionGiven m sequences, each contains n non-negative integer. Now we ma原创 2015-08-03 15:08:57 · 359 阅读 · 0 评论 -
51nod 1264 线段相交(判线段相交 包括端点和部分重合)
1264 线段相交基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注给出平面上两条线段的两个端点,判断这两条线段是否相交(有一个公共点或有部分重合认为相交)。 如果相交,输出"Yes",否则输出"No"。Input第1行:一个数T,表示输入的测试数量(1 <= T <= 1原创 2015-08-30 20:10:37 · 1469 阅读 · 0 评论 -
SDUTOJ 3307 (01背包求第K大)
aTime Limit: 1000MS Memory limit: 65536K题目描述有一个奇怪的超市,超市中有m种商品,每个商品都有一个都价格pi,超市的特殊在于:如果顾客买第i件商品,就会赠送ci个欢乐豆,一种商品对一个顾客只会赠送一次。现在有两个好朋友来超市买东西,他们都带了n元钱,如果最终两个人得到的欢乐豆不一样,他们的欢乐豆的和的最大值是多少原创 2015-08-30 14:31:20 · 488 阅读 · 0 评论 -
SDUTOJ 3309乱七八糟的图(spfa)
乱七八糟的图Time Limit: 4000ms Memory limit: 65536K 有疑问?点这里^_^题目描述给一个连通无向图,图有n个顶点m条边,可能会有重边,无自环。然后给一个出发点st,现在这个st到其他每一个顶点都有一个最短距离。然后,让你删除一些边,剩下的边构成了一个新连通无向图,要求在新图中,出发点st到其他任何一个顶原创 2015-08-31 10:41:20 · 627 阅读 · 0 评论 -
51 nod 1046 A^B Mod C(快速幂取余)
1046 A^B Mod C基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注给出3个正整数A B C,求A^B Mod C。例如,3 5 8,3^5 Mod 8 = 3。Input3个正整数A B C,中间用空格分隔。(1 Output输出计算结果原创 2015-08-31 10:47:31 · 1045 阅读 · 0 评论 -
51nod 1265 四点共面(判四点共面)
1265 四点共面基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注给出三维空间上的四个点(点与点的位置均不相同),判断这4个点是否在同一个平面内(4点共线也算共面)。如果共面,输出"Yes",否则输出"No"。Input第1行:一个数T,表示输入的测试数量(1 <= T原创 2015-08-31 08:38:57 · 1041 阅读 · 2 评论 -
素数筛
#include#include#include#includeconst int Max = 100000000;bool flag[Max];int prime[Max/3],pi;void saixuan(){ int i,j; pi = 0; memset(flag,0,sizeof(flag)); for(i=2;iMax;i++)原创 2014-09-09 20:42:02 · 596 阅读 · 0 评论 -
POJ 1703 Find them, Catch them(并查集拓展)
Find them, Catch themTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 36534 Accepted: 11209DescriptionThe police office in Tadu City decides to say ends原创 2015-08-20 20:32:11 · 489 阅读 · 0 评论 -
POJ 3252 Round Numbers(组合数学)
Round NumbersTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 10223 Accepted: 3726DescriptionThe cows, as you know, have no fingers or thumbs and thus ar原创 2015-07-22 16:47:50 · 1351 阅读 · 0 评论 -
HDU 4267 A Simple Problem with Integers(树状数组)
A Simple Problem with IntegersTime Limit: 5000/1500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4475 Accepted Submission(s): 1378Problem Descriptio原创 2015-08-26 10:46:04 · 915 阅读 · 0 评论 -
快速幂取余
#include#include#include#include#include#includeusing namespace std;long long quickmod(long long a,long long b,long long m){ long long ans = 1; while(b)//用一个循环从右到左便利b的所有二进制位 {原创 2015-06-28 10:08:49 · 411 阅读 · 0 评论 -
UVA Product(大数乘法)
ProductTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit StatusDescription Product The ProblemThe problem is to multiply tw原创 2014-12-01 22:39:44 · 602 阅读 · 0 评论 -
UVA If We Were a Child Again(大数相除模板)
Problem CIf We Were a Child AgainInput: standard inputOutput: standard output Time Limit:7 seconds “Oooooooooooooooh!If I could do the easy mathem转载 2014-12-04 08:47:57 · 711 阅读 · 0 评论 -
HDU 1566 Color the ball(树状数组or线段树)
Color the ballTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11387 Accepted Submission(s): 5680Problem DescriptionN个气球排成一排,从原创 2015-04-20 21:14:24 · 921 阅读 · 1 评论 -
POJ 2528 Mayor's posters(线段树+离散化)
Mayor's postersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 46857 Accepted: 13601DescriptionThe citizens of Bytetown, AB, could not stand that the ca原创 2015-04-08 11:22:34 · 642 阅读 · 0 评论 -
HDU 2425 Hiking Trip(搜索+优先队列)
Hiking TripTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 2425DescriptionHiking in the mountains is seldom an easy task fo原创 2015-03-10 21:03:49 · 628 阅读 · 0 评论 -
POJ 1195 Mobile phones(二维树状数组)
Mobile phonesTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 15968 Accepted: 7373DescriptionSuppose that the fourth generation mobile phone base station原创 2015-04-22 20:05:52 · 630 阅读 · 0 评论 -
第四届山东省赛 Thrall’s Dream(BFS+vector)
2218: Thrall’s DreamTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 253 Solved: 72[Submit][Status][Web Board]DescriptionWe never paid any heed to the ancient prophecies, like fools we cl原创 2015-04-07 20:17:44 · 963 阅读 · 0 评论 -
七种qsort排序方法
qsort 包含在头文件 #includeqsort ( 哪个 , 长度 , 大小, cmp)一、对int类型数组排序 [cpp] view plaincopyprint?int num[100]; int cmp ( const void *a , const void *b ) {转载 2015-06-30 11:13:10 · 393 阅读 · 0 评论 -
POJ 1265 Area(Pick定理)
AreaTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5284 Accepted: 2375DescriptionBeing well known for its highly innovative products, Merck would defin原创 2015-07-25 16:47:34 · 1059 阅读 · 0 评论 -
HDU 4135 Co-prime(容斥定理)
Co-primeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2445 Accepted Submission(s): 918Problem DescriptionGiven a number N,原创 2015-08-24 20:03:38 · 521 阅读 · 0 评论 -
Java8 时间工具类
import lombok.Getter;import java.time.*;import java.time.format.DateTimeFormatter;import java.time.temporal.TemporalAdjusters;import java.util.Date;/** * 时间工具类 * * @Author: taozhengzhi * ...原创 2019-04-08 18:51:32 · 244 阅读 · 1 评论