最新文章列表

【扩展欧几里得】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 ...
基德KID.1412 评论(0) 有2713人浏览 2011-11-07 18:00

【矩阵乘法+快速取幂模】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)两个数据。 ...
基德KID.1412 评论(0) 有1619人浏览 2011-08-15 14:54

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 ...
gzhu_101majia 评论(0) 有2357人浏览 2011-08-10 19:22

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 ...
gzhu_101majia 评论(0) 有3084人浏览 2011-08-10 19:20

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 ...
gzhu_101majia 评论(1) 有3889人浏览 2011-08-09 00:39

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 ...
gzhu_101majia 评论(0) 有1820人浏览 2011-08-09 00:09

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; ...
Midnight0101 评论(0) 有998人浏览 2011-08-08 17:04

【凸包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 ...
基德KID.1412 评论(2) 有1481人浏览 2011-08-08 16:18

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 ...
gzhu_101majia 评论(1) 有3183人浏览 2011-08-08 16:10

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, ...
gzhu_101majia 评论(0) 有999人浏览 2011-08-08 15:37

acm题目常用的预处理

#include<iostream> #include<sstream> #include<fstream> #include<vector> #include<list> #include<deque> #include<queue> #include<stack> #include ...
acm 
Midnight0101 评论(0) 有1207人浏览 2011-08-08 15:26

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 ...
gzhu_101majia 评论(0) 有1271人浏览 2011-08-08 15:25

【判线段相交】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 ...
基德KID.1412 评论(0) 有1569人浏览 2011-08-08 10:09

【叉积+二分】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 ...
基德KID.1412 评论(2) 有2861人浏览 2011-08-07 21:45

hdu 1166 敌兵布阵(用树状数组)

敌兵布阵       仍然是敌兵布阵那题,题目大意:给你一串数,然后会根据题意选择一点增加或减少,或者询问某区间的人数有多少?之前用线段树写了,而这题可以用树状树状来做,更加方便更加快速。 说下树状数组的三个主要函数:(神一样的函数,不只这些用处!!!) 1.lowbit(int i) 2.update(int i, int x) 3.sum(int i) 链接:http://acm.h ...
gzhu_101majia 评论(3) 有7592人浏览 2011-08-07 21:16

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 ...
gzhu_101majia 评论(1) 有1286人浏览 2011-08-07 21:07

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 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到 ...
gzhu_101majia 评论(1) 有2560人浏览 2011-08-07 20:57

高次幂取模的应用

此题乃师兄[ TT_last ]原创题!Orz膜拜一下 a simple problem Problem Description As we know , to caculate the sum ofis hard if the n is large,because today is Valentines Day,to make this problem more easy ,you only n ...
基德KID.1412 评论(2) 有1963人浏览 2011-08-07 11:02

【扩展欧几里德】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+ ...
基德KID.1412 评论(0) 有2623人浏览 2011-08-05 13:24

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的房 ...
gzhu_101majia 评论(0) 有3720人浏览 2011-08-04 20:20

最近博客热门TAG

Java(141746) C(73651) C++(68608) SQL(64571) C#(59609) XML(59133) HTML(59043) JavaScript(54918) .net(54785) Web(54513) 工作(54116) Linux(50906) Oracle(49876) 应用服务器(43288) Spring(40812) 编程(39454) Windows(39381) JSP(37542) MySQL(37268) 数据结构(36423)

博客人气排行榜

    博客电子书下载排行

      >>浏览更多下载

      相关资讯

      相关讨论

      Global site tag (gtag.js) - Google Analytics