随笔分类 - OJ -- USACO
摘要:Description 上下有两个长度为n、位置对应的序列A、B, 其中数的范围均为1~n。若abs(A[i] B[j]) include include include include define inf 0x7f7f7f7f using namespace std; typedef long
阅读全文
摘要:Description 给定长度为2N的序列,1~N各处现过2次,i第一次出现位置记为ai,第二次记为bi,求满足ai include include include include define lowbit(x) ((x)&( x)) define inf 0x7f7f7f7f using na
阅读全文
摘要:Description 有一幅n n的方格图,n include include include include define inf 0x7f7f7f7f using namespace std; typedef long long ll; typedef unsigned int ui; typ
阅读全文
摘要:Description Having become bored with standard 2 dimensional artwork (and also frustrated at others copying her work), the great bovine artist Picowso
阅读全文
摘要:Description 约翰到奶牛商场里买工具.商场里有K(1≤K≤100).种工具,价格分别为1,2,…,K美元.约翰手里有N(1≤N≤1000)美元,必须花完.那他有多少种购买的组合呢? Input A single line with two space separated integers:
阅读全文
摘要:Description Farmer John's N (1 include include include include define inf 0x7f7f7f7f using namespace std; typedef long long ll; typedef unsigned int u
阅读全文
摘要:Description 农民John的某 N 头奶牛 (1 include include include include define inf 0x7f7f7f7f using namespace std; typedef long long ll; typedef unsigned int ui
阅读全文
摘要:Description One of the most popular attractions at the county fair is the climbing wall. Bessie wants to plan her trip up the wall in advance and need
阅读全文
摘要:Description Farmer John has returned to the County Fair so he can attend the special events (concerts, rodeos, cooking shows, etc.). He wants to atten
阅读全文
摘要:Description The cows have been sent on a mission through space to acquire a new milking machine for their barn. They are flying through a cluster of s
阅读全文
摘要:Description Farmer John is trying to figure out when his last shipment of feed arrived. Starting with an empty grain bin, he ordered and received F1 (
阅读全文
摘要:Description Bessie is in Camelot and has encountered a sticky situation: she needs to pass through the forest that is guarded by the Knights of Ni. In
阅读全文
摘要:Description 为了避免餐厅过分拥挤,FJ要求奶牛们分3批就餐。每天晚饭前,奶牛们都会在餐厅前排队入内,按FJ的设想所有第3批就餐的奶牛排在队尾,队伍的前端由设定为第1批就餐的奶牛占据,中间的位置就归第2批就餐的奶牛了。由于奶牛们不理解FJ的安排,晚饭前的排队成了一个大麻烦。 第i头奶牛有一
阅读全文
摘要:Description 今天是贝茜的生日,为了庆祝自己的生日,贝茜邀你来玩一个游戏. 贝茜让N(1≤N≤100000)头奶牛坐成一个圈.除了1号与N号奶牛外,i号奶牛与i l号和i+l号奶牛相邻.N号奶牛与1号奶牛相邻.农夫约翰用很多纸条装满了一个桶,每一张包含了一个独一无二的1到1,000,000
阅读全文
摘要:Description 公交车一共经过N(1 include include include include define inf 0x7f7f7f typedef long long ll; typedef unsigned int ui; typedef unsigned long long u
阅读全文
摘要:Description 约翰遭受了重大的损失:蟑螂吃掉了他所有的干草,留下一群饥饿的牛.他乘着容量为C(1≤C≤50000)个单位的马车,去顿因家买一些干草. 顿因有H(1≤H≤5000)包干草,每一包都有它的体积Vi(l≤Vi≤C).约翰只能整包购买,他最多可以运回多少体积的干草呢? Input
阅读全文