博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
XidianOJ 1035 数独 && 1053 正数负数 && 1042 另一个简单的游戏
阅读量:4310 次
发布时间:2019-06-06

本文共 2656 字,大约阅读时间需要 8 分钟。

三道水题。。

#include 
#include
#include
#include
using namespace std;int n;int main(){ while (scanf("%d",&n) != EOF){ if (n > 0){ printf("yes\n"); } else if (n < 0){ printf("no\n"); } else printf("light\n"); } return 0;}
#include 
#include
#include
#include
using namespace std;#define SIZE 9int table[10][10];bool JudgeCube(int x,int y){ int incx[10] = {
0,0,0,0,1,1,1,2,2,2}; int incy[10] = {
0,0,1,2,0,1,2,0,1,2}; int i,j; for (i=1;i<=9;i++){ int appear[10] = {
0}; int nowx = x + incx[i]; int nowy = y + incy[i]; if (appear[table[nowx][nowy]]) { return true;; } else appear[table[nowx][nowy]]; } return false; }int main(){ int time,T; scanf("%d",&T); for (time=1;time<=T;time++){ int i,j; int ok = 1; for (i=1;i<=SIZE;i++){ for (j=1;j<=SIZE;j++){ scanf("%d",&table[i][j]); } } for (i=1;i<=SIZE;i++){ int appear[10] = {
0}; for (j=1;j<=SIZE;j++){ if (table[i][j] > 9 || table[i][j] < 1) { ok = 0; goto here; } if (appear[table[i][j]]) { ok = 0; goto here; } else appear[table[i][j]] = 1; } } for (i=1;i<=SIZE;i++){ int appear[10] = {
0}; for (j=1;j<=SIZE;j++){ if (appear[table[j][i]]) { ok = 0; goto here; } else appear[table[j][i]] = 1; } } if (JudgeCube(1,1) || JudgeCube(1,4) || JudgeCube(1,7) || JudgeCube(4,1) || JudgeCube(4,4) || JudgeCube(4,7) || JudgeCube(7,1) || JudgeCube(7,4) || JudgeCube(7,7)) ok = 0; here: if (ok) { printf("yes\n"); } else printf("no\n"); } return 0; }
#include 
#include
#include
#include
#include
#include
#include
using namespace std;priority_queue
,greater
> q;int main(){ int time,T; scanf("%d",&T); for (time=1;time<=T;time++){ int n; scanf("%d",&n); int i,j; while (!q.empty()) { q.pop(); } for (i=0;i

 

转载于:https://www.cnblogs.com/ToTOrz/p/6079235.html

你可能感兴趣的文章
Java中equals和==的区别
查看>>
阻塞队列
查看>>
linux的基础知识
查看>>
PCB设计技巧与注意事项
查看>>
main函数带参数
查看>>
关于PCB设计中过孔能否打在焊盘上的两种观点
查看>>
京东技术架构(一)构建亿级前端读服务
查看>>
php 解决json_encode中文UNICODE转码问题
查看>>
LNMP 安装 thinkcmf提示404not found
查看>>
PHP empty、isset、innull的区别
查看>>
apache+nginx 实现动静分离
查看>>
通过Navicat远程连接MySQL配置
查看>>
phpstorm开发工具的设置用法
查看>>
Linux 系统挂载数据盘
查看>>
Git基础(三)--常见错误及解决方案
查看>>
Git(四) - 分支管理
查看>>
PHP Curl发送数据
查看>>
HTTP协议
查看>>
HTTPS
查看>>
git add . git add -u git add -A区别
查看>>