主页
试题仓库
题目列表
试题分类
经典教材
作业竞赛
作业列表
判题队列
图灵学院
TuringMOOC
图灵书屋
图灵商城
图灵实验室
图灵会员
荣誉成绩
捐赠支持
图灵云编译器
用户/排名
AOJ排名
实名认证
请登录
常用链接
AOJ考试平台
老赵的Gitee代码
编译原理模拟考试平台
Java技术手册
FCC网站
菜鸟网
在线工具箱
字节豆包GPT
代码可视化
力扣网
牛客网
洛谷
杭电OJ
CodeForce
隐藏编译器
Problem 3043 --Acesrc and Hunting
3043: Acesrc and Hunting
上一题
正确率: $0.00\%$
下一题
Time Limit
$2$ 秒/Second(s)
Memory Limit
$512$ 兆字节/Megabyte(s)
提交总数
$8$
正确数量
$0$
"
裁判形式
标准裁判/Standard Judge
我的状态
尚未尝试
难度
分类标签
×
为本题添加算法分类(请不要超过5个)
当前分类(单击移除):
单击选择分类:
Description
<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);">Acesrc is a famous hunter at Nanjing University second to none. Recently, he set </span>n×mn×m<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);"> traps in Yangshan Park, a park near Nanjing University Xianlin Campus, arranged in </span>nn<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);"> rows and </span>mm<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);"> columns. The rows are numbered </span>11<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);"> through </span>nn<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);"> from bottom to up, and the columns are numbered </span>11<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);"> through </span>mm<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);"> from left to right. The distance between two adjacent traps, both horizontally and vertically, is 1 meter. </span><br /> <br /> <span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);">Today, Acesrc happily finds that every trap he set has captured an animal. He decides to collect these hunted animals to make roast meat for his friends. However, collecting these animals normally is too boring, so he decides to find a route following the rules below: </span><br /> <br /> <span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);">1. Acesrc can choose any trap to start; every time he collects the animal in the trap, he moves to some unvisited trap and repeats until all captured animals are collected; </span><br /> <span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);">2. The Euclidean distance he moves from one trap to the next trap should be between 1 meter and 3 meters exclusive; that is, the distance should be strictly greater than 1 meter and strictly less than 3 meters. </span><br /> <br /> <span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);">Acesrc has quickly collected all animals. Roo wonders how Acesrc collected these animals, but Acesrc buttons up his lip. Can you give a possible route to collect all the animals?</span>
Input
<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);">The first line of input consists of a single integer </span>TT<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);"> </span>(1≤T≤240)(1≤T≤240)<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);">, the number of test cases. Each test case is a single line of two integers </span>n,mn,m<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);"> </span>(1≤n,m≤100)(1≤n,m≤100)<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);">, denoting the size of the trap matrix.</span>
Output
<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);">For each test case, if it is impossible to find any valid route, print NO in a single line; otherwise, print YES in one line, followed by </span>n×mn×m<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);"> lines describing the route, each of these lines containing two integers </span>x,yx,y<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);"> </span>(1≤x≤n,1≤y≤m)(1≤x≤n,1≤y≤m)<span style="font-family:Merriweather, serif;font-size:18px;background-color:rgba(210, 210, 255, 0.5);">, denoting the position of a trap visited. If multiple solutions exist, print any.</span>
Sample Input
2 2 2 2 3
Sample Output
NO YES 1 1 2 2 1 3 2 1 1 2 2 3
推荐代码
查看3043 所有题解
上传题解视频得图灵币
本题记录
用 户(点击查看用户)
运行号(点击购买题解)
时 间
算法最快[$0 $ms]
0
内存最少[$0 $KB]
0
第一AC
0
第一挑战
淡意的温柔
591129
2020-06-06 08:31:04
赛题来源
2019 Multi-University Training Contest 8
登录后提交代码
题面与样例可直接查看,登录后即可在线提交和评测。
前往登录