HDU 多校对抗第三场 L Visual Cube
Problem L. Visual Cube
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 2127 Accepted Submission(s): 984
Now he meets a 3D geometry problem again. This time, he doesn't want to struggle any more. As a result, he turns to you for help.
Given a cube with length a, width b and height c, please write a program to display the cube.
In each test case, there are 3 integers a,b,c(1≤a,b,c≤20), denoting the size of the cube.
1 1 1
6 2 4
题意:给你长方体的长宽高,要你构造出(画出,一个按照题目要求给的长方体
题解:真tm变态呜呜呜,这个题,考你码力和找规律的能力,代码看了就懂了
一个面一个面的画,因为长方体在平面上只能展现三个面,所以循环六次就可以画出来了
代码如下:
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <bitset>
#include <string>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <functional>
#define fuck(x) cout<<"["<<x<<"]";
#define FIN freopen("input.txt","r",stdin);
#define FOUT freopen("output.txt","w+",stdout);
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int maxn = 1e5+; char mp[][];
int main(){
#ifndef ONLINE_JUDGE
FIN
#endif
int T;
int a,b,c;
scanf("%d",&T);
while(T--){
memset(mp,,sizeof(mp));
scanf("%d%d%d",&a,&b,&c); for(int i=a*+;i<=a*+b*+;i+=){
for(int j=;j<=b*+c*+;j++){
mp[j][i]=(j&)?'+':'|';
}
} for(int i=a*+;i<=a*+b*+;i+=){
for(int j=;j<=b*+c*+;j++){
mp[j][i]=(j&)?'.':'/';
}
} for(int i=;i<=b*;i+=){
for(int j=b*+-i;j<=a*+b*+-i;j++){
mp[i][j]=(j&)?'+':'-';
}
} for(int i=;i<=b*;i+=){
for(int j=b*+-i;j<=a*+b*+-i;j++){
mp[i][j]=(j&)?'.':'/';
}
} for(int i=*b+;i<=*b+*c+;i+=){
for(int j=;j<=*a+;j++){
mp[i][j]=(j&)?'+':'-';
}
} for(int i=*b+;i<=*b+*c;i+=){
for(int j=;j<=*a+;j++){
mp[i][j]=(j&)?'|':'.';
}
} int x=c*+b*+;
int y=b*+a*+;
for(int i=;i<=b*;i++){
for(int j=;j<=*b-i+;j++){
mp[x-i+][y-j+]='.';
}
} for(int i=;i<=b*;i++){
for(int j=;j<=*b-i+;j++){
mp[i][j]='.';
}
}
for(int i=;i<=x;i++){
for(int j=;j<=y;j++){
printf("%c",mp[i][j]);
}
printf("\n");
}
} }
HDU 多校对抗第三场 L Visual Cube的更多相关文章
- 【杂题总汇】HDU多校赛第十场 Videos
[HDU2018多校赛第十场]Videos 最后一场比赛也结束了…… +HDU传送门+ ◇ 题目 <简要翻译> 有n个人以及m部电影,每个人都有一个快乐值.每场电影都有它的开始.结束时间和 ...
- HDU 4893 Wow! Such Sequence!(2014年多校联合 第三场 G)(线段树)
磨了一天的线段树,不能说完全搞清楚,只能说有一个大概的了解,靠着模板才把这道题A了,只能说太弱~~! 题意: 初始时有一字符串,全为0. 三种操作: 1 k d - add 把d加到第k个数上去2 ...
- 2015 多校赛 第三场 1002 (hdu 5317)
Description Mr. Hdu is interested in Greatest Common Divisor (GCD). He wants to find more and more i ...
- HDU 5754 Life Winner Bo (各种博弈) 2016杭电多校联合第三场
题目:传送门 题意:一个国际象棋棋盘,有四种棋子,从(n,m)走到(1,1),走到(1,1)的人赢,先手赢输出B,后手赢输出G,平局输出D. 题解:先把从(n,m)走到(1,1)看做是从(1,1)走到 ...
- hdu 5319 Painter(杭电多校赛第三场)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5319 Painter Time Limit: 2000/1000 MS (Java/Others) ...
- hdu 5326 Work(杭电多校赛第三场)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5326 Work Time Limit: 2000/1000 MS (Java/Others) M ...
- Problem L. Visual Cube(杭电多校2018年第三场+模拟)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6330 题目: 题意:给你长宽高,让你画出一个正方体. 思路:模拟即可,湘潭邀请赛热身赛原题,不过比那个 ...
- HDU 6610 Game — 2019第三场杭电多校 1008题
目录 题意 思路 AC_Code @(hdu 6610) 题意 大概说一下我理解的题意... 链接:here 你有\(n\)堆石子,每堆石子有\(a_i\)个石子.游戏规则:\(Alice\)先选择一 ...
- HDU 5762 Teacher Bo (鸽笼原理) 2016杭电多校联合第三场
题目:传送门. 题意:平面上有n个点,问是否存在四个点 (A,B,C,D)(A<B,C<D,A≠CorB≠D)使得AB的横纵坐标差的绝对值的和等于CD的横纵坐标差的绝对值的和,n<1 ...
随机推荐
- Leecode刷题之旅-C语言/python-100相同的树
/* * @lc app=leetcode.cn id=100 lang=c * * [100] 相同的树 * * https://leetcode-cn.com/problems/same-tree ...
- Leecode刷题之旅-C语言/python-70爬楼梯
/* * @lc app=leetcode.cn id=70 lang=c * * [70] 爬楼梯 * * https://leetcode-cn.com/problems/climbing-sta ...
- BAT批处理
常用命令 查看目录内容命令dir 指定可执行文件搜索目录path 创建目录命令md 打开指定目录命令cd 删除当前指定的子目录命令rd 改变当前盘符命令d: 文件复制命令copy 显示文本文件内容命令 ...
- hadoop jar x.jar 执行过程
hadoop jar x.jar 执行过程 Yarn框架执行内容 1,job.waitforcompletion() 启动 Runjar 进程 -> Resourcemanage申请一个j ...
- scrapy编写爬虫的时候出现缺少win32api
环境:python3.6 工具:pycharm2017.3 scrapy fetch http://www.baidu.com ModuleNotFoundError: No module named ...
- java程序——从命令行接收多个数字,求和之后输出结果
命令行参数都是字符串,必须先将其转化为数字,才能相加.以下是流程图,源代码和输出结果. 流程图: 源代码: import java.util.Scanner; public class Test { ...
- 10-mongodb启动错误
1.error信息 python@ubuntu:~$ mongod --22T17:: I CONTROL [initandlisten] MongoDB starting : pid= port= ...
- No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser").警告解决方法
在使用BeautifulSoup库时出现该警告,虽然不影响正常运行,但强迫症不能忍啊!! 详细警告信息如下: UserWarning: No parser was explicitly specifi ...
- Mac系统下安装Homebrew后无法使用brew命令,-bash: brew: command not found
使用如下命令: sudo vim .bash_profile 然后输入以下代码: export PATH=/usr/local/bin:$PATH 再使用以下命令使配置生效: source .bash ...
- java中array,arrayList,iterator;
Array String []a = new String[10] ; a[0] = "test" ; String []a = new String[]{&quo ...