1681: [Usaco2005 Mar]Checking an Alibi 不在场的证明 # Time Limit: 5 Sec Memory Limit: 64 MB Submit: 250 Solved: 178 [Submit][Status][Discuss]
Description # A crime has been comitted: a load of grain has been taken from the barn by one of FJ’s cows. FJ is trying to determine which of his C (1 <= C <= 100) cows is the culprit. Fortunately, a passing satellite took an image of his farm M (1 <= M <= 70000) seconds before the crime took place, giving the location of all of the cows. He wants to know which cows had time to get to the barn to steal the grain. Farmer John’s farm comprises F (1 <= F <= 500) fields numbered 1..F and connected by P (1 <= P <= 1,000) bidirectional paths whose traversal time is in the range 1..70000 seconds (cows walk very slowly). Field 1 contains the barn. It takes no time to travel within a field (switch paths). Given the layout of Farmer John’s farm and the location of each cow when the satellite flew over, determine set of cows who could be guilty. NOTE: Do not declare a variable named exactly ’time’. This will reference the system call and never give you the results you really want.
hdu 3315 题目链接
题意:两个人分别各有 n 个怪物。进行 n 场 pk。每只怪物必须恰好进行一场 pk。如果先手的第 i 只怪物赢,会获得 v[i] 的 val,输会减少 v[i] 的 val。给出两个人 n 只怪物的血量和攻击力。先手的初始战斗顺序为 1,2,3..n(后手的战斗顺序一直都是 1,2,3..n)现在问能否通过调整顺序使得先手获得的 val 最大,如果这个 val 大于 0,表示先手可以赢。如果可以赢,那么还要求调整后的顺序和原始顺序的相似度,并且使得相似度尽可能大(If there are multiple orders, you should choose the one whose order changes the least from the original one)
hdu 2853 题目链接
题意:n 个公司,m 个任务(m>=n),一个公司只能对应一个任务,一个任务也只能对应一个公司。给出一个 n*m 的 mat,表示每个公司对应每个任务产生的 val。然后给出 n 个数,表示初始钦定(雾)这 n 个公司分别做哪些任务。但是可能初始的安排得到的 val 不是最大的。我们现在想得到最大的 val,并且保证改变的安排数最少。求安排后得到的 val 比初始安排大多少,以及需要改变的安排数量。
hdu 3718题目链接
题意:东西分类作业,有n个东西,k组,m个学生,不同种类的东西用不同的字母表示,相同种类的用同一个字母表示。不同学生和标准答案之间可能表示同一类东西用的字母不同,但是字母只是一个标号(But the LABEL of group doesn’t make sense and the LABEL is just used to indicate different groups. ) 给出事物分类的标准答案和每个学生的答案现在问每个学生的正确率是多少。
hdu 3722题目链接
题意:n个串,a串放在b串前面的val值是“The score of sticking two cards is the longest common prefix of the second card and the reverse of the first card”.问如何放使得总的val最大。
思路:先暴力处理出每两个的权值。。2002001000的复杂度。。还是可以接受的。。
hdu 3395题目链接
题意:鱼,一些鱼认为自己是汉子,然后他会去和他认为是妹子的鱼啪啪啪,然后被啪啪啪的妹子就会产卵? 卵的val是它parent的val的异或。给出n,为鱼的数量,然后给出一个n*n的 mat,a[i][j]==1表示第i条鱼认为第j条鱼是妹子。问卵的最大val之和是多少。需要注意的是:每条鱼最多可以去和一个妹子啪,并且可以作为妹子被啪一次(这两个是独立的。。。) (Each fish can attack one other fish and can only be attacked once)