UVa 12036 Stable Grid (想法题)
来源:互联网 发布:领航一号软件下载 编辑:程序博客网 时间:2024/05/16 12:13
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=3187
表示想复杂了。。其实只要统计是否有一个数字出现大于n次就no啊orz
完整代码:
/*0.042s*/#include<cstdio>#include<cstring>int cnt[105], n;bool judge(){bool f = true;int i, j, k;for (i = 0; i < n; ++i){for (j = 0; j < n; ++j){scanf("%d", &k);++cnt[k];if (cnt[k] > n) f = false;}}return f;}int main(){int T, cas = 0;scanf("%d", &T);while (T--){scanf("%d", &n);memset(cnt, 0, sizeof(cnt));printf("Case %d: %s\n", ++cas, (judge() ? "yes" : "no"));}return 0;}
- UVa 12036 Stable Grid (想法题)
- UVA - 12036 Stable Grid
- UVa 278 Chess (想法题)
- UVa 10730 Antiarithmetic? (想法题)
- UVa 10152 ShellSort (想法题)
- UVa 571 Jugs (想法题)
- UVA 6862 Triples 想法题
- UVa 11489 Integer Game (博弈&想法题)
- UVa 696 How Many Knights (想法题)
- UVa 10132 File Fragmentation (想法题)
- UVa 105 The Skyline Problem (想法题)
- UVa 12004 Bubble Sort (想法题)
- UVa 12502 Three Families (想法题)
- UVA 1450 Airport(二分+想法题)
- Uva 11971 Polygon 想法
- UVA 11553 - Grid Game
- UVa 785 - Grid Colouring
- UVa 11129 An antiarithmetic permutation (构造题&想法题&分治)
- 建行卡行家
- 新建maven工程作为引擎
- 再不'折腾'就老了
- cuda入门——结合opncv和cuda编程(2)
- windows编程之自己动手写WinMain函数
- UVa 12036 Stable Grid (想法题)
- 代码应该写的更简洁更优化
- 获取当前时间的毫秒数
- 和国家开放空间
- java定时器的使用
- cocos2d-x网络开发基础 HTTP的报文格式、GET和POST格式解析
- 在android 4.2.2上调试MU609步骤
- android代码混淆报错总结:java.io.IOException: Please correct the above
- sql语句导入乱码问题