本月博客排行
-
第1名
龙儿筝 -
第2名
flashsing123 -
第3名
xiaoxinye - e_e
- java_doom
- johnsmith9th
- gaochunhu
- sichunli_030
- zw7534313
- 深蓝传说
年度博客排行
-
第1名
宏天软件 -
第2名
龙儿筝 -
第3名
青否云后端云 - wallimn
- vipbooks
- gashero
- wy_19921005
- benladeng5225
- fantaxy025025
- zysnba
- e_e
- javashop
- sam123456gz
- tanling8334
- arpenker
- kaizi1992
- xpenxpen
- lemonhandsome
- xiangjie88
- ganxueyun
- xyuma
- sichunli_030
- wangchen.ily
- jh108020
- Xeden
- johnsmith9th
- zxq_2017
- zhanjia
- jbosscn
- forestqqqq
- luxurioust
- lzyfn123
- ajinn
- daizj
- wjianwei666
- ranbuijj
- 喧嚣求静
- kingwell.leng
- silverend
- lchb139128
- kristy_yy
- lich0079
- jveqi
- java-007
- sunj
- yeluowuhen
- lerf
- lstcyzj
- flashsing123
- lxguy
最新文章列表
【扩展欧几里得】POJ 2142 The Balance
KIDx 的解题报告
题目链接:http://poj.org/problem?id=2142
不懂扩展欧几里得请先参照这里:
http://972169909-qq-com.iteye.com/blog/1140914
题意:输入3个数,前2个是砝码的种类,问各要多少个才能称出第三个数出来【同时要使2个答案之和最小】
#include <iostream>
#include &l ...
【矩阵乘法+快速取幂模】HDU 1575 Tr A
http://acm.hdu.edu.cn/showproblem.php?pid=1575
Problem Description
A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。
Input
数据的第一行是一个T,表示有T组数据。
每组数据的第一行有n(2 <= n <= 10)和k(2 <= k < 10^9)两个数据。 ...
poj 2155 Martrix(二维树状数组)
Matrix
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 10282
Accepted: 3859
Description
Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the n ...
hdu 2492 ping pong(逆序数与顺序数)
Ping pong
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1143 Accepted Submission(s): 387
Problem Description
N(3<=N<=20000) ping po ...
poj 2481 Cows(stars的变形+离散化)
Cows
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 6854
Accepted: 2211
Description
Farmer John's cows have discovered that the clover growing along the ridge of t ...
hdu 3743 Frosh Week(离散化+树状数组)
Frosh Week
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 289 Accepted Submission(s): 72
Problem Description
During Frosh Week, s ...
poj3259 bellman水题
poj3259http://poj.org/problem?id=3259
最简单的bellman,判断是否有负环,n-1次松弛后若还能松弛,则有负环
#include <iostream>
#include <fstream>
#define INF 999999999
using namespace std;
struct E
{
int u;
...
【凸包Graham_Scan算法】HDU 1348 Wall
http://acm.hdu.edu.cn/showproblem.php?pid=1348
典型凸包题,求外围城墙的周长
Sample Input
1
9 100
200 400
300 400
300 300
400 300
400 400
500 400
500 200
350 200
200 200
Sample Output
1628
#include <iostream ...
poj 2299 Ultra-QuickSort(求逆序数:离散化+树状数组)
Ultra-QuickSort
Time Limit: 7000MS
Memory Limit: 65536K
Total Submissions: 22147
Accepted: 7897
Description
In this problem, you have to analyze a particular sorting algorithm ...
hdu 1556 Color the ball
Color the ball
Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2340 Accepted Submission(s): 1372
Problem Description
N个气球排成一排,从左到右依次编号为1,2, ...
acm题目常用的预处理
#include<iostream>
#include<sstream>
#include<fstream>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<stack>
#include ...
hdu 1541 Stars(最基础的树状数组)
Stars
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1287 Accepted Submission(s): 503
Problem Description
Astronomers often examine star m ...
【判线段相交】HDU 1086
http://acm.hdu.edu.cn/showproblem.php?pid=1086
题意:求一堆线段两两相交的次数,即使交点重叠也算在内
更详细的几何讲解:http://dev.gameres.com/Program/Abstract/Geometry.htm#判断两线段是否相交
Sample Input
2
0.00 0.00 1.00 1.00
0.00 1.00 1.00 0.0 ...
【叉积+二分】POJ 2318 TOYS
http://poj.org/problem?id=2318
题意:求每个被割线分离的区间内各有多少个点?
Sample Input
5 6 0 10 60 0
3 1
4 3
6 8
10 10
15 30
1 5
2 1
2 8
5 5
40 10
7 9
4 10 0 10 100 0
20 20
40 ...
hdu 1166 敌兵布阵(用树状数组)
敌兵布阵
仍然是敌兵布阵那题,题目大意:给你一串数,然后会根据题意选择一点增加或减少,或者询问某区间的人数有多少?之前用线段树写了,而这题可以用树状树状来做,更加方便更加快速。
说下树状数组的三个主要函数:(神一样的函数,不只这些用处!!!)
1.lowbit(int i)
2.update(int i, int x)
3.sum(int i)
链接:http://acm.h ...
hdu 1166 敌兵布阵(我的第一个线段树)
敌兵布阵
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8364 Accepted Submission(s): 3460
Problem Description
C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Der ...
hdu 1754 I Hate It(最基本的线段树)
I Hate It
Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9465 Accepted Submission(s): 3534
Problem Description
很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到 ...
【扩展欧几里德】POJ 1061 + zoj 2657
http://poj.org/problem?id=1061
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1657
两题一模一样,只是无解时输出情况不同
首先由题意有【x+ms与y+ns建立等价关系,设次数为s】:
x+ms ≡ (y+ns)(mol L)
->(x+ms)%L = (y+ns)%L
->((x+ ...
hdu 1254 推箱子(广搜中有深搜!爽!)
推箱子
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1975 Accepted Submission(s): 501
Problem Description
推箱子是一个很经典的游戏.今天我们来玩一个简单版本.在一个M*N的房 ...