HLJUOJ1003(预处理)

2024-09-07 19:58
文章标签 预处理 hljuoj1003

本文主要是介绍HLJUOJ1003(预处理),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1003: Time

Time Limit: 1 Sec   Memory Limit: 128 MB
Submit: 27   Solved: 13
[ Submit][ Status][ Web Board]

Description

Digital clock use 4 digits to express time, each digit is described by 3*3 characters (including”|”,”_”and” “).now given the current time, please tell us how can it be expressed by the digital clock.

Input

There are several test cases.

Each case contains 4 integers in a line, separated by space.

Proceed to the end of file.

Output

For each test case, output the time expressed by the digital clock such as Sample Output.

Sample Input

1 2 5 6
2 3 4 2

Sample Output

    _  _  _ | _||_ |_ ||_  _||_|_  _     _ _| _||_| _|
|_  _|  ||_ 

HINT

The digits showed by the digital clock are as follows:_  _     _  _  _  _  _  _ | _| _||_||_ |_   ||_||_|| |||_  _|  | _||_|  ||_| _||_|
 
 
 
解题思路:
	题意要求把相应的数字转换成时钟对应的图形输出。
	首先预处理出0~9所有数字的图形,这里很多细节,比如每个数字占三个位置,如果是1的话,前面两个补空格什么的····具体详见代码···此处坑无限多
 
 
完整代码:
#include <functional>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstring>
#include <climits>
#include <cassert>
#include <complex>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>
using namespace std;#pragma comment(linker, "/STACK:102400000,102400000")typedef long long LL;
typedef double DB;
typedef unsigned uint;
typedef unsigned long long uLL;/** Constant List .. **/ //{const int MOD = int(1e9)+7;
const int INF = 0x3f3f3f3f;
const LL INFF = 0x3f3f3f3f3f3f3f3fLL;
const DB EPS = 1e-9;
const DB OO = 1e20;
const DB PI = acos(-1.0); //M_PI;
const int maxn = 1001;
int a[4];string s1[maxn] = { " _ " , "   " , " _ " , " _ " , "   " , " _ " , " _ " , " _ " , " _ " , " _ " };
string s2[maxn] = { "| |" , "  |" , " _|" , " _|" , "|_|" , "|_ " , "|_ " , "  |" , "|_|" , "|_|" };
string s3[maxn] = { "|_|" , "  |" , "|_ " , " _|" , "  |" , " _|" , "|_|" , "  |" , "|_|" , " _|" };int main()
{#ifdef DoubleQfreopen("in.txt","r",stdin);#endifwhile(cin >> a[0] >>a[1] >> a[2] >> a[3]){for(int i = 0 ; i < 4 ; i ++)cout << s1[a[i]];cout << endl;for(int i = 0 ; i < 4 ; i ++)cout << s2[a[i]];cout << endl;for(int i = 0 ; i < 4 ; i ++)cout << s3[a[i]];cout << endl;}
}


这篇关于HLJUOJ1003(预处理)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1146015

相关文章

C语言进阶(预处理命令详解)

《C语言进阶(预处理命令详解)》文章讲解了宏定义规范、头文件包含方式及条件编译应用,强调带参宏需加括号避免计算错误,头文件应声明函数原型以便主函数调用,条件编译通过宏定义控制代码编译,适用于测试与模块... 目录1.宏定义1.1不带参宏1.2带参宏2.头文件的包含2.1头文件中的内容2.2工程结构3.条件编

Python使用vllm处理多模态数据的预处理技巧

《Python使用vllm处理多模态数据的预处理技巧》本文深入探讨了在Python环境下使用vLLM处理多模态数据的预处理技巧,我们将从基础概念出发,详细讲解文本、图像、音频等多模态数据的预处理方法,... 目录1. 背景介绍1.1 目的和范围1.2 预期读者1.3 文档结构概述1.4 术语表1.4.1 核

动手学深度学习【数据操作+数据预处理】

import osos.makedirs(os.path.join('.', 'data'), exist_ok=True)data_file = os.path.join('.', 'data', 'house_tiny.csv')with open(data_file, 'w') as f:f.write('NumRooms,Alley,Price\n') # 列名f.write('NA

【动手学深度学习】04 数据操作 + 数据预处理(个人向笔记)

数据操作 N维数组是机器学习和神经网络的主要数据结构其中 2-d 矩阵中每一行表示每一行表示一个样本 当维度来到三维的时候则可以表示成一张图片,再加一维就可以变成多张图片,再加一维则可以变成一个视频 访问元素 冒号表示从冒号左边的元素到冒号右边的前一个元素(开区间),其中如果左边为空,那么表示从第一个开始,如果右边为空,那么表示访问到最后一个,如果两边都为空,则表示全部访问其中一行中我们指

数据预处理与协同过滤推荐算法——从数据清洗到个性化电影推荐

推荐系统在现代应用中占据了重要地位,尤其在电影、音乐等个性化内容推荐中广泛使用。本文将介绍如何使用数据预处理、特征工程以及多种推荐算法(包括协同过滤、基于内容的推荐、混合推荐等)来实现电影推荐系统。通过Pandas、Scikit-learn、TensorFlow等工具,我们将展示如何从数据清洗开始,逐步实现各类推荐算法。  完整项目代码: 基于协同过滤的电影推荐系统 一、数据预处

CF Bayan 2015 Contest Warm Up A.(模拟+预处理)

A. Bayan Bus time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output 题目链接: http://codeforces.com/contest/475/problem/A The fi

C语言之预处理详情

目录 前言1.预定义符号2.#define定义常量3.#define定义宏4.带有副作用的宏参数5.宏替换的规则6.宏和函数的对比7.#和##运算符7.1 #运算符7.2 ##运算符 8.命名约定9.undef10.命令行指令11.条件编译12.头文件的包含12.1 头文件包含方式12.1.1 本地头文件包含12.1.2 库文件包含 12.2 嵌套文件包含 13.其他预处理指令总结

统计学(贾俊平)学习笔记--第三章、 数据预处理

数据预处理无论是从数据分类分析、数据信息抽取、数据挖掘、模型建立等方面都是需要的,也是数据工作者最开始招手做的,而统计学(贾俊平)中从理论的角度讲解了数据预处理的概念和方法吗,在此将主要要点列举如下,供有心人参考学些。       数据的预处理是在对数据分类或分组之前所做的必要处理,内容包括数据的审核、筛选、排序等。          审核就是检查数据中是否有错误。从完整性和准

C语言-程序环境 #预处理 #编译 #汇编 #链接 #执行环境

文章目录 前言 一、程序的环境翻译和执行环境 二、翻译环境 (一)、整体把握 (一)、编译 1、预处理(预编译) 2、编译 a、词法分析 b、语法分析 c、语义分析 d、符号汇总 3、汇编 (二)、链接 三、运行环境 总结​​​​​​​ 前言 路漫漫其修远兮,吾将上下而求索; PS:本文参考了《程序员的自我修养》,致敬大佬们! 一、程序的

自定义 ConsoleAppender 实现日志预处理

文章目录 1. 概述2. ConsoleAppender 类介绍3. 在日志打印前进行处理3.1 实现步骤3.2 示例代码3.3 代码解析 4. 配置自定义 ConsoleAppender4.1 使用 `log4j.properties` 配置文件4.2 使用 `log4j2.xml` 配置文件 5. 常见使用场景6. 总结 1. 概述 在日志系统中,ConsoleAppend