1705: 小明在工作 Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 179  Solved: 59 SubmitStatusWeb Board Description 小明的工作是负责记录饭堂中正在排队的人的信息 在他的工作中会有三种可能的事件发生:     1.编号为id的学生加入到队伍的最后面     2.排在最前面的学生打完饭离开了队伍     3.老板过来询问当前排在队伍前方第k个的学生的编号 由于每天的工作量太大(每天最多有10000…
题目描述 小明的工作是负责记录饭堂中正在排队的人的信息 在他的工作中会有三种可能的事件发生:     1.编号为id的学生加入到队伍的最后面     2.排在最前面的学生打完饭离开了队伍     3.老板过来询问当前排在队伍前方第k个的学生的编号 由于每天的工作量太大(每天最多有100000个以上事件发生), 小明苦不堪言,让你写个程序帮他 输入 输入的第一个数是正整数T,表明接下来有T组数据 每组数据的第一个数为正整数n,表示有n件事会发生 接下来有n行,每行分别表示上诉三种事件的其中一种,格…
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3049    Accepted Submission(s): 2364 Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of…
Flow Layout Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3091   Accepted: 2148 Description A flow layout manager takes rectangular objects and places them in a rectangular window from left to right. If there isn't enough room in one r…
n个人 小明编号为m 从编号为a的人开始数 起始数字为b 遇到素数duang 并反相 求小明应该说什么 Sample Input 310 2 //n m3 4 //a b3 32 64 13 8 Sample Output duangduang10 # include <cstdio> # include <cstring> # define LL long long using namespace std ; ; bool notprime[MAXN];//值为false表示素数…
 悼念512汶川大地震遇难同胞--一定要记住我爱你 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 9453    Accepted Submission(s): 5736 Problem Description 当抢救人员发现她的时候,她已经死了,是被垮塌下来的房子压死的,透过那一堆废墟的的间隙可以看到她死亡的姿势,双膝跪着,整个…
题意:蚂蚁在木棍上爬,速度1cm/s,给出木棍长度和每只蚂蚁的位置,问蚂蚁全部下木棍的最长时间和最短时间. 模拟一下,发现其实灰常水的贪心... 不能直接求最大和最小的= =.只要求出每只蚂蚁都走长路下木棍时的最大值,和走短路时的就行了. 代码: /* * Author: illuz <iilluzen@gmail.com> * Blog: http://blog.csdn.net/hcbbt * File: uva10714.cpp * Lauguage: C/C++ * Create Da…
http://acm.hdu.edu.cn/showproblem.php?pid=4891 给出一个文本,问说有多少种理解方式. 1. $$中间的,(s1+1) * (s2+1) * ...*(sn+1), si表示连续的空格数. 2.{}中间,即 | 的个数+1. 就是模拟 #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <…
Mishka started participating in a programming contest. There are nn problems in the contest. Mishka's problem-solving skill is equal to kk. Mishka arranges all problems from the contest into a list. Because of his weird principles, Mishka only solves…
Problem Description The Chinese Zodiac, known as Sheng Xiao, is based on a twelve-year cycle, each year in the cycle related to an animal sign. These signs are the rat, ox, tiger, rabbit, dragon, snake, horse, sheep, monkey, rooster, dog and pig.Vict…