登录
首页 » Asm » q1

q1

于 2015-01-18 发布 文件大小:2KB
0 160
下载积分: 1 下载次数: 0

代码说明:

说明:  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)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 一品脱
    一个小巧玲珑的在线调查程序,它容量很小,可读性很高,多多关照-a pint-sized online survey procedures, capacity small, highly readable, to take care of
    2022-01-25 21:00:04下载
    积分:1
  • machine
    definition of machine epsilon
    2014-03-11 15:11:39下载
    积分:1
  • LUA
    对刚接触LUA的人很有帮助,讲解的都是Lua基础东西。(Helpful to explain the are Lua basis, something new to LUA.)
    2012-06-06 21:54:41下载
    积分:1
  • 网络僵尸3服务端代码Network Services zombie 3
    网络僵尸3服务端代码Network Services zombie 3-side code-Network Services zombie 3-side code
    2022-02-13 17:35:32下载
    积分:1
  • FDK-reconstruct
    通过vc2005编写的3D重建程序实现CT数据的三维重建过程,最终完成了重建。(Written by vc2005 3D reconstruction process, to achieve three-dimensional reconstruction of CT data)
    2016-07-12 11:39:57下载
    积分:1
  • ShowMTS
    说明:  Program to show com+ properties.
    2019-01-23 21:47:48下载
    积分:1
  • QQbobo
    说明:  请先运行QQ,双击你的灌水目标。 然后再点击聊天模式按钮(灌水要进入聊天模式的)。 然后把QQ的窗口最小化。(Please run QQ, double-click your target irrigation. And then click the chat mode button (water to enter the chat mode). QQ and then minimize the window.)
    2008-09-27 09:52:44下载
    积分:1
  • hack-penetrator-test
    黑客渗透笔记完整版,介绍了windows系统下渗透测试的方法(Hackers penetrate the full version of Notes)
    2016-07-11 09:59:27下载
    积分:1
  • MyQQ
    根据企业对QQ系统的要求,本系统可以实现以下目标:  操作简单方便、界面简洁美观。  每个客户端只能注册一次。  可以在局域网中实现文字及大图片的传输。  可以实现局域网视频。  可以实现多用户的信息通信。  系统运行稳定、安全可靠。 (According to business-to-QQ system requirements, the system can achieve the following goals:  is easy and simple interface, simple and beautiful.  Each client can only register once.  can be implemented in the LAN transmission of text and large images.  can achieve LAN video.  can achieve multi-user information and communication.  system is running stable, safe and reliable.)
    2010-02-04 08:57:35下载
    积分:1
  • 1
    说明:  SOA 是一种 IT 体系结构样式,支持将您的业务作为链接服务或可重复业务 任务进行集成,可在需要时通过网络访问这些服务和任务。(SOA is an IT architectural style, support your business as linked services, or can be integrated repeat business task, you can access these services when needed and tasks over a network.)
    2014-04-25 14:26:30下载
    积分:1
  • 696518资源总数
  • 104432会员总数
  • 16今日下载