
POJ
SY_Pistachio
低调的前行,越努力越幸运!
展开
-
Blocks(poj 1390) 动态规划 方盒游戏 (升维——三维)
Blocks 点击转到Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 6197 Accepted: 2557 DescriptionSome of you may have played a game called 'Blocks'. There are n blocks in ...原创 2018-08-15 10:32:51 · 638 阅读 · 1 评论 -
组合数学——置换群 POJ 2396 Permutations
点击转到1. 4,1,5,2,3->2,4,3,1,5->1,2,5,4,3->4,1,3,2,5->2,4,5,1,3->1,2,3,4,5->4,1,5,2,3 要经过6次映射能变回4,1,5,2,3(循环节的最小公倍数)#include<iostream>#include<cstdio> #include&l...原创 2018-10-29 17:07:14 · 404 阅读 · 0 评论 -
中国剩余定理应用 (poj 1006 Biorhythms)
Biorhythms1.中国剩余定理回顾: 这个问题源自于我国数学古书《孙子算经》中的一道问题:“今有物,不知其数,三三数之,剩二;五五数之,剩三;七七数之,剩二。问物几何?”意思是一个整数除以三余二,除以五余三,除以七余二,求这个整数(满足条件且最小)。做法是: n%3==2,n%5==3,n%7==2,并且3,5,7折三个数是互质的。 我们找到使(5*7*a)%...原创 2018-10-23 19:32:23 · 398 阅读 · 0 评论 -
A Simple Problem with Integers 线段树(POJ 3468 区间查询 区间值更改 )
A Simple Problem with Integers(点击转到)Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 140821 Accepted: 43675 Case Time Limit: 2000MS DescriptionYou have N integers,...原创 2018-08-21 17:43:58 · 171 阅读 · 0 评论 -
POJ 1258 最小生成树模版———prim算法 (prioirty_queue实现 Prim + 堆 完成)
输入图的邻接矩阵,求最小生成树的总权值(多组数据)InputThe input includes several cases. For each case, the first line contains the number of farms, N (3 <= N <= 100). The following lines contain the N x N conectivi...原创 2018-08-24 11:40:39 · 316 阅读 · 0 评论 -
POJ 1258 最小生成树模版———Kruskal算法
输入图的邻接矩阵,求最小生成树的总权值(多组数据)InputThe input includes several cases. For each case, the first line contains the number of farms, N (3 <= N <= 100). The following lines contain the N x N conectivi...原创 2018-08-24 10:18:18 · 228 阅读 · 0 评论 -
Wormholes ---Bellman-Ford算法 最短路径 负权值回路判断 (POJ3259)
WormholesTime Limit: 2000MS Memory Limit: 65536K Total Submissions: 64151 Accepted: 23944 DescriptionWhile exploring his many farms, Farmer John has discovered a number of amaz...原创 2018-08-28 11:51:00 · 569 阅读 · 0 评论 -
食物链(POJ 1182 并查集)
食物链(点击转到)Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 91950 Accepted: 27715 Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B...原创 2018-08-20 20:29:46 · 240 阅读 · 0 评论 -
Candies———最短路径, Dijkstra(用prioirty_queue实现 dijkstra + 堆的 POJ 3159 Candies)
CandiesTime Limit: 1500MS Memory Limit: 131072K Total Submissions: 37835 Accepted: 10647 DescriptionDuring the kindergarten days, flymouse was the monitor of his class. Occasio...原创 2018-08-27 09:15:23 · 332 阅读 · 0 评论 -
迷宫问题(广搜 POJ 3984)
迷宫问题Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 33792 Accepted: 19239 Description定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, ...原创 2018-08-18 11:13:23 · 231 阅读 · 0 评论 -
Catch That Cow(广度搜索 poj 3278)
Catch That Cow(点击转到) Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 119275 Accepted: 37221 Description Farmer John has been informed of th...原创 2018-08-18 09:46:03 · 161 阅读 · 0 评论 -
Dividing the Path(POJ 灌溉草场) 动态规划 优先队列
Dividing the Path点击转到Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5588 Accepted: 1968 DescriptionFarmer John's cows have discovered that the clover growing along ...原创 2018-08-15 16:35:54 · 509 阅读 · 0 评论 -
POJ 2010 G - Moo University - Financial Aid(最小化第K大)
G - Moo University - Financial Aid1.题目含义: 奶牛学校招生,c头奶牛报名,要选n头(n为奇数),学校是义务制,所以每头奶牛的学费都由学校负责。每头奶牛都由自己的考试分数和它需要花的学费,学校总共有f的资金,问合法招生方案中中间分数(即排名第(n+1)/2)最高的是多少。#include <iostream>#include &l...原创 2018-11-08 09:30:46 · 230 阅读 · 0 评论