题目链接

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. C# : 资源文件(多用于处理国际化)

    1.建立Resource文件夹,添加资源文件 处理国际化的问题,我们可以添加多个资源文件,如下就是添加一个中文的,一个英文的. 2.向其中添加键值对. 3.取值 CultureInfo uiCultu ...

  2. PAT 1001. A+B Format(水题)

    #include<cstdio> #include<cstring> using namespace std; char s[10]; int main() { int a,b ...

  3. OpenLayers加载天地图

    openlayer 是基于JavaScript的webGIS库 ,通过openlayer可以很容易的调用地图,并做相应的操作. 在head中载入openlayer的js文件: <link rel ...

  4. asp.net core 系列之Response caching(1)

    这篇文章简单的讲解了response caching: 讲解了cache-control,及对其中的头和值的作用,及设置来控制response caching; 简单的罗列了其他的缓存技术:In-me ...

  5. Java中HashTable和HashMap的区别

    在Java中,HashTable和HashMap都是哈希表,那么它们有什么区别呢?   1.它们所继承的类不一样. HashTable和HashMap都实现了Map接口,但是它们所继承的类时不同的.H ...

  6. jeecms搜索结果排序-二次开发

    jeecms搜索用的是apache Lucene,要实现此功能得先去学习它. 直接上代码 package com.jeecms.cms.lucene; import java.io.IOExcepti ...

  7. 4.关于QT中的QFile文件操作,QBuffer,Label上加入QPixmap,QByteArray和QString之间的差别,QTextStream和QDataStream的差别,QT内存映射(

     新建项目13IO 13IO.pro HEADERS += \ MyWidget.h SOURCES += \ MyWidget.cpp QT += gui widgets network CON ...

  8. MIC中示例程序计算π

    mic中编程十分简单,只需在普通程序中简单加几句就可以,使用 lspci|grep -i -co-processor 命令可以查看机器中是否插入MIC卡以及MIC卡的数目,MIC编程环境的配置这里就不 ...

  9. 【Python+selenium】之奇怪问题总结

    问题1: <_io.TextIOWrapper name='<stderr>' mode='w' encoding='UTF-8'> Time Elapsed: 0:00:04 ...

  10. 使用ffmpeg下载m3u8流媒体

    安装 编译好的windows可用版本的下载地址(官网中可以连接到这个网站,和官方网站保持同步): http://ffmpeg.zeranoe.com/builds/ 或者: 百度网盘https://p ...