[ZOJ 4014] Pretty Matrix
生活随笔
收集整理的這篇文章主要介紹了
[ZOJ 4014] Pretty Matrix
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
題目鏈接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5742
AC代碼:
/** 反思:* 1.遇到簡單題別激動(dòng),先把它所有的輸入任務(wù)都完成了,在考慮處理的問題* 2.當(dāng)你的程序沒有按回車就全部運(yùn)行完的時(shí)候,這段程序十有八九是有問題的,* 仔細(xì)檢查是不是輸入沒輸入全,或者特殊字符沒處理或者運(yùn)行過程中遇到問題了。*/#include <cstdio>using namespace std;int test; int n, m, a, b; int x, sum, cnt;int main() {scanf("%d", &test);while (test--) {scanf("%d%d%d%d", &n, &m, &a, &b);sum = n * m;if (a > b) {while (sum--) {scanf("%d", &x);}printf("No Solution\n");} else {cnt = 0;while (sum--) {scanf("%d", &x);if (x < a || x > b) {cnt++;}}printf("%d\n", cnt);}}return 0; }轉(zhuǎn)載于:https://www.cnblogs.com/youpeng/p/10780219.html
總結(jié)
以上是生活随笔為你收集整理的[ZOJ 4014] Pretty Matrix的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 浅复制与深复制概念
- 下一篇: 2019年第十二届全国大学生信息安全实践