原创 Manacher's Algorithm 馬拉車算法
轉載自 https://www.cnblogs.com/grandyang/p/4475985.html 這個馬拉車算法Manacher‘s Algorithm是用來查找一個字符串的最長迴文子串的線性方法,由一個叫Manacher的人
原创 2018程設模考2
A 分別記錄紙幣剩餘數量判斷是否能找零,因爲數據比較弱所以對於5+5+5的情況沒考慮也過了。 #include<bits/stdc++.h> using namespace std; int main() { int a=0,b
原创 SWERC2017 E.Ingredients(拓撲排序+01揹包)
因爲一個披薩得由另外的披薩加料製成,所以有一個先後順序問題,用拓撲排序跑一遍,找出n種披薩的最優情況後背包即可。 #include<bits/stdc++.h> using namespace std; typedef long lon
原创 HDU 3033 I love sneakers!(分組揹包)
I love sneakers! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s
原创 POJ 1837 Balance(分組揹包)
Balance Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 16611 Accepted: 10433 Description Gigel has a st
原创 POJ 3181 Dollar Dayz(完全揹包)
Dollar Dayz Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2275 Accepted: 934 Description Farmer John g
原创 ZOJ 3623 Battle Ships
Battle Ships Time Limit: 2 Seconds Memory Limit: 65536 KB Battle Ships is a new game which is similar to Star C
原创 UVA 674 Coin Change(完全揹包)
UVA 674 Coin Change 解題報告 題目鏈接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87730#problem/E 題目: Suppose there
原创 ACM-ICPC 2018 焦作賽區網絡預賽 B.Mathematical Curse
A prince of the Science Continent was imprisoned in a castle because of his contempt for mathematics when he was young,
原创 ZOJ 3662 Math Magic
Math Magic Time Limit: 3 Seconds Memory Limit: 32768 KB Yesterday, my teacher taught us about math: +, -, *, /,
原创 HDU 2126 Buy the souvenirs(01揹包)
Buy the souvenirs Time Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submis
原创 POJ 2063 Investment
Investment Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 12098 Accepted: 4207 Description John never k
原创 POJ 1787 Charlie's Change(完全揹包+物品計數+記錄路徑)
Charlie's Change Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 5108 Accepted: 1620 Description Charlie
原创 ACM-ICPC 2018 焦作賽區網絡預賽 K.Transport Ship(01揹包)
There are NN different kinds of transport ships on the port. The i^{th}ith kind of ship can carry the weight of V[i]V[i
原创 2018 南京網絡邀請賽 E. AC Challenge
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 problem