POJxxxx题目分类
文章平均质量分 85
# POJxxxx题目分类
OPA_heiyaa
嗨嗨嗨
展开
-
POJ--2195--Matrix--平面修改+单点查询
Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 <= i, j <= N).We can change the matrix in the...原创 2020-05-03 09:44:44 · 158 阅读 · 0 评论 -
POJ--1195--二维树状数组--单点更新+平面查询
有一个正方形游戏背包,大小为S*S(1<=S<=1024)。含有很多小格子,小格子编号从0开始,直到S-1。每一个格子里有一定数量的物品,同时每一个格子的物品里的数目也是不断变化的,现在要一边进行修改某些单位格子内的物品的数目,同时也要询问某些区域的手机数目。 数据保证每个格子内物品数目一直在int范围内,查询的格子内的物品数目也在int范围内Input有多组数据,每一行先输入...原创 2020-05-02 20:46:21 · 192 阅读 · 0 评论 -
POJ--2549--折半枚举
Given S, a set of integers, find the largest d such that a + b + c = d where a, b, c, and d are distinct elements of S.InputSeveral S, each consisting of a line containing an integer 1 <= n <...原创 2020-02-08 14:53:16 · 216 阅读 · 0 评论 -
POJ--1852--A
An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it immediatelly falls off it. When two ants meet they tur...原创 2020-02-03 14:22:00 · 180 阅读 · 0 评论 -
POJ--3684--AA
Physics ExperimentTime Limit:1000MS Memory Limit:65536K Total Submissions:4445 Accepted:1562 Special Judge DescriptionSimon is doing a physics experiment withNide...原创 2020-02-03 14:19:14 · 274 阅读 · 0 评论 -
POJ--2674--AAA
The Disc, being flat, has no real horizon. Any adventurous sailors who get funny ideas from staring at eggs and oranges for too long and set out for the antipodes soon learned that the reason why dist...原创 2020-02-03 14:14:22 · 133 阅读 · 0 评论 -
POJ--3061--尺取法
A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length o...原创 2020-02-02 10:57:52 · 249 阅读 · 0 评论 -
POJ--3111--最大化平均值
Demy hasnjewels. Each of her jewels has some valueviand weightwi.Since her husband John got broke after recent financial crises, Demy has decided to sell some jewels. She has decided that she w...原创 2020-02-02 09:28:44 · 218 阅读 · 0 评论 -
POJ--2456--cows(最大化最小值)
Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi <= 1,000,000,000).His C (2 <= C &...原创 2020-02-01 15:39:32 · 233 阅读 · 0 评论 -
POJ--1064--(二分)
Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the most honest contest ever. It was decided to co...原创 2020-02-01 15:36:28 · 153 阅读 · 0 评论 -
POJ--3685--Matrix--(二分再二分)
有一个N阶方阵 第i行,j列的值Aij =i2+ 100000 ×i+j2- 100000 ×j+i×j,需要找出这个方阵的第M小值.Input第一行输入T代表测试组数.每个测试用例包含2个数字N,M表示在N阶方阵找出第M大值,N(1 ≤N≤ 50,000) andM(1 ≤M≤N×N). 每两个测试用例之间可能有空行Output输出方阵的第...原创 2020-02-01 15:32:43 · 171 阅读 · 0 评论 -
POJ--3579--查找第k大的值
GivenNnumbers,X1,X2, ... ,XN, let us calculate the difference of every pair of numbers: ∣Xi-Xj∣ (1 ≤i<j≤N). We can getC(N,2)differences through this work, and now your task is to find th...原创 2020-02-01 15:31:01 · 277 阅读 · 0 评论 -
POJ--2976--最大化平均值
In a certain course, you takentests. If you getaiout ofbiquestions correct on testi, your cumulative average is defined to be ...原创 2020-02-01 15:26:22 · 174 阅读 · 0 评论 -
POJ--3045--贪心求解
Farmer John's N (1 <= N <= 50,000) cows (numbered 1..N) are planning to run away and join the circus. Their hoofed feet prevent them from tightrope walking and swinging from the trapeze (and the...原创 2020-04-26 10:56:17 · 147 阅读 · 0 评论 -
POJ--3104--Drying--(经典打字员问题)
It is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring process. Jane has decided to use a radiator to make drying faster. But ...原创 2020-02-01 15:21:09 · 571 阅读 · 0 评论 -
POJ--3273--最大化最小值
Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤moneyi≤ 10,000) that h...原创 2020-02-01 15:18:16 · 243 阅读 · 0 评论 -
POJ--3258--最大化最小值
Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river with a ro...原创 2020-02-01 15:14:32 · 145 阅读 · 0 评论 -
POJ--3076--SudokuAAAA
A Sudoku grid is a 16x16 grid of cells grouped in sixteen 4x4 squares, where some cells are filled with letters from A to P (the first 16 capital letters of the English alphabet), as shown in figure 1...原创 2020-01-29 19:14:09 · 205 阅读 · 0 评论 -
POJ--3074--SudokuAAA
In the game of Sudoku, you are given a large 9 × 9 grid divided into smaller 3 × 3 subgrids. For example,. 2 7 3 8 . . 1 . . 1 . . . 6 7 3 5 . ...原创 2020-01-29 19:05:43 · 354 阅读 · 0 评论 -
POJ--2918--SudokuAA
Tom is a master in several mathematical-theoretical disciplines. He recently founded a research-lab at our university and teaches newcomers like Jim. In the first lesson he explained the game of Tudok...原创 2020-01-29 19:01:46 · 245 阅读 · 0 评论 -
POJ--2676--SudokuA
Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 to 9. The othe...原创 2020-01-29 18:58:54 · 188 阅读 · 0 评论 -
POJ--1979--经典水洼问题思路
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can'...原创 2020-01-26 12:39:22 · 329 阅读 · 0 评论 -
POJ--3050--BFS
The cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes into which to hop, the cows create a 5x5 rectilinear grid of digits parallel to the x an...原创 2020-01-26 12:36:33 · 312 阅读 · 1 评论 -
POJ--3669--DFS
Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way to a sa...原创 2020-01-26 12:33:04 · 317 阅读 · 0 评论 -
POJ--3009--深度优先搜索
On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an ice game board on which a square mesh is mark...原创 2020-01-26 12:31:50 · 149 阅读 · 0 评论 -
POJ--3187--Backward Digit Sums(全排列枚举)
FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numbers to produce a new list with one fewer number. ...原创 2020-01-25 19:50:32 · 272 阅读 · 0 评论 -
POJ--2718--Smallest Difference(全排列枚举)
Given a number of distinct decimal digits, you can form one integer by choosing a non-empty subset of these digits and writing them in some order. The remaining digits can be written down in some orde...原创 2020-01-25 19:47:27 · 556 阅读 · 0 评论 -
POJ--3468--A Simple Problem with Integers(线段树)
You haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the ...原创 2020-01-15 12:54:34 · 461 阅读 · 2 评论 -
POJ--2299--线段树+离散化查找逆序对
In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted i...原创 2020-01-13 16:07:47 · 137 阅读 · 0 评论 -
POJ--1703--Find them, Catch them--并查集
题目链接:http://poj.org/problem?id=1703警方决定捣毁两大犯罪团伙:龙帮和蛇帮,显然一个帮派至少有一人。该城有N个罪犯,编号从1至N(N<=100000。将有M(M<=100000)次操作。D a b 表示a、b是不同帮派A a b 询问a、b关系Input多组数据。第一行是数据总数 T (1 <= T <= 20)每组数据第一行...原创 2020-01-13 10:49:53 · 499 阅读 · 0 评论 -
POJ--2236--并查集
An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the n...原创 2020-01-12 10:09:40 · 166 阅读 · 0 评论 -
POJ--3641--快速幂运算模板,素数筛
//pow(x,n)%modtypedef long long ll;ll mod_pow(ll x,ll n,ll mod){//时间复杂度O(logn) ll ans=1; while(n>0){ if(n&1) ans=ans*x%mod; x=x*x%mod; n>>=1; } return ans;} 素数筛,但是在大...原创 2020-01-11 14:57:34 · 186 阅读 · 0 评论 -
POJ--3723--并查集
Windy has a country, and he wants to build an army to protect his country. He has picked upNgirls andMboys and wants to collect them to be his soldiers. To collect a soldier without any privilege,...原创 2020-01-11 10:41:53 · 493 阅读 · 0 评论 -
POJ--2377--Kruskal()生成树模板
Kruskal()生成树模板://改进一下,适合一最小最大生成树#include<iostream>#include<cstring>#include<algorithm>using namespace std;const int MAX_E=20100;//注意范围一定要开大struct edge{ int u,v; long long ...原创 2020-01-11 09:27:41 · 230 阅读 · 0 评论 -
POJ--1060--Modular multiplication of polynomials
Consider polynomials whose coefficients are 0 and 1. Addition of two polynomials is achieved by 'adding' the coefficients for the corresponding powers in the polynomials. The addition of coefficients ...原创 2020-01-10 21:58:26 · 786 阅读 · 0 评论 -
POJ--104--John's trip (待理解)(欧拉回路)
Little Johnny has got a new car. He decided to drive around the town to visit his friends. Johnny wanted to visit all his friends, but there was many of them. In each street he had one friend. He star...原创 2020-01-10 18:15:00 · 222 阅读 · 0 评论 -
POJ--2031--最短路径问题
You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task.The space...原创 2020-01-10 17:04:36 · 503 阅读 · 0 评论 -
POJ--1287--最小生成树
You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect pairs of p...原创 2020-01-10 17:01:32 · 137 阅读 · 0 评论 -
POJ--1847--最短路径问题
Tram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going out of the intersection. ...原创 2020-01-10 16:58:37 · 262 阅读 · 0 评论 -
POJ--2253--Frogger(最短路径)
Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists' sun...原创 2020-01-10 16:55:09 · 393 阅读 · 0 评论