Codeforces Round #259 (Div. 2) 454A Little Pony and Crystal Mine(模拟)

电力电子技术速通复习 一种完全纯净,结构完整的半导体晶体,其含有两种载流子而且,自由电子的浓度和空穴的浓度总是相等,一般情况下,在硅晶体中掺入P(磷)五价元素,多子为自由电子,少子为空穴;在硅晶体中掺入B(磷)三价元素,多子为空穴,少子为自由电子;6.PN结具有单相导电性,PN结具有雪崩击穿(T越高,击穿电压越大)和齐纳击穿(T越高,击穿电压越小),均可逆,热击穿不可逆;PN结具有电容效应,势垒电容(耗尽层变化等效的电容)扩散电容(非平衡少子引起的电荷量的变化等效出来的电容效应) 阅读详情

A. Little Pony and Crystal Mine
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Twilight Sparkle once got a crystal from the Crystal Mine. A crystal of size n (n is odd; n > 1) is an n × n matrix with a diamond inscribed into it.

You are given an odd integer n. You need to draw a crystal of size n. The diamond cells of the matrix should be represented by character "D". All other cells of the matrix should be represented by character "*". Look at the examples to understand what you need to draw.

Input

The only line contains an integer n (3 ≤ n ≤ 101; n is odd).

Output

Output a crystal of size n.

Sample test(s)
input
3
output
*D*
DDD
*D*
input
5
output
**D**
*DDD*
DDDDD
*DDD*
**D**
input
7
output
***D***
**DDD**
*DDDDD*
DDDDDDD
*DDDDD*
**DDD**
***D***



学习C语言时候最简单的模拟。。


AC代码:


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
int main(int argc, char const *argv[])
{
	int n;
	while(cin >> n) {
		int a = n /2, b = 1, c = 1;
		for(int i = 1; i <= n; ++i) {
			if(a >= 1) {
				for(int j = 1; j <= a; ++j)
					printf("*");
				for(int j = 1; j <= b; ++j)
					printf("D");
				for(int j = 1; j <= a; ++j)
					printf("*");
				printf("\n");
				a -= 1;
				b += 2;
			}
			else if(a == 0) {
				for(int j = 1; j <= n; ++j)
					printf("D");
				printf("\n");
				a -= 1;
				b -= 2;
			}
			else {
				for(int j = 1; j <= c; ++j)
					printf("*");
				for(int j = 1; j <= b; ++j)
					printf("D");
				for(int j = 1; j <= c; ++j)
					printf("*");
				printf("\n");
				c += 1;
				b -= 2;
			}
		}
	}
	return 0;
}


django drf 框架知识点(一)——serializer序列化器_用法全解 【django drf】序列化器:别名设置,全部参数序列化,自定义字段,只读只写,部分更新 阅读详情

相关推荐

腾讯文档API逆向分析:不用Selenium也能批量导出的黑科技

本文揭秘了如何通过Python逆向分析腾讯文档的隐藏API,实现无需Selenium即可批量导出在线表格的高效方法。详细解析了API调用流程、Cookie维护及异常处理技巧,相比传统方案性能提升显著,适用于大量文档导出的自动化场景。

h9j8k7l6m5n的博客 1205

Codeforces Round #259 (Div. 2) A-Little Pony and Crystal Mine

A. Little Pony and Crystal Mine time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle once got a

守护生命的绿荷的专栏 911

FPGA+滨淞CCD实战:手把手教你搭建S7031/S10142成像电路(附避坑指南)

本文详细介绍了使用FPGA驱动滨淞CCD传感器(S7031/S10142)构建高精度成像系统的完整实战流程。内容涵盖核心器件选型、系统架构规划、电路板(焦面板与接口板)设计要点、FPGA Verilog逻辑实现,并提供了从电源管理、信号调理到数据采集的详细避坑指南,帮助读者从零搭建稳定可靠的成像电路。

weixin_29271263的博客 238

A. Little Pony and Crystal Mine

题目链接:https://codeforces.com/contest/454/problem/A A. Little Pony and Crystal Mine time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Twilight Spar...

不想起标题 277

手把手教你:如何为自制的STM32H7飞控板适配PX4固件(基于NuttX)

本文详细介绍了如何为自制的STM32H7飞控板适配PX4固件,基于NuttX系统进行移植。从硬件设计规范到软件环境配置,再到PX4固件的移植与调试,提供了完整的实战指南。特别分享了如何复用FMU-v6u参考设计以节省开发时间,并解决了常见问题,帮助开发者快速实现高性能飞控系统的搭建。

weixin_27697385的博客 478

08-SD卡-TF卡硬件电路设计

SD卡-TF卡硬件电路设计

weixin_66510961的博客 8280

Codeforces Round #259 (Div. 2) A.Little Pony and Crystal Mine

这很明显是一道很水的模拟题..........也可以搜索,但是MAX n只是101,直接

Mixfix 1112

融合双主干网络提升YOLOv8性能一种基于SOTA思想的目标检测改进

YOLOv8采用了单一的主干网络进行特征提取,通常是基于CSPDarknet作为骨干网络,在目标检测过程中通过不同的卷积层提取不同尺度的信息。虽然这种设计在大多数应用场景下表现出色,但在面对复杂背景、细节丰富的物体或小物体检测时,YOLOv8有时难以保持良好的精度。在本文中,我们提出了一种基于双主干网络的YOLOv8改进方案,通过结合先进的SOTA思想,全面提升了YOLOv8在目标检测任务中的表现。双主干网络架构。

博客 1161

cf 454A Little Pony and Crystal Mine

水题,直接找规律。。

ccmmfit 575

【电机驱动与运动控制】期末重点问题集合

问题1 梯形曲线和S形曲线各自的特点和区别,比较梯形和S形曲线位置、速度、加速度、加加速度的区别。 问题2 总惯量的计算包含哪几个部分? 哪几个部分需要进行折算? 在齿轮箱的输出侧(2号轴)总惯量需要折算到齿轮箱的输入侧(1号轴) 为什么需要折算? 齿轮箱比的存在使2号轴的转速和电机的转速不同 问题3 指出每个部分的名称。 每个部分的功能。 主磁极的励磁绕组:绝大部分直流电机都是由励磁绕组通以直流电建立主磁场; - 电枢铁心:在两个主磁极内表面之间,由硅钢片叠成的圆

【人工智障 | 计算鸡视觉 | 机器孩】 5710

STM32 IIC温湿度传感器(STH45)实验

精度 ΔRH = ±1.0 %RH, ΔT = ±0.1 °C• 平均电流:0.4 μA,空闲电流:80 nA• I2C FM、CRC 校验和、乘法。I2C 地址。• 专利保护选项 [1]、PTFE 膜和可拆卸保护盖• 工作范围:0 …100 %相对湿度,−40…125 摄氏度• 在冷凝环境中功能齐全• 动力加热器,真正的NIST可追溯性• JEDEC JESD47 认证 • 符合 ISO 17025 : 2017 的传感器专用校准证书,3 点温度校准。

baidu_34971492的博客 3086

Codeforces Round #259 (Div. 2) A. Little Pony and Crystal Mine(简单模拟实现题)

Codeforces Round #259 (Div. 2) A. Little Pony and Crystal Mine(简单模拟实现题)

1291

基于扣子3.0复刻MIT“AI股神团队版”:实时股票数据API接入与策略选股复盘系统

