UVa 706 / POJ 1102 LCD Display (模拟)

从选卡到验证:CST仿真GPU加速全流程实战指南 本文详细介绍了CST仿真中GPU加速的全流程实战指南,从硬件选型到软件配置,再到性能验证和常见问题排查。通过对比专业卡与游戏卡的性能差异,提供硬件选型建议,并分享驱动安装、关键设置及CST软件配置的黄金法则,帮助用户显著提升仿真效率。 阅读详情

706 - LCD Display

Time limit: 3.000 seconds

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=647

http://poj.org/problem?id=1102

A friend of you has just bought a new computer. Until now, the most powerful computer he ever used has been a pocket calculator. Now, looking at his new computer, he is a bit disappointed, because he liked the LC-display of his calculator so much. So you decide to write a program that displays numbers in an LC-display-like style on his computer.

Input 

The input file contains several lines, one for each number to be displayed. Each line contains two integerss, n ( $1 \le s \le 10, 0\le n \le 99\,999\,999$), where n is the number to be displayed and s is the size in which it shall be displayed.

The input file will be terminated by a line containing two zeros. This line should not be processed.

Output 

Output the numbers given in the input file in an LC-display-style using s ``-'' signs for the horizontal segments and s ``|'' signs for the vertical ones. Each digit occupies exactly s+2 columns and 2s+3 rows. (Be sure to fill all the white space occupied by the digits with blanks, also for the last digit.) There has to be exactly one column of blanks between two digits.

Output a blank line after each number. (You will find a sample of each digit in the sample output.)

Sample Input 

2 12345
3 67890
0 0

Sample Output 

      --   --        -- 
   |    |    | |  | | 
   |    |    | |  | | 
      --   --   --   -- 
   | |       |    |    |
   | |       |    |    |
      --   --        -- 

 ---   ---   ---   ---   --- 
|         | |   | |   | |   |
|         | |   | |   | |   |
|         | |   | |   | |   |
 ---         ---   --- 
|   |     | |   |     | |   |
|   |     | |   |     | |   |
|   |     | |   |     | |   |
 ---         ---   ---   ---

先写个常量字符串数组~


完整代码:

/*UVa: 0.032s*/
/*POJ: 0ms,160KB*/

#include <cstdio>
#include <cstring>
const char code[5][31] =
{
	" -     -  -     -  -  -  -  - ",
	"| |  |  |  || ||  |    || || |",
	"       -  -  -  -  -     -  - ",
	"| |  ||    |  |  || |  || |  |",
	" -     -  -     -  -     -  - ",
};

int s;
char n[20];

inline void print(int t , int len)
{
	for (int i = 0; i < len; i++)
	{
		int a = n[i] & 15;
		if (i) putchar(' ');
		putchar(code[t][a * 3]);
		for (int j = 0; j < s; j++)
			putchar(code[t][a * 3 + 1]);
		putchar(code[t][a * 3 + 2]);
	}
	putchar('\n');
}

int main(void)
{
	int len;
	while (scanf("%d%s", &s, n), s)
	{
		len = strlen(n);
		for (int i = 0; i < 5; i++)///从上往下打印
		{
			if (i == 1 || i == 3)
				for (int j = 0; j < s; j++)
					print(i, len);
			else
				print(i, len);
		}
		putchar('\n');
	}
	return 0;
}

Source

SPSS(二)SPSS实现多因素方差分析模型(图文教程+数据集) SPSS(二)SPSS实现多因素方差分析模型 单因素方差分析上一篇博客https://blog.youkuaiyun.com/LuYi_WeiLin/article/details/89917656已经介绍完毕 这篇博客我们主要来学习多因素方差分析 多因素方差分析,就是同时考虑若干个控制因素的情况下,分别分析它们的改变是否造成观察变量的显著变动 (多个自变量,一个因变量)自变量类型以分类变量为主也可以... 阅读详情

相关推荐

