Saving princess Claire Shortest Path

A very watery question during the competition .. Not submitted .. Tears ..View code #include#include#include#include#include#include#include#includeusing namespace std;int N,M,C,n, maxn;int xx[]={1,0,0,-1};int yy[]={0,1,-1,0};char

Poj 3274 gold balanced lineup

I really didn't think I could use Hash, so I had a new understanding of hash. Algorithm: 1. Binary enumeration, TLEView code #include#include#include#include#include#include#includeusing namespace std;int N, k;struct node{ int

Poj 1125 Floyd

Question: It takes the shortest time to transmit information from a vertex to another vertex. Number of the person who receives the information at the latest. Algorithm: 1. the Dijkstra algorithm can only find the single-source shortest path at a

Poj 1328 greedy

Algorithm: 1. Find the circle range covering the island, and convert the problem into a minimum vertex to ensure that each interval has at least one vertex. 2. sort by left end of the Interval 3. Update RadView code # Include # include # include

Poj 2240 longest Enumeration

Question: Ask you if you can use these exchange rates to increase the original currency. Algorithm: 1. It must be a loop, not a loop output No, And the loop is the longest. You can use spfa to find the longest path and determine whether it

Poj 1789 min Spanning Tree

1A, no more than 1a on poj for a long time .. Algorithm: Bare minimal spanning tree. Read the meaning of the question carefully.View code #include#include#include#includeusing namespace std;struct node{ int a, b, num; bool operator

Poj 2485 min Spanning Tree

Algorithm: It is also the bare minimum spanning tree.View code #include#include#include#includeusing namespace std;struct node{ int a, b, num; bool operator sum ) sum = edge[i].num; } } printf("%d\n",sum);}int main( ){ int T; scanf("%

Poj 1094 topological sorting

Tragedy: This question is terrible. First of all, the question is not carefully understood, and the question is misunderstood. After reading the meaning of the question, I had to judge whether there was a loop when I was not sure. When the loop is

Splay Tree operations-array

It is very convenient to delete elements from the stretch tree ..View code # Include # Include # Include # Include # Include # Include # Include Using namespace STD;Int left [100010], right [100010], PF [100010];Int value [100010];Int num [100010];

I hate it stretch tree

View code # Include # Include # Include # Include # Include # Include # Include Using namespace STD;Int left [200100], right [200100], maxn [200100], PF [200100], value [200100], root; // a point with a value of-1 indicates that the node is

STL balancing tree data structure container

1. Map Key can correspond to only one ing value. It supports insertion, deletion, search (count, find), modification (delete this value first, and then insert the modified value), sorting, ing (discrete) multimap the same key value can have multiple

HDU encoding 1020

Encoding Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)Total submission (s): 11610 accepted submission (s): 4882Problem descriptiongiven a string containing only 'a'-'Z', We cocould encode it using the following

Poj 1811 prime test

Re all the time, it is said that it is a stack explosion .... Import java. Math. biginteger;Import java. util. collections;Public class prime {Public static void main (string ARGs []) {Int N, flag = 0, I;Biginteger a, B, T, C, V;Cin = new partition

The center of gravity

Loading editor...The center of gravity Time Limit: 3000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 2423 accepted submission (s): 1324Problem descriptioneveryone know the story that how Newton discovered the

Hollow triangle HDU 2091

Hollow triangle Time Limit: 1000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 10699 accepted submission (s): 3040Problem description hollows a character triangle to save material costs and reduce weight, but

Tree array for interval and

1 #include 2 #include 3 int N,a[60000]; 4 int lowbit(int x) 5 { 6 7 return x&(-x); 8 } 9 void add(int i,int x)10 {11 while(i12 {13 a[i]+=x;14 i+=lowbit(i);15 }16 }17 int sum(int i)18 {19 int sum=0;20

Saving HDU 2111

Saving HDU Time Limit: 3000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 2171 accepted submission (s): 977Problem description As mentioned above, the Haidong group is facing internal and diplomatic

Hide handkerchief HDU 2104

Hide handkerchief Time Limit: 10000/3000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 1107 accepted submission (s): 530Problem descriptionthe Children's day has passed for some days. Has you remembered

Asteroids! HDU 1240

Simple 3D space BFS .... #include #include #include #include #include using namespace std;char map[20][20][20];int N, a, b, c, d, e, f, f1;int xx[ ] = {0, 1, 0, -1, 0, 0};int yy[ ] = {1, 0, -1, 0, 0, 0};int zz[ ] = {0, 0, 0, 0 , 1, -1};struct

Summary of DFS BFS

In the past two or three days, I have done a lot of DFS and BFS questions .. First, BFs .. 1001. Naked BFS... note mark .. Otherwise, MLE and runtime error will occur .. BFS occupies a lot of memory .. Keep joining. And DFS .. It is easy to use

Total Pages: 64722 1 .... 55711 55712 55713 55714 55715 .... 64722 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.