摘要:
C - String Reconstruction 方法一:把确定的点的父亲节点设为下一个点,这样访问过的点的根节点都是没访问过的点。 代码: 方法二:把所有点放进set容器里,拜访过的点就删掉。 代码: 阅读全文
摘要:
算法笔记 1.非连续最大子段和 如果不全为负数,最大子段和所有大于等于0的元素的和;如果全为负数,最大子段和为最大的负数。 2.连续最大子段和 ①无长度限制: 例题: 洛谷p1115最大子段和 思路:dp[i] = max(a[i], dp[i-1]+a[i]) 代码: #include<bits/ 阅读全文
摘要:
算法笔记 带权并查集大神详解:https://agatelee.cn/2017/05/%E5%B8%A6%E6%9D%83%E5%B9%B6%E6%9F%A5%E9%9B%86/ 贴几道题的代码: ①Poj1182食物链 这道题目不知道为啥用ios::sync_with_stdio(false)和c 阅读全文
摘要:
C. Mahmoud and a Message time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Mahmoud and 阅读全文
摘要:
I Hate It Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 75546 Accepted Submission(s): 29114 Pro 阅读全文
摘要:
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 89077 Accepted Submission(s): 37522 Problem 阅读全文
摘要:
Fliptile Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10018 Accepted: 3717 Description Farmer John knows that an intellectually satisfie 阅读全文
摘要:
D. Mike and distribution time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D. Mike and dis 阅读全文
摘要:
C. Mike and gcd problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Mike and gcd 阅读全文
摘要:
B. Mike and strings time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output B. Mike and strings 阅读全文
摘要:
A. Mike and palindrome time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Mike and palin 阅读全文
摘要:
畅通工程 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 28744 Accepted Submission(s): 12633 Problem 阅读全文
摘要:
还是畅通工程 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 44947 Accepted Submission(s): 20487 Proble 阅读全文
摘要:
畅通工程 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第1行给出 阅读全文
摘要:
ios::sync_with_stdio(false); cin.tie(0); 把cin变得和scanf一样快。 阅读全文
摘要:
B. The Little Match Girl time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. The Little Ma 阅读全文
摘要:
A. Coins 题目链接:http://codeforces.com/gym/101102/problem/A time limit per test 3 seconds memory limit per test 256 megabytes input standard input output 阅读全文