编译原理2024期末复习(面向做题,大题速学)【太原理工大学】

归约-归约”冲突就是在项目集规范族一个状态中两个。

m0_63181421的博客 1万+

NUC1076 LCD-Display【打印图案】

LCD-Display 时间限制: 1000ms 内存限制: 65536KB 问题描述 A friend of you has just bought a new computer. Until now, the most powerful computer he ever used has been a pocket calculator. Now, looking at his ne

海岛Blog 814

海康VisionMaster使用学习笔记7-Group模块

光标需放在[]中选择循环索引,循环索引用于实现依次检测10个匹配框的顶点,若不订阅,模块会循环检测同一个匹配框。可以看到绿色是它的边缘点.为方便查看顶点,将边缘点设置为不可见。循环使能打开,开始值设为0,循环结束值设为快速匹配的匹配个数。回到上一层,点击Group工具的设置图标,圆拟合的点设置为Group工具输出的点集。图像输入源选择Group的图像输入源。区域选择Group的快速匹配的匹配框。添加订阅到Group内部的顶点检测。对匹配框区域进行顶点检测。用于定位匹配框中的顶点。添加快速匹配的匹配框。

风凌的博客 4176

UVa 414 Machined Surfaces (water ver.)

414 - Machined Surfaces Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem&problem=355 An imaging device furnishes di

AC,∑ndless 6714

RK-XCKU5P RoCEv2 传感器桥工程分析报告

烧入后这块 FPGA 就是一个固定身份(CA:FE:C0:FF:EE:00 / 192.168.0.2 / 无 FEC 100G)的RoCEv2 UC 端点,每秒在 UDP 12267 广播自报家门;对端 CX5 只要关 FEC、配 192.168.0.101 +MTU 4200,就能 ping 通它、用 UDP 8192 读写它的全部寄存器、再按"ECB 旁路交换 QPN/rkey"的方式建立 UC RDMA 通道收发数据。

eloudy的专栏 245

人工智能入门系列之一: 鸢尾花(Iris)多分类的神经网络详解及代码实现

这是最好的时代,我们一起来打造属于自动驾驶汽车上路、无人机飞天、智能机器人管工厂的AI未来 人工智能领域分化为两个阵营:其一是规则式(rule-based)方法,在人工智能早期占主峰;其二是神经网络(neural network)方法,后起之秀。随着硬件水平的提高,算力的指数式增长;人工智能的重心已经从规则式的专家时代转移到神经网络的数据时代。 “神经网络”不选择把人脑熟稔的逻辑规则传授给计算机...

NLP家的码奴小荷的博客 2万+

POJ 1835 宇航员 (模拟&三维向量旋转)

宇航员 http://poj.org/problem?id=1835 Time Limit: 2000MS Memory Limit: 30000K Description 问题描述:    宇航员在太空中迷失了方向,在他的起始位置现在建立一个虚拟xyz坐标系,称为绝对坐标系,宇航员正面的方向为x轴正方向,头顶方向为z轴正方向,则宇航员的初始状态如下

AC,∑ndless 3251

5分钟快速验证lvgl界面:VScode模拟器极简配置法(免环境变量版)

本文介绍了一种5分钟快速验证LVGL界面的极简配置方法,使用VSCode模拟器免环境变量配置,适合UI设计师和产品经理快速预览界面效果。通过预编译的SDL2库和配置好的VSCode工程模板,实现开箱即用的LVGL界面验证,大幅提升工作效率。

weixin_30790841的博客 314

UVa 118 Mutant Flatworld Explorers (模拟机器人移动)

118 - Mutant Flatworld Explorers Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=54 旋转时+1或+3再取模即可。 完整

AC,∑ndless 2570

【DRAM存储器五十五】LPDDR5介绍--command bus training

