-
c51music
单片机数字音乐盒课程设计,内含源代码,报告说明详细,绝对可用(music.asm)(SCM digital music boxes curriculum design, containing the source code, the report describes in detail, absolutely available (music.asm))
- 2020-06-26 05:00:02下载
- 积分:1
-
q1
说明: Pokeface
题目描述
魔术师将一叠扑克顺次在桌上排成一行,初始全部正面朝上。随后,他每次挥一挥衣袖,都会翻转一连串的扑克,改变它们的正反朝向。从古代传下来的规矩,魔术师皆有师傅,他们要随时准备回答师傅的问题。问题形如:目前从第i张扑克牌到第j张扑克牌中,有几张正面朝上?
作为魔术师的助手,你被要求学习程序设计、算法与数据结构。现在,魔术师把这个问题交给了你,你需要编写一个程序,维护相应的数据结构来保存桌子上牌面的情况,同时对于师傅的每一个问题,你要用尽量快的速度计算出答案。
输入
第一行包含三个正整数n、p和q。n表示扑克牌的数量,p表示魔术师的挥一挥次数,q表示师傅的问话次数。
接下来共p+q行,每行包含一个操作,操作分为2种:
H i j 魔术师挥一挥,改变了第i张牌到第j张牌的正反
Q i j 师傅问话:截至目前,第i张到第j张牌中有多少张正面朝上
操作中恰好包含p次H操作,q次Q操作,与第一行的p和q吻合。H操作和Q操作的范围均包含边界(即第i张和第j张牌)。
对于每个操作,输入保证1 ≤ i ≤ j ≤ n。
输出
对于每次Q操作,输出一行,包含一个整数,表示问题的答案。
提示:线段树(Pokeface
Title Description
The magician will stack poker table sequentially in a row, all the initial face-up. He then every wisp will flip a series of poker pros and cons of changing their orientation. The rules handed down ancient times, the master magician Jie, they be ready to answer the teacher s questions. Question of the form: Currently playing cards i to j-card poker, there are a few face-up?
As a magician s assistant, you are required to learn programming, algorithms and data structures. Now, the magician put this question to you, you need to write a program to maintain appropriate data structure to hold the cards on the table face the situation, while the master for each question, and you want to use as quickly calculate the answer.
Enter
The first line contains three positive integers n, p and q. n represents the number of poker, p represents the wave of the magic number, q represents the number of master s questioning.
Next, a total of p+ q rows, each containi)
- 2015-01-18 15:02:14下载
- 积分:1
-
LED
用PIC16f1847做的流水灯,经过测试可以运行(travelling LED program)
- 2013-11-16 02:38:20下载
- 积分:1
-
8ZNSB99SE
8 基于义隆单片机开发的智能设备协议99SE电路图(8 Elan microcontroller development based on smart device protocol 99SE Circuit
)
- 2013-09-09 09:35:30下载
- 积分:1
-
PMS150 工程模板
包含芯片初始化------Init.asm;寄存器定义-----Ram_config.asm;终端入口和处理----interrupt.asm;按键处理------Key.asm;低功耗休眠等----main.c
- 2022-01-27 16:08:38下载
- 积分:1
-
FIRFilter
通过对语音信号的采集和AD50数模转换实现语音信号的处理,并通过C54试验台可以很好的实现语音再现。FIR数据滤波数据需要通过MATLAB来实现。(Through the acquisition and AD50 voice signal digital-analog conversion of voice signal processing, and through the C54 test bed can be a very good voice reproduction. FIR data filtering data to achieve through MATLAB.)
- 2010-05-27 16:22:54下载
- 积分:1
-
keyboard-monitor
程序功能为当按下键盘上的某个键时,将该键的行号和列号显示在数码管上。(Program functions when you press a key on the keyboard, the keys of the row and column numbers displayed on the digital pipe.)
- 2011-04-21 21:17:42下载
- 积分:1
-
数据采集系统程序
以GMS97C2051单片机为核心,采用TLC2543 12位串行A/D转换器,设计了一个串行数据采集/传输模块,给出了主要源程序。(to GMS97C2051 as the core, using TLC2543 12 serial A/D converter, the design of a serial data collection/transmission module, is the main source.)
- 2005-04-15 10:59:10下载
- 积分:1
-
GYZX
这是一个检测高压线路是否有电,还是无电的程序,程序使用汇编语言编辑的.(This is a high voltage detection circuits-- whether or not-- the procedure is the use of assembly language editor.)
- 2006-06-23 11:25:52下载
- 积分:1
-
lms_flp32
TigerSharc TS201 floating point lms filter routine(TigerSharc TS-201 floating point lms filte r routine)
- 2006-11-06 22:42:57下载
- 积分:1