B. Clique Problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as f
题目链接: B. Passwords time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vanya is managed to enter his favourite site Codehorses. Vanya uses n distinct passwords for sites at all, however he can
题目链接: A. Exams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly
Wooden Sticks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 19672 Accepted Submission(s): 7991 Problem Description There is a pile of n wooden sticks. The length and weight of each stick ar
D. Ability To Convert time limit per test 1 second Cmemory limit per test 256 megabytes input standard input output standard output Alexander is learning how to convert numbers from the decimal system to any other, however, he doesn't know English le
畅通工程 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 29620 Accepted Submission(s): 15557 Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇.省政府"畅通工程"的目标是使全省任何两个城镇间都可以实现交通(但不一定有
传送门 昨晚打比赛的时候不是很机智啊. 这道题贪心就能过了. 我们可以发现一个明显的结论,每次选的垃圾的距离从大到小排序之后,每个距离对答案的贡献的系数是5,5,7,9,11-也就是最远的是5,其余都是2*rank+1. 这样就可以根据每次选几个垃圾来贪心. 代码: #include<bits/stdc++.h> #define ll long long #define N 200005 using namespace std; inline int read(){ int ans=0; ch
题目:http://www.joyoi.cn/problem/tyvj-1940 基环树的样子,看了书上的讲解,准备写树上DP,然后挂了: #include<iostream> #include<cstdio> #include<cstring> using namespace std; ,inf=1e9; ],head[MAXN],ct,s[MAXN],h,col[MAXN],cr,rt,ans; int sta[MAXN],top,reg[MAXN]; bool i
186. The Chain time limit per test: 0.25 sec. memory limit per test: 4096 KB input: standard input output: standard output Smith has N chains. Each chain is the sequence of successively connected links. The length of each chain is known: the first ch