基于扣子3.0的AI量化投资系统摘要 本文提出了一种基于扣子(Coze)3.0平台的AI量化投资解决方案,整合实时股票数据与策略选股功能。系统采用三层架构: 数据层:通过AKShare等开源工具获取A股实时行情和历史K线数据,支持批量数据抓取和清洗 策略层:内置多因子选股模型和技术指标分析模块,实现自动化标的筛选 应用层:利用扣子3.0的插件和工作流功能,构建从数据采集到投资建议的完整流程 系统特点包括:完全开源的数据接入方案、Python实现的策略计算模块、以及扣子平台提供的可视化编排能力~~~~~~~~

huanghm88的专栏 275

CODE[VS] 3337 Little Pony and Crystal Mine 题解

由题意得: 1.输入数字n,即输出图案的层数 2.先输出“*”,再输出“D”   3.图案分为上下两段对称图形 4.上端“*”数量与递减,而“D”数量递增,每层符号数量与层数有关 5.代码如下: #include&lt;stdio.h&gt; int main() {     int n,m,i,j;     scanf("%d",&amp;n);     m=n/2+1; ...

aptx4869971的博客 355

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

CF 454A(Little Pony and Crystal Mine-画图[水])

A. Little Pony and Crystal Mine time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle once got a

nike0good |Oier&ACMer | 熟能生巧 1631

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

Codeforces 454A Little Pony and Crystal Mine(水题)

题目链接:Codeforces 454A Little Pony and Crystal Mine 题目大意:给定n,要求输出指定图形。 解题思路:水题。 #include #include #include using namespace std; int n; void put (int i) { for (int j = 0; j < i; j++)

不慌不忙、不急不躁 1327

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Codeforces Round #259 (Div. 2) A. Little Pony and Crystal Mine

A. Little Pony and Crystal Mine time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle once got a

A Cube Master 690

Codeforces 454A. Little Pony and Crystal Mine

time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle once got a crystal from the Crystal Mine. A crystal of size n (n

jjs98 963

Codeforces 454A Little Pony and Crystal Mine

#define _CRT_SECURE_NO_WARNINGS #include &lt;iostream&gt; #include &lt;cstdio&gt; #include &lt;math.h&gt; #include &lt;string&gt; #include &lt;algorithm&gt; #include &lt;vector&gt; using namespace s...

Polanwind 270

codeforce 453B - Little Pony and Harmony Chest

题目如下: B. Little Pony and Harmony Chest time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Princ

wangyuquanliuli的专栏 1583

Codeforces 454B Little Pony and Sort by Shift(水题)

题目链接:Codeforces 454B Little Pony and Sort by Shift 题目大意:给定一个序列,每次可以将最后一个数放到最前面,问说最少移动几次使得序列变成一个非递减序列。 解题思路:水题,找到序列中最小的位置,然后判断一下是否递增。注意1 2 1这种有多个最小值的情况。 #include #include #include using name

不慌不忙、不急不躁 1627

Codeforces Round #259(454A,454B,453A(排列组合))

1.Little Pony and Crystal Mine 题目链接: http://codeforces.com/problemset/problem/454/A 解题思路: Brief description: Draw the grid graph as the problem said. Analysis: Just a few basi

piaocoder 612

Codeforces Round #259 (Div. 2) 题解

Codeforces Round #259 (Div. 2) 题解

u010084308的专栏 2079

Codeforces Round #454 A. Masha and Bears

#include #include #include #include #include #include #include #include #include #include #include #include #define PI acos(-1.0) #define in freopen("in.txt", "r", stdin) #define out freopen("out.txt"

床前明月光 292

Codeforces Round #454 - Div. 1 - (A)

A. Shockers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Valentin participates in a show called "Shocker

Orz 391

Codeforces Round #259 (Div. 2)

A. Little Pony and Crystal Mine time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle once got a crystal from the Cryst...

Fighting-Dawn丶的专栏 1011
上一篇: Codeforces Round #251 (Div. 2) 439C Devu and Partitioning of the Array(脑洞)
下一篇: Codeforces Round #251 (Div. 2) 439D Devu and his Brother(脑洞)
GKHack
博客等级 码龄12年 48粉丝 291原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值