牛客小白月赛1 F 三视图 【循环】
题目链接
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 F.三视图
F.三视图 链接:https://www.nowcoder.com/acm/contest/85/F来源:牛客网 这个题自己想一下三维的,正视图和左视图中y轴为行数,x轴和z轴是列数,因为 ...
- 牛客小白月赛12 F 华华开始学信息学 (分块+树状数组)
链接:https://ac.nowcoder.com/acm/contest/392/F来源:牛客网 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 32768K,其他语言65536K ...
- 牛客小白月赛3 F 异或【区间交集】
链接:https://www.nowcoder.com/acm/contest/87/F 来源:牛客网 题目描述 Cwbc想测试一下他的加密协议,以便防止其他人偷看他给XHRlyb的信. Cwbc提出 ...
- 牛客小白月赛6 F 发电 树状数组单点更新 求区间乘积 模板
链接:https://www.nowcoder.com/acm/contest/136/F来源:牛客网 HA实验是一个生产.提炼“神力水晶”的秘密军事基地,神力水晶可以让机器的工作效率成倍提升. ...
- 牛客小白月赛16 F 小石的妹子 (线段树)
链接:https://ac.nowcoder.com/acm/contest/949/F来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言52428 ...
- 牛客小白月赛5 F 圆(circle) 【欧拉定理】
题目连接: https://www.nowcoder.com/acm/contest/135/F 签到题来了,送你们一个Python秒的题. Apojacsleam来到了OI大陆,经过了连年征战,成为 ...
- 牛客小白月赛18 Forsaken给学生分组
牛客小白月赛18 Forsaken给学生分组 Forsaken给学生分组 链接:https://ac.nowcoder.com/acm/contest/1221/C来源:牛客网 Forsaken有 ...
- 牛客小白月赛18 Forsaken喜欢数论
牛客小白月赛18 Forsaken喜欢数论 题目传送门直接点标题 Forsaken有一个有趣的数论函数.对于任意一个数xxx,f(x)f(x)f(x)会返回xxx的最小质因子.如果这个数没有最小质 ...
- 【牛客小白月赛21】NC201604 Audio
[牛客小白月赛21]NC201604 Audio 题目链接 题目大意: 给出三点 ,求到三点距离相等的点 的坐标. 解析 考点:计算几何基础. 初中蒟蒻表示不会什么法向量.高斯消元..qwq 方法一: ...
随机推荐
- iOS仿支付宝首页效果
代码地址如下:http://www.demodashi.com/demo/12776.html 首先看一下效果 状态栏红色是因为使用手机录屏的原因. 1.问题分析 1.导航栏A有两组控件,随着tabl ...
- android 多应用程序数据共享 ContentProvider和ContentResolver
android 没有一个可以将所有应用程序数据统一放置的地方,即两个应用程序间的数据不能共享.但ContentProvider与ContentResolver可以解决多应用程序数据共享. 我们都知 ...
- nginx 做前端代理时proxy参数配置
1.后台可登录: proxy_connect_timeout 300s; proxy_send_timeout ; proxy_read_timeout ; proxy_buffer_size 256 ...
- CMA,memory compaction,migration and fragmation
CMA A reworked contiguous memory allocator http://lwn.net/Articles/447405/ June 14, 2011 分配大块物理上连续内存 ...
- 在caffe中用训练好的 caffemodel 来分类新的图片所遇到的问题
结合之前的博客: http://www.cnblogs.com/Allen-rg/p/5834551.html#3949333 用caffemodel去测试单通道的图像(mnist数据集)时,出现了问 ...
- web开发中的路径问题
http://www.cnblogs.com/tianguook/archive/2012/08/31/2665755.html 转自:http://www.blogjava.net/meil/arc ...
- POJ 1731 Orders(STL运用)
题目地址:POJ 1731 这题能够直接用STL函数做,非常轻松..next_permutation函数非常给力.. 代码例如以下: #include <algorithm> #inclu ...
- SRIO常用缩写
HELLO:Header Encoded Logical Layer Optimized (HELLO) format FTYPE:format type TTYPE:transaction type ...
- eclipse编写scala应用运行在spark集群上
代码 package spark_1 import org.apache.spark.SparkConf import org.apache.spark.SparkContext class Work ...
- cpu使用率高问题
然后: