题目描述 Hehe keeps a flock of sheep, numbered from 1 to n and each with a weight wi. To keep the sheep healthy, he prepared some training for his sheep. Everytime he selects a pair of numbers (a,b), and chooses the sheep with number a, a+b, a+2b, - to g…
并查集的经典题目: CSUOJ 1601: War Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 247 Solved: 70[Submit][Status][Web Board] Description AME decided to destroy CH’s country. In CH’ country, There are N villages, which are numbered from 1 to N. We say two vill…
1601. AntiCAPS Time limit: 0.5 second Memory limit: 64 MB The blonde Angela has a new whim: internet chats. Of course, as any blonde, shewrites her messages using the upper case. You are the moderator of Angela'sfavorite chat and you're fed up with h…
先上题目: Problem 1601 Alibaba's treasures Accept: 332 Submit: 636Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description In the story of “Alibaba and forty robbers”, Alibaba uses his clever wit to overcome the ferocious enemy, and inher…
1601: 名字缩写 时间限制: 1 Sec 内存限制: 128 MB 提交: 288 解决: 80 [提交][状态][讨论版] 题目描述 Noname老师有一个班的学生名字要写,但是他太懒了,想少写几个字母.很快他发现这是可行的,例如下面的学生名单: Davidson Davis Dixon Smith 可以缩写为 David Davis Di S David 指明Davidson外,不可能是其他三位同学名字的前缀.S仅能代表Smith.在确保能无歧义指明同学的前提下,Noname老师总是…
MST , kruskal 直接跑 ---------------------------------------------------------------------- #include<cstdio> #include<algorithm> #include<vector> #include<cstring> #include<iostream> #define rep( i , n ) for( int i = 0 ; i <…
题目 题目 分析 双向bfs,对着书打的,我还调了好久. 代码 #include<cstdio> #include<cstring> #include<cctype> #include<queue> using namespace std; const int maxs=20,maxn=150; const int dx[]={1,-1,0,0,0},dy[]={0,0,1,-1,0}; int s[3],t[3]; int deg[maxn…