HDU——4666 Hyperspace
来源:互联网 发布:linux 禁用端口 编辑:程序博客网 时间:2024/06/09 23:12
stl的应用
渣了,这个都不会弄。。。
http://blog.csdn.net/dongdongzhang_/article/details/9954329
#include <iostream>#include <cstdio>#include <cmath>#include <vector>#include <cstring>#include <algorithm>#include <string>#include <set>#include <functional>#include <numeric>#include <sstream>#include <stack>#include <map>#include <queue>using namespace std;int num[66000][100];int main(){ int n,m; int q; int i,j,k; while(cin>>n>>m) { multiset<int> s[100]; for( i=1;i<=n;i++) { scanf("%d",&q); if(q==0) { int a[10]; for(j=1;j<=m;j++) scanf("%d",&a[j]); for(j=0;j<(1<<m);j++){int sum=0;for(k=1;k<=m;k++){if((1<<(k-1))&j)sum+=a[k];elsesum-=a[k];}num[i][j]=sum;s[j].insert(sum);} } else { int x; scanf("%d",&x); for(j=0;j<(1<<m);j++) s[j].erase(s[j].find(num[x][j]));//注意删的是地址 } int ans=0; for( j=0;j<(1<<m);j++) { multiset<int>::iterator it1=s[j].begin(); multiset<int>::iterator it2=s[j].end(); it2--; ans=max(*it2-*it1,ans); } printf("%d\n",ans); } } return 0;}
- HDU——4666 Hyperspace
- HDU 4666 Hyperspace
- hdu-4666 Hyperspace
- hdu 4666 Hyperspace
- HDU 4666 Hyperspace
- hdu 4666 Hyperspace
- HDU 4666 Hyperspace
- hdu 4666Hyperspace
- HDU 4666 Hyperspace
- HDU 4666 Hyperspace
- HDU 4666 Hyperspace 解题报告
- Hdu-4666 Hyperspace(曼哈顿距离)
- hdu 4666 Hyperspace 多校第七场
- hdu-4666-Hyperspace-最长曼哈顿距离
- [HDU 4666]Hyperspace[最远曼哈顿距离][STL]
- hdu 4666 Hyperspace (曼哈顿距离+set )
- [HDU 4666]Hyperspace[最远曼哈顿距离][STL]
- HDU 4666 Hyperspace(最长曼哈顿距离)
- C语言位域和位段
- HDU4671 找规律排列问题
- 【树形DP】 HDU 4276 The Ghost Blows Light
- test
- const_cast
- HDU——4666 Hyperspace
- 关于Hibernate的oracle主键id生成策略uuid、native和sequence
- HDU4670 Cube number on a tree
- Unity3D基础知识梳理
- 插件的概念及原理
- Eclipse IDE for c++配置
- HDU1869:六度分离
- 软件插件技术的原理与实现
- GetMemory函数的几种经典考法