题目链接: https://nanti.jisuanke.com/t/30994 Dlsj is competing in a contest with n (0 < n \le 20)n(0<n≤20) problems. And he knows the answer of all of these problems. However, he can submit ii-th problem if and only if he has submitted (and passed, of c…
Resource Archiver Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 100000/100000 K (Java/Others)Total Submission(s): 2382 Accepted Submission(s): 750 Problem Description Great! Your new software is almost finished! The only thing left to…
Wireless Password Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5640 Accepted Submission(s): 1785 Problem Description Liyuan lives in a old apartment. One day, he suddenly found that there…
Time Limit: 10 Seconds Memory Limit: 65536 KB Dr. X is a biologist, who likes rabbits very much and can do everything for them. 2012 is coming, and Dr. X wants to take some rabbits to Noah's Ark, or there are no rabbits any more. A rabbit's gene…
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5400 Accepted Submission(s): 1704 Problem Description Liyuan lives in a old apartment. One day, he suddenly found that there was a wireless ne…
看到20的数据量很容易想到状压dp. 开1<<20大小的数组来记录状态,枚举n个糖包,将其放入不同状态中(类似01背包思想) 时间复杂度O(n*(2^20)). import java.util.Arrays; import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); static int[][] a = new int[105][25]; static int[] sta…