摘要:
100分程序,写了2天+1小时 →题目在这里← 大神就是厉害……写的程序居然看都看不懂,还有就是cena上过了但是luogu上一直是恶心的TLE 首先是考虑p=0时,数组大小开到了1100000,然后就是WA,改成了9100000之后终于坑到50分,然后开始考虑p≠0,经过神犇程序的一番洗脑,终于发 阅读全文
摘要:
完全背包………… #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <m 阅读全文
摘要:
常用模板多重背包 #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <m 阅读全文
摘要:
加优化的01背包模板 #include <iostream> using namespace std; int w[210],v[210],f[210]; int main() { freopen("package.in","r",stdin); freopen("package.out","w", 阅读全文
摘要:
题目描述 辰辰是个天资聪颖的孩子,他的梦想是成为世界上最伟大的医师。为此,他想拜附近最有威望的医师为师。医师为了判断他的资质,给他出了一个难题。医师把他带到一个到处都是草药的山洞里对他说:“孩子,这个山洞里有一些不同的草药,采每一株都需要一些时间,每一株也有它自身的价值。我会给你一段时间,在这段时间 阅读全文
摘要:
题目描述 房间里放着n块奶酪。一只小老鼠要把它们都吃掉,问至少要跑多少距离?老鼠一开始在(0,0)点处。 输入格式: 第一行一个数n (n<=15) 接下来每行2个实数,表示第i块奶酪的坐标。 两点之间的距离公式=sqrt((x1-x2) * (x1-x2)+(y1-y2) * (y1-y2)) 输 阅读全文
摘要:
杨辉三角形求组合数问题 原题点这里 #include <iostream> #include <cmath> using namespace std; long long a[3100][3100]; int f[3100][3100]; int n,m,t,k; int main() { cin> 阅读全文
摘要:
M个位置可以打sif,N+1个人等着打sif,已知前N个人的时间,问第N+1个人什么时候才能打sif(不能插队,即必须按顺序来打sif) 输入N,M以及每个人所需要的时间;输出第N+1个人所需的时间 用优先队列用优先队列用优先队列 队列用来存每个水龙头所需要的总时间,到了最后用了最少时间的水龙头就是 阅读全文
摘要:
noip2016结束后的第一份代码……优先队列的练习 合并果子 原题在这里 #include <iostream> #include <queue> #include <vector> using namespace std; priority_queue <int> que; int main() 阅读全文