题目链接

https://www.nowcoder.com/acm/contest/85/F

思路

记录每一个面 上的点 是否有方块

然后 根据它的输出顺序 遍历访问 如果有 输出 ‘X’ 否则 输出‘.’

但是要注意它的坐标系不是常规的坐标系

AC代码

#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <numeric>
#include <sstream>
#include <iomanip>
#include <limits> #define CLR(a) memset(a, 0, sizeof(a)) using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll; const double PI = 3.14159265358979323846264338327;
const double E = exp(1);
const double eps = 1e-6; const int INF = 0x3f3f3f3f;
const int maxn = 1e3 + 5;
const int MOD = 1e9 + 7; int xoy[maxn][maxn], xoz[maxn][maxn], yoz[maxn][maxn]; int main()
{
CLR(xoy);
CLR(xoz);
CLR(yoz);
int x, y, z, n;
scanf("%d%d%d%d", &x, &y, &z, &n);
for (int i = 0; i < n; i++)
{
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
xoy[a][b] = 1;
xoz[a][c] = 1;
yoz[b][c] = 1;
}
for (int i = y; i >= 1; i--)
{
for (int j = 1; j <= x; j++)
{
if (xoy[j][i])
printf("x");
else
printf(".");
}
printf(" ");
for (int j = 1; j <= z; j++)
{
if (yoz[i][j])
printf("x");
else
printf(".");
}
printf("\n");
}
printf("\n");
for (int i = 1; i <= z; i++)
{
for (int j = 1; j <= x; j++)
{
if (xoz[j][i])
printf("x");
else
printf(".");
}
printf("\n");
}
}

牛客小白月赛1 F 三视图 【循环】的更多相关文章

  1. 牛客网 牛客小白月赛1 F.三视图

    F.三视图   链接:https://www.nowcoder.com/acm/contest/85/F来源:牛客网     这个题自己想一下三维的,正视图和左视图中y轴为行数,x轴和z轴是列数,因为 ...

  2. 牛客小白月赛12 F 华华开始学信息学 (分块+树状数组)

    链接:https://ac.nowcoder.com/acm/contest/392/F来源:牛客网 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 32768K,其他语言65536K ...

  3. 牛客小白月赛3 F 异或【区间交集】

    链接:https://www.nowcoder.com/acm/contest/87/F 来源:牛客网 题目描述 Cwbc想测试一下他的加密协议,以便防止其他人偷看他给XHRlyb的信. Cwbc提出 ...

  4. 牛客小白月赛6 F 发电 树状数组单点更新 求区间乘积 模板

    链接:https://www.nowcoder.com/acm/contest/136/F来源:牛客网  HA实验是一个生产.提炼“神力水晶”的秘密军事基地,神力水晶可以让机器的工作效率成倍提升.   ...

  5. 牛客小白月赛16 F 小石的妹子 (线段树)

    链接:https://ac.nowcoder.com/acm/contest/949/F来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言52428 ...

  6. 牛客小白月赛5 F 圆(circle) 【欧拉定理】

    题目连接: https://www.nowcoder.com/acm/contest/135/F 签到题来了,送你们一个Python秒的题. Apojacsleam来到了OI大陆,经过了连年征战,成为 ...

  7. 牛客小白月赛18 Forsaken给学生分组

    牛客小白月赛18 Forsaken给学生分组 Forsaken给学生分组 链接:https://ac.nowcoder.com/acm/contest/1221/C来源:牛客网 ​ Forsaken有 ...

  8. 牛客小白月赛18 Forsaken喜欢数论

    牛客小白月赛18 Forsaken喜欢数论 题目传送门直接点标题 ​ Forsaken有一个有趣的数论函数.对于任意一个数xxx,f(x)f(x)f(x)会返回xxx的最小质因子.如果这个数没有最小质 ...

  9. 【牛客小白月赛21】NC201604 Audio

    [牛客小白月赛21]NC201604 Audio 题目链接 题目大意: 给出三点 ,求到三点距离相等的点 的坐标. 解析 考点:计算几何基础. 初中蒟蒻表示不会什么法向量.高斯消元..qwq 方法一: ...

随机推荐

  1. LeetCode-Minimum Window Substring -- 窗口问题

    题目描述 Given a string S and a string T, find the minimum window in S which will contain all the charac ...

  2. document.querySelector()与document.querySelectorAll()

      document.querySelector()与document.querySelectorAll() CreationTime--2018年7月1日10点49分 Author:Marydon ...

  3. 【HTML5】元素<head>的使用

    功能描述 在新建的页面<head>元素中,加入该元素所包含的各类标签,并定义超级链接的样式.当单击"请点击我"标签时,并展示相应效果并进入<base>元素设 ...

  4. Maven - error in opening zip file

    在一个maven工程中,有时执行mvn打包,部署,编译等命令,例如mvn clean install -DskipTests -U等命令时,会报类似(error in opening zip file ...

  5. 关于解决 http 状态码200,php 文件有输出,但是不显示模板文件的问题

    一 问题 给公司搭建一个在线测试站点之后,在浏览器地址栏输入 "http://xxx.xxx.xxx/index.php",页面什么都没显示.调出浏览器的开发者工具查看,http ...

  6. 真正的Java学习从入门到精通

    http://www.it.com.cn/f/edu/059/6/169189.htm 一. 工具篇JDK (Java Development Kit) JDK是整个Java的核心,包括了Java运行 ...

  7. 匿名函数 invoke

    delegate string MyDele(string str); string MyFun(string str) { return str; } private void Form1_Load ...

  8. python--pipe

    1.pipe 除了使用队列外,还可以使用管道在进程间执行消息传递 pipe([]duplex) 在进程间创建一条管道,并返回元组(conn1,conn2),其中conn1和conn2是表示管道两端的C ...

  9. Oracle database datafile header中记录的datafile的大小

    本文的环境:Oracle Databae 12.1.0.2, rhel5.9 x86-64bit [oracle@rhel59 orcl]$ pwd /u01/app/oracle/oradata/o ...

  10. 在Linux平台使用VNC连接树莓派

    你的Linux发行版本号可能已经包括了Remote Desktop Viewer(远程桌面)程序.你能够通过这个程序使用VNC连接你的树莓派.通常能够在Applications/Internet菜单以 ...