自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

只要我还有一息尚存,我就会坚持到底,因为我深知成功的秘诀就是坚持不懈,直到成功

  • 博客(71)
  • 问答 (1)
  • 收藏
  • 关注

原创 快速求质因数

#include <bits/stdc++.h>using namespace std;int vis[1000010];const int mod=1e9+7;int main(){ long long n,m,i,j; while(~scanf("%d%d",&n,&m)) { //memset(vis,0,sizeof(v...

2019-04-04 11:12:48 1452

原创 SPFA双端队列

#include &lt;iostream&gt;  #include &lt;cstring&gt;  #include &lt;queue&gt;  using namespace std;  const int inf = 0x3fffffff;     int d[25005];  int vis[25005]; int num[25005];struct node{  ...

2019-02-11 20:18:01 288

原创 强连通分量

Popular CowsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 37486 Accepted: 15293DescriptionEvery cow's dream is to become the most popular cow in the herd. In a herd of N (1 &lt;= N &lt;= 1...

2018-04-20 11:42:02 198

原创 矩阵快速幂

用 fib(n)fib(n) 表示斐波那契数列的第 nn项,现在要求你求 fib(n)fib(n) mod mm。fib(1)=1,fib(2)=1fib(1)=1,fib(2)=1。输入格式输入 22 个整数 n(1 \le n \le 10^{18})n(1≤n≤1018),m(2 \le m \le 100000000)m(2≤m≤100000000)。输出格式输出 fib(n)fib(n)...

2018-03-06 11:57:44 136

原创 扩展欧几里得算法

C. Linetime limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard outputA line on the plane is described by an equation 

2017-10-10 22:29:56 246

原创 A Round Peg in a Ground Hole

DescriptionThe DIY Furniture company specializes in assemble-it-yourself furniture kits. Typically, the pieces of wood are attached to one another using a wooden peg that fits into pre-cut holes

2017-10-06 17:53:42 294

原创 hdu 4027

Can you answer these queries?Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 19421    Accepted Submission(s): 4589Problem Descriptio

2017-10-03 12:03:15 173

原创 qsort

