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. python中一些内置函数实例

    lambda表达式 简单函数可用lambda表达式 1. def f1() return(123) r1=f1() print() 2. f2=lambda:123 r2=f2() print() 以 ...

  2. oracle监听配置

    在listener.ora文件中指定监听的实例名和修改ip地址: 查看实例名:[localhost$] echo $ORACLE_SID LISTENER = (DESCRIPTION_LIST = ...

  3. 20145202马超 2016-2017-2 《Java程序设计》第四周学习总结

    20145202马超 2016-2017-2 <Java程序设计>第四周学习总结 教材学习内容总结 继承:打破了封装性 extends 1.提高了代码的复用性. 2.让类与类之间产生了关系 ...

  4. Linux 下 PHP 扩展 PDO 编译安装

    1.进入 PHP 的软件包 pdo 扩展目录中(注:不是 PHP 安装目录) [root@tester /]# /home/tdweb/php-5.4.34/ext/pdo_mysql 执行 phpi ...

  5. 『AngularJS』Service

    理解Angular 服务 什么是Angular Service Angular 服务是为web应用执行特定任务的单例对象或方法. 注:如果组件是为了内容呈现的功能复用,那么服务就是为组件进行功能复用. ...

  6. C#的内存管理

    栈的填充方式是从高到低,高数位到低数位的填充 堆的填充方式是从低向高,低数位到高数位的填充 内存堆上没有被栈引用的东西,才会被垃圾回收器回收. GC垃圾自动回收会重新排列堆里面的内存占用,自动回收运行 ...

  7. ES6 export,import报错

    问题描述: 现有两个文件: profile.js const firstName = 'Michael'; const lastName = 'Jackson'; const year = 2018; ...

  8. Mac下安装pear库+phpDocumentor

    1. 首先安装pear: curl -o go-pear.php https://pear.php.net/go-pear.phar 看见这个就安装OK: % Total % Received % X ...

  9. anaconda常用的命令

    常用操作命令: 一.环境操作 1.查看环境管理的全部命令帮助: conda env -h 2.查看当前系统下的环境: conda info -e 3.创建环境: conda create env_na ...

  10. MySQL统计数据库表大小

    use information_schema; SELECT TABLE_NAME, (DATA_LENGTH/1024/1024) as DataM , (INDEX_LENGTH/1024/102 ...