This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <algorithm> | |
using namespace std; | |
int dp[40005] = {0}; | |
struct Block{ | |
int h; | |
int a; | |
int c; | |
}b[401]; | |
bool cmp(const Block &a, const Block &b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <algorithm> | |
using namespace std; | |
int dp[100005]; | |
int main() | |
{ | |
int cash, N, n[11], D[11]; | |
while (scanf("%d %d", &cash, &N) != EOF) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
#include <string> | |
#include <sstream> | |
using namespace std; | |
// dp[i][j] 表示i元最多用j個硬幣的方法數 | |
long long dp[301][1001] = {0}; | |
int main() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <algorithm> | |
using namespace std; | |
int Time[10005]; | |
int num[10005]; | |
int Knapsack(int m, int t) | |
{ | |
for (int i = 0; i + m <= t; ++i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <algorithm> | |
int T, N, G, MW; | |
int price[1005], weight[1005]; | |
int dp[35]; | |
int Knapsack(); | |
int main() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <algorithm> | |
using namespace std; | |
int method[10000] = {0}; | |
int cent[5] = {1, 5, 10, 25, 50}; | |
int main() | |
{ | |
// 建表 | |
method[0] = 1; | |
for (int i = 0; i < 5; ++i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <algorithm> | |
using namespace std; | |
int dp[6*20001]; | |
int main() | |
{ | |
int n[7], Case = 1; | |
while (1) { | |
// Input | |
int sum = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cmath> | |
#include <algorithm> | |
using namespace std; | |
#define INF 9999999 | |
struct Point{ | |
int x, y; | |
}point[20]; // point[0] is Larry | |
int num; // num of nuts | |
int dis[20][20]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
using namespace std; | |
// Method 1 | |
int main() | |
{ | |
int N; | |
scanf("%d", &N); | |
int num[1001], LIS[1001]; | |
int Max = 0; | |
for (int i = 0; i < N; ++i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstring> | |
#include <queue> | |
using namespace std; | |
int cap[40][40], flow[40][40]; | |
int bottleneck[40], pre[40]; | |
int main() | |
{ | |
int T, Case = 1, N, M, K; | |
scanf("%d", &T); |