摘要: . ................... 阅读全文
posted @ 2019-03-28 09:29 Minepressure 阅读(157) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio>#include<algorithm>using namespace std;struct item{ int t,h,f; bool operator < (const item& x) const { return t<x.t; }};int D,G,rest_t 阅读全文
posted @ 2016-10-24 09:11 Minepressure 阅读(232) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #define max(a,b) (a > b ? a : b) #define maxn 1000 #define maxm 10000 int n,m,k,ans=0; int d[maxn+10],g[maxn+10],sum[maxn+10],las[maxn+10],get[maxn+10]; int t[maxm+10],a[ma... 阅读全文
posted @ 2016-08-15 11:04 Minepressure 阅读(126) 评论(0) 推荐(0) 编辑
摘要: /*f(i,j)表示以(i,j)为右下角的最大全0子矩阵的边长若a[i][j]==1,f(i,j)=0否则:f(i,j)=min{ f(i-1,j),f(i,j-1),f(i-1,j-1) }+1 这样求得的是最大全0正方形子矩阵要求长方形矩阵,上述思路行不通假设以(i,j)为右下角的最大矩阵=12 阅读全文
posted @ 2016-04-09 10:46 Minepressure 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 193:棋盘分割 193:棋盘分割 查看 提交 统计 提问 查看 提交 统计 提问 总时间限制: 1000ms 内存限制: 65536kB描述将一个8*8的棋盘进行如下分割:将原棋盘割下一块矩形棋盘并使剩下部分也是矩形,再将剩下的部分继续如此分割,这样割了(n-1)次后,连同最后剩下的矩形棋盘共有n 阅读全文
posted @ 2016-04-09 10:26 Minepressure 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 long long f[101][101]; 6 int n,m; 7 char c; 8 long long gcd(long long ,long long ); 9 int main() 10 { 11 scanf("%d%d",&n,&m); 12... 阅读全文
posted @ 2016-04-09 09:41 Minepressure 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 【问题描述】 由文件给出N个1到30000间无序数正整数,其中1≤N≤10000,同一个正整数可能会出现多次,出现次数最多的整数称为众数。求出它的众数及它出现的次数。 【输入格式】 输入文件第一行是正整数的个数N,第二行开始为N个正整数。 【输出格式】 输出文件有若干行,每行两个数,第1个是众数,第 阅读全文
posted @ 2016-02-16 16:58 Minepressure 阅读(882) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<cstdio>#include<cstring>using namespace std;int main(){ int n,k,j; cin>>n; int a[n+1]; for(int i=1;i<=n;i++) cin>>a[i]; for 阅读全文
posted @ 2016-02-16 16:56 Minepressure 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 【问题描述】 明明想在学校中请一些同学一起做一项问卷调查,为了实验的客观性,他先用计算机生成了N个1到1000之间的随机整数(N≤100),对于其中重复的数字,只保留一个,把其余相同的数去掉,不同的数对应着不同的学生的学号。然后再把这些数从小到大排序,按照排好的顺序去找同学做调查。请你协助明明完成“ 阅读全文
posted @ 2016-02-16 16:54 Minepressure 阅读(354) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include <cstring>using namespace std;int main(){ int b[101],k,i,n; memset(b,0,sizeof(b)); cin>>n; for( i=1;i<=n;i++) { cin>>k; b[k] 阅读全文
posted @ 2016-02-16 16:54 Minepressure 阅读(125) 评论(0) 推荐(0) 编辑