![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
POJ&&ZOJ
wikioi_bai
时间并不会因为你的迷茫和迟疑而停留,就在你看这篇文章的同时,不知道有多少人在冥思苦想,在为算法废寝忘食,不知道有多少人在狂热地拍着代码,不知道又有多少提交一遍又一遍地刷新着OJ的status页面……
没有谁生来就是神牛,而千里之行,始于足下!
展开
-
ACM算法学习之贪心法---POJ3617(代码篇)
# include # include # define MAX 2000 int main(void) { int N; scanf("%d",&N); char S[MAX+8]; int i; int count = 0; int a = 0;原创 2014-08-01 00:37:07 · 933 阅读 · 0 评论 -
POJ 1562 Oil Deposits
Oil DepositsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 13490 Accepted: 7334DescriptionThe GeoSurvComp geologic survey company is responsible for原创 2015-02-04 16:48:58 · 440 阅读 · 0 评论 -
POJ Moving Tables
Moving TablesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 26679 Accepted: 8926DescriptionThe famous ACM (Advanced Computer Maker) Company has rented原创 2015-01-16 15:17:37 · 549 阅读 · 0 评论 -
POJ 2739 Sum of Consecutive Prime Numbers
Sum of Consecutive Prime NumbersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 19873 Accepted: 10891DescriptionSome positive integers can be represente原创 2015-01-16 11:20:48 · 563 阅读 · 0 评论 -
POJ 1321 棋盘问题
棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 23908 Accepted: 11839Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求原创 2015-01-18 14:11:38 · 623 阅读 · 0 评论 -
POJ 2159 Ancient Cipher
Ancient CipherTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 29060 Accepted: 9513DescriptionAncient Roman empire had a strong government system with va原创 2015-01-18 13:14:21 · 561 阅读 · 0 评论 -
ZOJ 1037 A - Gridland
GridlandTime Limit: 2 Seconds Memory Limit: 65536 KB BackgroundFor years, computer scientists have been trying to find efficient solutions to different computing probl原创 2014-12-13 21:47:35 · 768 阅读 · 0 评论 -
POJ 3094 Quicksum
QuicksumTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 14417 Accepted: 10050DescriptionA checksum is an algorithm that scans a packet of data and retur原创 2015-01-21 22:55:19 · 618 阅读 · 0 评论 -
POJ 2000 Gold Coins(简单模拟)
好久没来写题了,有很多原因,不多说了, 现在抓紧时间来开始刷题就行了。。。Gold CoinsTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 21467 Accepted: 13457DescriptionThe king pays his原创 2015-01-04 17:25:43 · 625 阅读 · 0 评论 -
POJ 1008 玛雅历
玛雅历Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 67726 Accepted: 20893Description上周末,M.A. Ya教授对古老的玛雅有了一个重大发现。从一个古老的节绳(玛雅人用于记事的工具)中,教授发现玛雅人使用了一个一年有365天原创 2015-01-21 23:43:07 · 572 阅读 · 0 评论 -
POJ 2387 Til the Cows Come Home(Dijkstra判重边)
Til the Cows Come HomeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 31748 Accepted: 10757DescriptionBessie is out in the field and wants to get back原创 2015-02-24 12:06:38 · 2491 阅读 · 0 评论 -
POJ 1797 Heavy Transportation(Dijkstra的稍加变形,三角形3边关系)
Heavy TransportationTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 21632 Accepted: 5754DescriptionBackground Hugo Heavy is happy. After the breakdo原创 2015-02-27 11:58:26 · 493 阅读 · 0 评论 -
POJ 3268 Silver Cow Party(两次Dijkstra求最大值)
Silver Cow PartyTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 13489 Accepted: 6075DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) convenientl原创 2015-02-27 13:05:01 · 496 阅读 · 0 评论 -
POJ 3126 Prime Path(BFS)
Prime PathTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12616 Accepted: 7145DescriptionThe ministers of the cabinet were quite upset by the message原创 2015-03-20 22:22:04 · 555 阅读 · 0 评论 -
POJ 2002 Squares(简单的二分)
SquaresTime Limit: 3500MS Memory Limit: 65536KTotal Submissions: 16948 Accepted: 6447DescriptionA square is a 4-sided polygon whose sides have equal length and原创 2015-03-09 23:52:00 · 505 阅读 · 0 评论 -
POJ 3069 Saruman's Army
Saruman's ArmyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4364 Accepted: 2249DescriptionSaruman the White must lead his army along a straight path原创 2014-12-10 13:29:05 · 545 阅读 · 0 评论 -
POJ 2262 Goldbach's Conjecture
Goldbach's ConjectureTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 38917 Accepted: 14906DescriptionIn 1742, Christian Goldbach, a German amateur mathe原创 2015-01-16 16:32:02 · 594 阅读 · 0 评论 -
POJ 3006 Dirichlet's Theorem on Arithmetic Progressions(素数筛+等差数列)
Dirichlet's Theorem on Arithmetic ProgressionsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16331 Accepted: 8203DescriptionIf a and d are relatively原创 2015-02-02 22:36:13 · 512 阅读 · 0 评论 -
ACM学习笔记之 数学问题----素数
素数是非常简单的一个概念,所谓素数,是指恰好有2个约数的整数,那么这两个数就是它本身和1。素数的判定方法有这么几种, (1)简单判定, (2)飞马测试 (3)r 算法 (4)数域筛法 (5) 埃式筛法 (6)区间筛法 那么先从最简单的判素方原创 2014-07-31 00:11:13 · 621 阅读 · 0 评论 -
ACM算法学习之贪心算法---字典序POJ3617(算法思想篇)
题目大意:给定一个长度为N的字符串S,要构造一个长度为N的字符串T ,起初,T是一个空串,随后反复进行下列任意操作 (1) 从S的头部删除一个字符,加到T的尾部 (2) 从S的尾部删除一个字符,加到T的尾部目标是要构造一个字典序竟可能小的字符串T。。。。什么是字典序呢,,这个概念,我刚开始接触的时候也很陌生,没事有度娘在,,原创 2014-07-31 23:40:13 · 991 阅读 · 0 评论 -
POJ 3641的新的学习与联想
素数的测试: 费尔马小定理:如果p是一个素数,且0 利用费尔马小定理,对于给定的整数n,可以设计素数判定算法,通过 计算d=a^(n-1)%n来判断n的素性,当d!=1时,n肯定不是素数,当d=1时,n很可能是素数. 二次探测定理:如果n是一个素数,且0 利用二次探测原创 2014-08-07 20:22:25 · 664 阅读 · 0 评论 -
转 :POJ 1182 食物链 ~ 并查集+路径压缩+代码
这题目有些挑战思维,我没有做出来,,,看到了神犇的博客,我就转载过来了。。转载 2014-08-11 17:21:09 · 720 阅读 · 0 评论 -
POJ1067取石子问题 【威佐夫博弈】
题目大意:有两堆石子,两人轮流取,每次可以取一堆中的任意个,或两堆中取相同多个。谁先取光所有堆谁赢。问先手能否获胜。分析:威佐夫博弈,如果是奇异态则先手输,否则先手赢。直接套用公式判断是否为奇异态,设第一堆有a个,第二堆有b个,二者的差为c个。奇异态近似符合公式b/a=a/c。即近似符合黄金分割。严格符合公式a=floor(c/黄金分割数)。黄金分割数=(sqrt(5)-1)/2。原创 2014-09-18 23:12:09 · 708 阅读 · 0 评论 -
ZOJ 题目分类,学校的一个巨巨做的。
DP:1011 NTA 简单题1013 Great Equipment 简单题1024 Calendar Game 简单题1027 Human Gene Functions 简单题1037 Gridland 简单题原创 2014-11-25 20:35:01 · 879 阅读 · 0 评论 -
POJ 1222 EXTENDED LIGHTS OUT
#include #include #include #include using namespace std;bool map[10][10];bool press[10][10];int add4(int x,int y){ int s=map[x][y]+press[x][y]+press[x-1][y]+press[x][y-1]+press[x][y+1];原创 2014-10-20 21:00:36 · 485 阅读 · 0 评论 -
POJ 1129 图的四色定理
题目翻译:当一个广播电台在一个非常大的地区,广播站会用中继器来转播信号以使得每一个接收器都能接收到一个强烈的信号。然而,每个中继器必须慎重选择使用,使相邻的中继器不互相干扰。如果相邻的中继器使用不同的频道,那么就不会相互干扰。由于无线电频道是一有限的,一个给定的网络所需的中继频道数目应减至最低。编写一个程序,读取一个中继网络,然后求出需要的最低的不同频道数。代码:原创 2014-11-29 22:33:07 · 752 阅读 · 0 评论 -
POJ 1054 The Troublesome Frog
The Troublesome FrogTime Limit: 5000MS Memory Limit: 100000KTotal Submissions: 10607 Accepted: 3144Case Time Limit: 500MSDescriptionIn Korea, the naughtiness原创 2014-11-28 23:47:30 · 629 阅读 · 0 评论 -
POJ 1077 八数码问题
一、题目DescriptionThe 15-puzzle has beenaround for over 100 years; even if you don't know it by that name, you've seenit. It is constructed with 15 sliding tiles, each with a number from 1原创 2014-11-29 22:36:45 · 1159 阅读 · 0 评论 -
POJ 1321 棋盘问题
棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 23798 Accepted: 11778Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编原创 2015-01-06 19:06:57 · 540 阅读 · 0 评论 -
POJ 2718 Smallest Difference
Smallest DifferenceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4688 Accepted: 1303DescriptionGiven a number of distinct decimal digits, you can form原创 2014-12-01 13:34:20 · 571 阅读 · 0 评论 -
ACM POJ训练计划
OJ上的一些水题(可用来练手和增加自信) (poj3299,poj2159,poj2739,poj1083,poj2262,poj1503,poj3006,poj2255,poj3094) 初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法转载 2015-01-27 17:15:10 · 748 阅读 · 0 评论 -
POJ 1852 Ants
AntsTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 10322 Accepted: 4578DescriptionAn army of ants walk on a horizontal pole of length l cm, each with a原创 2014-12-05 13:17:02 · 544 阅读 · 0 评论 -
POJ 2456 Aggressive cows(贪心+二分)
Aggressive cowsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6948 Accepted: 3462DescriptionFarmer John has built a new long barn, with N (2 His原创 2015-03-10 22:53:05 · 514 阅读 · 0 评论