1.intqsort(a,1000,sizeof(int),comp);其中comp函数应写为:1234int comp(const void*a,const void*b){return *(int*)a-*(int*)b;//return *(int *)b - *(int

2017-10-02 18:18:34 135

原创 判断是否是凸多边形,判断点是否在多边形内,点到直线的距离

B - A Round Peg in a Ground HoleTime Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionThe DIY Furniture company specializes in assem

2017-09-30 16:07:52 557

原创 控制前置0的输出

if(flag>1) { printf("%05d\n",v[i][j]);//不足五位补0 } printf("%05d %d ", v[i][j],f[v[i][j]].x); }

2017-09-25 23:23:01 254

原创 A+B

int c[50]={0};void f(string a,string b){ int i,j,k,t; for(i=b.size()-1,j=a.size()-1,k=0;i>=0;i--,j--,k++) { c[k]+=b[i]-'0'+a[j]-'0'; c[k+1]+=c[k]/10; c[k]%=10; } for(i=j;i>=0;i--) { c

2017-09-25 12:33:08 136

原创 JAVA大数

Ⅰ基本函数:1.valueOf(parament); 将参数转换为制定的类型比如 int a=3;BigInteger b=BigInteger.valueOf(a);则b=3;String s=”12345”;BigInteger c=BigInteger.valueOf(s);则c=12345;2.add(); 大整数相加

2017-09-21 20:37:59 218

原创 KMP算次数

OulipoTime Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15905    Accepted Submission(s): 6318Problem DescriptionThe French author

2017-09-19 22:53:38 608

原创 KMP算法

The Dominator of StringsTime Limit: 3000/3000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2474    Accepted Submission(s): 888Problem DescriptionHe

2017-09-19 20:05:56 218

原创 最小生成树记路径

#include#include #include #include #include using namespace std; const int inf=0xffffff; int a[1005][1005],vis[1005],d[1005],n,m,w,pre[1005]; struct node{ int x,y; }f1[10005];bool cmp(n

2017-09-12 18:45:46 387

原创 SPFA算法

//如果一个点入队次数大于等于节点数则存在负环,return FALSE#include #include #include using namespace std; const int INF = 0x3fffffff; const int MAX = 100; int map[MAX][MAX]; int dis[MAX]; bool vis[MAX];

2017-09-12 11:51:07 157

原创 spfa算法

#include #include #include using namespace std; const int inf = 0x3fffffff; int d[10005]; int vis[10005]; int num[10005];struct cmp { bool operator()(int x,int y)

2017-09-12 11:49:51 167

原创 5C-codeforce Longest Regular Bracket Sequence

C. Longest Regular Bracket Sequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis is yet another pro

2017-09-10 14:47:55 171

原创 并查集

int find(int x){ if(f[x]!=x) return f[x]=find(f[x]); return f[x];} void merge(int a,int b) { if(a==b) return; else f[a]=b; }

2017-09-07 19:41:34 153

原创 关于输出超限的解决方法

1.多输出东西了2.输入输出改为cin,cout

2017-09-07 18:46:15 23988 3

原创 codeforce 4D

D. Mysterious Presenttime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputPeter decided to wish happy birthday to

2017-09-06 21:11:15 264

原创 codeforce 1C

C. Ancient Berland Circustime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputNowadays all circuses in Berland h

2017-09-05 11:44:27 195

原创 计算几何知识点

公式描述:公式中a,b,c分别为三角形三边长,p为半周长,S为三角形的面积。3.三角形外接圆半径公式公式描述:公式中a,b,c分别为三角形的三边,S为面积。4.正多边形外角和为360度,各个外角相等且等于各边所对应圆心角5.正多变形面积:sin(a)*r*r*n/2;   //a为圆心角,r

2017-09-05 11:42:07 291

原创 codeforce 2B

B. The least round waytime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputThere is a square matrix n × n, consi

2017-09-04 11:50:14 272

原创 迷宫问题

迷宫问题Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 3984Description定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1

2017-09-03 12:10:17 181

原创 逆元

(a +  b) % p = (a%p +  b%p) %p  (对)(a  -  b) % p = (a%p  -  b%p) %p  (对)(a  *  b) % p = (a%p *  b%p) %p  (对)(a  /  b) % p = (a%p  /  b%p) %p  (错)a^(p-2) ≡1/a (mod p)什么(,,• ₃ •,

2017-09-03 11:58:53 160

原创 优先队列

1.结构体优先队列struct node{int x;int y;int d;friend bool operator    {        return a.d>b.d;//小的在前    }}; priority_queueque5; 2.普通优先struct cmp1{ bool operator ()(

2017-08-27 16:45:18 130

原创 FZU-2254 英语考试

#include#include#include#includeusing namespace std;const int inf=0xffffff;int a[1005][1005],vis[1005],d[1005],n,m,w;int prime()  {      int sum=0,i,j,k,v,ans=0;      for(i=1;i

2017-08-24 17:56:36 205

原创 HDU-Coin Change

Coin ChangeTime Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 20419    Accepted Submission(s): 7179Problem DescriptionSuppose there

2017-08-23 17:45:53 261

原创 HDU-1398 Square Coins

Square CoinsTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12878    Accepted Submission(s): 8848Problem DescriptionPeople in Si

2017-08-23 17:42:15 177

原创 地宫取宝 (dfs+dp深搜)

地宫取宝时间限制: 1 Sec  内存限制: 128 MB提交: 4  解决: 3[提交][状态][讨论版]题目描述历届试题  地宫取宝    时间限制:1.0s     内存限制:256.0MB       问题描述   X  国王有一个地宫宝库。是  n  x  m  个格子的矩阵。每个格子放一件宝贝。每个宝贝贴着价值标签。   地宫的入口在

2017-08-14 23:19:11 342

原创 HDU-1078FatMouse and Cheese 记忆化搜索

FatMouse and CheeseTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10996    Accepted Submission(s): 4668Problem DescriptionFatMo

2017-08-14 17:39:35 143

原创 拦截导弹

算法训练  拦截导弹    时间限制:1.0s     内存限制:256.0MB       问题描述   某国为了防御敌国的导弹袭击,发展出一种导弹  拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度。某天,雷达捕捉到敌国的  导弹来袭。由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹。

2017-08-14 09:36:00 195

原创 Boolean Expressions

Boolean Expressions 时间限制: 1 Sec  内存限制: 128 MB提交: 4  解决: 4[提交][状态][讨论版]题目描述The objective of the program you are going to produce is to evaluate boolean expressions as the one shown next

2017-08-13 11:49:02 671

原创 多校联萌 C-QAQ & 火星情报局

1410: QAQ & 火星情报局 [数学]时间限制: 1 Sec 内存限制: 128 MB提交: 242 解决: 35 统计题目描述QAQ~超级喜欢看火星情报局,每周六都是他一周中最期待的一天,QAQ喜欢和自己一样心愿是“世界和平”的薛之谦,喜欢“一言不合就飙车”的宇哥,喜欢“再扯的提案都能升华为鸡汤”的汪涵局长....当然也喜欢的里面各种各样奇葩有趣的提

2017-08-11 21:26:54 508

原创 多校联萌第三场H-StarFarming

1413: StarFarming [最短路]时间限制: 1 Sec 内存限制: 128 MB提交: 360 解决: 47 统计题目描述星农(StarFarming)公司计划要给员工发路费津贴,发放的规则是这样的:1到n-1代表各个员工家的序号,n代表公司。路费津贴只发给上班的最短路与回家的最短路的总路程最长的人。该市的路建造的有些奇怪,修路只修单行道,即只允许

2017-08-11 21:09:41 306

原创 多校联萌第三场 问题 A: Kick Ass

多校联萌问题 A: Kick Ass时间限制: 1 Sec 内存限制: 128 MB提交: 61 解决: 7题目描述你玩过一个叫做"Kick Ass - Destroy the web"的游戏吗?如果你想玩的话请点击此处当然,你没有玩过也没关系,这个游戏是通过js来加载一个飞船,让你可以通过控制它发射子弹来摧毁网页上的元素,从而获得分数。我们知道HTML是超

2017-08-11 18:32:53 232

原创 HDU-2049考新郎

roblem Description国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做"考新郎",具体的操作是这样的:首先,给每位新娘打扮得几乎一模一样,并盖上大大的红盖头随机坐成一排;然后,让各位新郎寻找自己的新娘.每人只准找一个,并且不允许多人找一个.最后,揭开盖头,如果找错了对象就要当众跪搓衣板...

2017-08-11 12:45:15 147

原创 C语言文件常用操作

FILE *fp//定义一个文件类型指针1.fopen函数fopen函数是在当前目录下打开一个文件,其调用的一般形式为:文件指针名=fopen(文件名,使用文件方式);eg:fp=fopen("a1","rb+");“文件指针名”必须是被说明为FILE 类型的指针变量;“文件名”是被打开文件的文件名;“使用文件方式”是指文件的类型和操作要求;“文件名”是字符串常量或

2017-08-08 21:23:21 236

原创 Is Derek lying?-2017 暑期组队训练赛1-HDU-

DerekDerek and AlfiaAlfia are good friends.DerekDerek is Chinese,and AlfiaAlfia is Austrian.This summer holiday,they both participate in the summer camp of Borussia Dortmund.During the summer ca

2017-08-03 22:27:13 304

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除