Data structure, stack application!
# Include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include #
Http://acm.zju.edu.cn/onlinejudge/showProblem.do? Problemcode = 3278.
A good second... The first time I write such a binary
# Include # include # include # include # include # include # include # include # include # include #
http://acm.hdu.edu.cn/showproblem.php? PID = 2069
# Include using namespace STD; int A [5] = {1001, 2600, 50}, DP [] []; int main () { // freopen ("a.txt", "r", stdin); int N; memset (DP, 0, sizeof (DP); DP [0] [0] = 1; int I, j, k; for
To solve this problem, you must first reduce the point to the point without any inbound edge, and then find the edge with the smallest weight. Note: There may be duplicate edges, so you can see sample3!
Because vector and stack are used, the speed
Http://acm.zju.edu.cn/onlinejudge/showProblem.do? Problemcode = 3471.
Bitwise operations are really a god's saying...
Here, I use 1 to indicate that the attack has exploded, and 0 to indicate that the attack has not exploded. I use binary to record
For a typical line segment tree question, if you use a general method that goes deep into each node to modify the value, it will be TLE. Therefore, a new term "latency optimization" is introduced here ", it means that each node line segment has an
#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;#define LL long long#define PI acos(-1.0)#define N 105#define MAX INT_MAX#define MIN
Note that N points have n-1 edges.
#include#include#include#includeusing namespace std;int n;char a[502][10];int b[502][5] = {0};int map[502][502];int dis[502];bool flag[502];int result;int mi(int i, int j){ int sum = 0; int temp; for(int k = 1;
Http://acm.timus.ru/problem.aspx? Space = 1 & num = 1306 -- a good "water question"
Start with sort, and the result is "test... Later, I saw other people know that they can use the heap To Do This. It also took a whole night to study the
The sample of zoj is incorrect. The problem is to find the Minimum Spanning Tree and the longest path.
#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include
Http://acm.timus.ru/problem.aspx? Space = 1 & num = 1014
Although the question is watery, the data is overcast, and 0 returns 10 !!! I wa several times, and I also need to use long to prevent overflow.
#include #include #include #include #include
# Include # include # include # include # include # include # include # include # include # include # include # include # include # include using namespace STD; # define ll long # define PI ACOs (-1) # define n 50010 # define INF 999999
Http://livearchive.onlinejudge.org/index.php? Option = com_onlinejudge & page = show_problem & problem = 1722
BFS is very brain-damaged. Do not mark it when looking for water!
#include#include#include#include#include#include#include#include#include#
Http://poj.org/problem? Id = 2187
It is obvious that no direct violence is allowed here (50000*50000) =. =
We need to know that the farthest 2.1 is the vertex on the convex hull, so first construct the convex hull, and then enumerate to find the
After several months, I re-performed the task and finally got the AC!
The question seems to be graph theory, but the fact is matrix multiplication. According to the discrete mathematics book, bij indicates the number of paths from AI to AJ with a
Http://acm.zju.edu.cn/onlinejudge/showProblem.do? Problemid = 3618
It hurts. Use CIN to enter the letter "tle !!!
#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace
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