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

Problem Description
Little Q likes solving math problems very much. Unluckily, however, he does not have good spatial ability. Everytime he meets a 3D geometry problem, he will struggle to draw a picture.
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.
 
Input
The first line of the input contains an integer T(1≤T≤50), denoting the number of test cases.
In each test case, there are 3 integers a,b,c(1≤a,b,c≤20), denoting the size of the cube.
 
Output
For each test case, print several lines to display the cube. See the sample output for details.
 
Sample Input
2
1 1 1
6 2 4
 
Sample Output

题意:给你长方体的长宽高,要你构造出(画出,一个按照题目要求给的长方体

题解:真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的更多相关文章

  1. 【杂题总汇】HDU多校赛第十场 Videos

    [HDU2018多校赛第十场]Videos 最后一场比赛也结束了…… +HDU传送门+ ◇ 题目 <简要翻译> 有n个人以及m部电影,每个人都有一个快乐值.每场电影都有它的开始.结束时间和 ...

  2. HDU 4893 Wow! Such Sequence!(2014年多校联合 第三场 G)(线段树)

    磨了一天的线段树,不能说完全搞清楚,只能说有一个大概的了解,靠着模板才把这道题A了,只能说太弱~~! 题意: 初始时有一字符串,全为0. 三种操作: 1 k d - add  把d加到第k个数上去2 ...

  3. 2015 多校赛 第三场 1002 (hdu 5317)

    Description Mr. Hdu is interested in Greatest Common Divisor (GCD). He wants to find more and more i ...

  4. HDU 5754 Life Winner Bo (各种博弈) 2016杭电多校联合第三场

    题目:传送门 题意:一个国际象棋棋盘,有四种棋子,从(n,m)走到(1,1),走到(1,1)的人赢,先手赢输出B,后手赢输出G,平局输出D. 题解:先把从(n,m)走到(1,1)看做是从(1,1)走到 ...

  5. hdu 5319 Painter(杭电多校赛第三场)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5319 Painter Time Limit: 2000/1000 MS (Java/Others)   ...

  6. hdu 5326 Work(杭电多校赛第三场)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5326 Work Time Limit: 2000/1000 MS (Java/Others)    M ...

  7. Problem L. Visual Cube(杭电多校2018年第三场+模拟)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6330 题目: 题意:给你长宽高,让你画出一个正方体. 思路:模拟即可,湘潭邀请赛热身赛原题,不过比那个 ...

  8. HDU 6610 Game — 2019第三场杭电多校 1008题

    目录 题意 思路 AC_Code @(hdu 6610) 题意 大概说一下我理解的题意... 链接:here 你有\(n\)堆石子,每堆石子有\(a_i\)个石子.游戏规则:\(Alice\)先选择一 ...

  9. HDU 5762 Teacher Bo (鸽笼原理) 2016杭电多校联合第三场

    题目:传送门. 题意:平面上有n个点,问是否存在四个点 (A,B,C,D)(A<B,C<D,A≠CorB≠D)使得AB的横纵坐标差的绝对值的和等于CD的横纵坐标差的绝对值的和,n<1 ...

随机推荐

  1. 抽象类实验:SIM卡抽象

    抽象SIM: package sim_package; public abstract class SIM { public abstract String giveNumber(); public ...

  2. P2212 [USACO14MAR]浇地Watering the Fields

    P2212 [USACO14MAR]浇地Watering the Fields 题目描述 Due to a lack of rain, Farmer John wants to build an ir ...

  3. 【jQuery】 常用函数

    [jQuery] 常用函数 html() : 获取设置元素内的 html,包含标签 text() : 获取设置元素内的文本, 不包含标签 val() : 获取设置 value 值 attr() : 获 ...

  4. (4)分布式下的爬虫Scrapy应该如何做-规则自动爬取及命令行下传参

    本次探讨的主题是规则爬取的实现及命令行下的自定义参数的传递,规则下的爬虫在我看来才是真正意义上的爬虫. 我们选从逻辑上来看,这种爬虫是如何工作的: 我们给定一个起点的url link ,进入页面之后提 ...

  5. jsp 路径问题和环境路径以及各种路径总结

    首先确定问题: 浏览器发送请求后,服务器会返回一个响应,但是返回的网页中,会有各种路径问题,所以在此用jsp中的属性来解决.(只是记录问题,用了不专业的术语,请见谅.) 总结: 以路径  http:/ ...

  6. bzoj1367 可并堆

    题面 参考:<左偏树的特点及运用--黄河源> 我们将这个数列划为很多个互不相交的区间,每一段区间内的 \(b\) 是相等的,即 \(b[l[i]]=b[l[i]+1]=...=b[r[i] ...

  7. pep8介绍

    pep8介绍: PEP8是针对python代码格式而编订的风格指南,采用一致的编码风格可以令代码更加易懂易读! (1)空白: python中空白会影响代码的含义及其代码的清晰程度 使用space(空格 ...

  8. POJ 2168 Joke with Turtles(DP)

    Description There is a famous joke-riddle for children: Three turtles are crawling along a road. One ...

  9. Unity UGUI 图片 轴对称效果 减少资源

    制作UI的过程中,为了节省资源,对称的图一般美术切一半给我们 手动拼图 有时会出现拼接处出现裂缝或重叠 调整大小时也不方便 得一块一块调整 所以就用BaseMeshEffect 的ModifyMesh ...

  10. JavaSE复习(八)反射和注解

    反射 框架设计的灵魂 框架:半成品软件.可以在框架的基础上进行软件开发,简化编码 反射:将类的各个组成部分封装为其他对象,这就是反射机制 好处: 可以在程序运行过程中,操作这些对象. 可以解耦,提高程 ...