本文详细介绍了LPDDR5命令总线训练(CBT)的两种模式操作流程。在启用ODT进行高频/中频操作前,必须对命令总线进行训练,包括调整VREF(CA)电压和CA/CS信号时序。两种模式的主要区别在于VREF(CA)设置方式:模式1通过MR12直接设置,模式2通过DMI[0]引脚捕获DQ[6:0]数据更新MR12。训练流程涉及频率切换、模式寄存器配置、pattern发送及结果采样等步骤,最终确定最佳VREF(CA)和时序参数。文章还分析了不同PHY实现可能存在的差异,如训练pattern生成方式和采样次数等。

highman110的博客 648

药物对接仿真软件:HADDOCK_(16).实践项目:抗体-抗原对接案例

定义分子结构文件。

kkchenjj的博客 580

Codeforces Beta Round #74 (Div. 2) / 90B African Crossword (模拟)

B. African Crossword http://codeforces.com/problemset/problem/90%2FB time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard o

AC,∑ndless 2416

Vulkan入门系列3 - 绘制三角形代码解析(全)

【代码】Vulkan入门系列3 - 绘制三角形完整代码(带详细注释)

GPU全栈博主 1034

Codeforces Round #173 (Div. 2) / 282A Bit++(模拟)

A. Bit++ http://codeforces.com/problemset/problem/282/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 2227

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

UVa 10114 Loansome Car Buyer (模拟)

10114 - Loansome Car Buyer Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1055 Kara Van and Lee Sabre are l

AC,∑ndless 2074

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

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

Codeforces Beta Round #98 (Div. 2) / 137A Postcards and photos (模拟)

A. Postcards and photos http://codeforces.com/problemset/problem/137/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard

AC,∑ndless 2022

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

UVa 10189 Minesweeper (模拟)

10189 - Minesweeper Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1130 The Problem Have you ever played

AC,∑ndless 1848

Codeforces Round #186 (Div. 2) / 313B Ilya and Queries (字符串处理)

B. Ilya and Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ilya the Lion wants to help all his fri

AC,∑ndless 1810

【优化&大师级代码欣赏】Codeforces Round #137 (Div. 2) / 222B Cosmic Tables (矩阵)

B. Cosmic Tables http://codeforces.com/problemset/problem/222/B time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 1782

POJ 1028 / East Central North America 2001 Web Navigation (栈)

Web Navigation http://poj.org/problem?id=1028 Time Limit: 1000MS Memory Limit: 10000K Description Standard web browsers contain features to move backward and forward among the p

AC,∑ndless 1666

UVa 442/HDU 1082/ZOJ 1094 Matrix Chain Multiplication(模拟&栈)

442 - Matrix Chain Multiplication Time limit: 3.000 seconds Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative,

AC,∑ndless 1638

POJ 2260 Error Correction (模拟)

Error Correction http://poj.org/problem?id=2260 Time Limit: 1000MS Memory Limit: 65536K Description A boolean matrix has the parity property when each row and each column has an

AC,∑ndless 1603

UVa 591 Box of Bricks (模拟)

591 - Box of Bricks Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=467&page=show_problem&problem=532 Little Bob likes playing with his b

AC,∑ndless 1593

UVa 10700 Camel trading (计算表达式)

10700 - Camel trading Time limit: 3.000 seconds  http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=1641 Background Aroud 800 A.D., El

AC,∑ndless 1577

深挖C++:类和对象(中)

(先进后出)

xys_678的博客 246

C++移动构造函数详解

移动构造函数是C++11引入的一种特殊构造函数,用于从临时对象(右值)"窃取"资源来初始化新对象,而不是进行昂贵的深拷贝。char* data;public:// 移动构造函数:参数是右值引用 &&// 关键:把源对象的资源置空。

拒绝AI文,努力在AI时代写出感动人心的好文章 392
上一篇: UVa 264 Count on Cantor (waater ver.)
下一篇: UVa 10079 Pizza Cutting (water ver.)
synapse7
博客等级 码龄14年 432粉丝 701原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值