hackerrank Organizing Containers of Balls
来源:互联网 发布:菜鸟网络工资 编辑:程序博客网 时间:2024/05/11 22:08
#include<stdio.h>#include<iostream>#include<string.h>#include<math.h>#include<algorithm>#include<queue>#include<set>#include<iterator>#include<map>using namespace std;long long container[110];long long type[110];map<int, int> used;int main(){ int t; scanf("%d", &t); while(t--){ int M; memset(type, 0, sizeof(type)); memset(container, 0, sizeof(container)); int n; scanf("%d", &n); for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ scanf("%d", &M); type[j] += M; container[i] += M; } used[container[i]] = 1; } int flag = 1; for(int i = 0; i < n; i++){ if(used[type[i]] != 1){ flag = 0; break; } } if(flag == 1) printf("Possible\n"); else printf("Impossible\n"); } return 0;}
阅读全文
0 0
- HackerRank - organizing-containers-of-balls
- HackerRank - organizing-containers-of-balls
- hackerrank Organizing Containers of Balls
- Organizing Containers of Balls----思维题
- kinds of Containers
- all kinds of containers
- Lines of Containers
- Java - All Kinds of Containers
- ZOJ - 3175 Number of Containers
- UVA 12652 Lines of Containers
- Number of Containers(数学)
- Five Balls of Life
- Hackerrank - Game Of Rotation 题解
- 【HackerRank】 Game Of Thrones - I
- hackerrank Week of Code Target
- [HackerRank]Week Of Code 23
- [hackerrank Value of all Permutations]
- Hackerrank Week of Code 32
- 7/4作业:API中异常结构及常见异常
- NSString 中的 Emoji 表情
- 懒加载时序问题,懒加载野指针
- 创建一个maven web项目的种种问题
- IBM HyperLedger fabric 详解
- hackerrank Organizing Containers of Balls
- springboot环境下实现读写分离
- N皇后问题 HDU
- Btrace1.3.9用户手册
- RHEL7 系统ISCSI存储环境搭建
- 嵌入式学习6(C语言运算符及控制语句)
- Android:dagger2让你爱不释手-基础依赖注入框架篇
- 剑指offer笔试面试题之——位运算
- POJ3713-Transferring Sylla