一道簡單的並查集,稍微麻煩了點,注意一下細節就可以了,沒什麼難度。。題目:Wireless NetworkTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 11457 Accepted: 4884DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a
一道簡單題,以前用c++寫過,今天看了點Java,就用Java寫了一下,,,,,,題目:I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.A,B must be positive.輸入The first line of the input contains an integer T(1<=T<=
來源:http://acm.hdu.edu.cn/showproblem.php?pid=4000題意:給你一個1到n的排列,讓求滿足posx < posy < posz && x < z < y 的組數有多少。思路:樹狀數組的題目。首先我們可以得到所有滿足題目條件的組數為x < y ? z 減去 x < y < z的數目。其中x < y ? z 是x < y ,但是y 與 z的關係不知道,x 與z
KM演算法求的是二分圖最優匹配,權值最大。當讓求權值最小時,只需把原來的權值都改成負值即可,,其他的都不用變。。。。。。。。。題目:Going HomeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12101 Accepted: 6261DescriptionOn a grid map there are n little men and n houses. In each unit time, every
二分圖最小路徑覆蓋==點數n--二分圖最大匹配,,,知道了這個公式,,又是一道水題。。。二分圖方面的題,,關鍵是建圖,把圖建好了,剩下的就簡單了。。。題目:Air RaidTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4600 Accepted: 2722DescriptionConsider a town where all the streets are one-way and each street
sol:容斥原理。。。ANS = C (row*col , k ) (row,col均是剩餘的行和列~~~) >_<|| #include <cstdio>#include <cstring>using namespace std;const int maxn=500;const int MOD=1000007;int C[maxn+10][maxn+10];void
終於在POJ上碰到一道簡單題,,不容易啊。。類比,可以輕鬆水過。。題目:Tanning SalonTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5582 Accepted: 3052DescriptionTan Your Hide, Inc., owns several coin-operated tanning salons. Research has shown that if a customer