模拟
文章平均质量分 50
丶Xylon
这个作者很懒,什么都没留下…
展开
-
【华为OD机试】运维日志排序
运维工程师采集到某产品线网运行一天产生的日志n条,现需根据日志时间先后顺序对日志进行排序,日志时间格式为H:M:S.N。思路:将输入的时间缺的0补上,然后使用map存储原日期和格式化后的日期,再对其进行排序。第一行输入一个整数n表示日志条数,1原创 2023-07-30 20:53:48 · 1469 阅读 · 0 评论 -
【华为OD机试】 选修课
现有两门选修课,每门选修课都有一部分学生选修,每个学生都有选修课的成绩,需要你找出同时选修了两门选修课的学生,先按照班级进行划分,班级编号小的先输出,每个班级按照两门选修课成绩和的降序排序,成绩相同时按照学生的学号升序排序。然后另起一行输出这个班级同时选修两门选修课的学生学号,学号按照要求排序(按照两门选修课成绩和的降序,成绩和相同时按照学号升序学生之间以英文分号分隔。同时选修了两门选修课的学生的学号,如果没有同时选修两门选修课的学生输出NULL,没有同时选修了两门选修课的学生,输出NULL。原创 2023-07-30 16:17:42 · 374 阅读 · 0 评论 -
【2019牛客暑期多校训练营(第八场)】B.Beauty Values
题目描述Gromah and LZR have entered the second level. There is a sequencea_1, a_2, \cdots, a_na1,a2,⋯,anon the wall.There is also a note board saying "the beauty value of a sequence is the numbe...原创 2019-08-10 17:37:12 · 408 阅读 · 0 评论 -
【蓝桥杯 历届试题】小数第n位
历届试题 小数第n位 问题描述 我们知道,整数做除法时,有时得到有限小数,有时得到无限循环小数。 如果我们把有限小数的末尾加上无限多个0,它们就有了统一的形式。 本题的任务是:在上面的约定下,求整数除法小数点后的第n位开始的3位数。输入格式 一行三个整数:a b n,用空格分开。a是被除数,b是除数,n是所求的小数后位置(0<a,b,n<1000000...原创 2019-03-23 22:09:41 · 302 阅读 · 0 评论 -
【PTA L1-016】谁先倒
L1-016 谁先倒 (15 分)划拳是古老中国酒文化的一个有趣的组成部分。酒桌上两人划拳的方法为:每人口中喊出一个数字,同时用手比划出一个数字。如果谁比划出的数字正好等于两人喊出的数字之和,谁就输了,输家罚一杯酒。两人同赢或两人同输则继续下一轮,直到唯一的赢家出现。下面给出甲、乙两人的酒量(最多能喝多少杯不倒)和划拳记录,请...原创 2019-02-19 18:13:23 · 826 阅读 · 0 评论 -
【PTA 7-1】整除光棍 除法模拟
7-1 整除光棍(20 分)这里所谓的“光棍”,并不是指单身汪啦~ 说的是全部由1组成的数字,比如1、11、111、1111等。传说任何一个光棍都能被一个不以5结尾的奇数整除。比如,111111就可以被13整除。 现在,你的程序要读入一个整数x,这个整数一定是奇数并且不以5结尾。然后,经过计算,输出两个数字:第一个数字s,表...原创 2019-02-19 13:59:26 · 386 阅读 · 0 评论 -
【PTA 7-3】抓老鼠啊~亏了还是赚了?
7-3 抓老鼠啊~亏了还是赚了? (20 分)某地老鼠成灾,现悬赏抓老鼠,每抓到一只奖励10元,于是开始跟老鼠斗智斗勇:每天在墙角可选择以下三个操作:放置一个带有一块奶酪的捕鼠夹(T),或者放置一块奶酪(C),或者什么也不放(X)。捕鼠夹可重复利用,不计成本,奶酪每块3元。聪明的老鼠呢?它们每天可能会派出一只老鼠到墙角,看看墙角有啥:若什么也没有(...原创 2019-02-24 09:39:02 · 713 阅读 · 0 评论 -
【UVA 227】Puzzle 模拟
题目地址: http://vj.rainng.com/vjudge/problem/viewProblem.action?id=25625题意:有一个由24个字母和1个空格的5*5字符矩阵,然后输入操作(可能不止一行),对空格位置进行操作直到输入0为止,“A,B,L,R”分别为“上,下,左,右”,与相邻字符进行交换,若出现非法操作,则输出"This puzzle has no final co...原创 2019-01-18 09:14:38 · 220 阅读 · 0 评论 -
【CF 1100B】Build a Contest
B. Build a ContestArkady coordinates rounds on some not really famous competitive programming platform. Each round features nn problems of distinct difficulty, the di...原创 2019-01-17 15:53:46 · 459 阅读 · 0 评论 -
【CF 1090M】The Pleasant Walk
M. The Pleasant WalkThere are nn houses along the road where Anya lives, each one is painted in one of kk possible colors.Anya likes walking along this road, but s...原创 2018-12-10 20:58:11 · 472 阅读 · 0 评论 -
【CF 1090A】Company Merging
A. Company MergingA conglomerate consists of nn companies. To make managing easier, their owners have decided to merge all companies into one. By law, it is only pos...原创 2018-12-10 20:54:41 · 487 阅读 · 0 评论 -
【CF1088B】Ehab and subtraction
B. Ehab and subtractionYou're given an array aa. You should repeat the following operation kk times: find the minimum non-zero element in the array, print it, and the...原创 2018-12-09 20:24:43 · 423 阅读 · 0 评论 -
【CF 1084A】The Fair Nut and Elevator
A. The Fair Nut and ElevatorThe Fair Nut lives in nn story house. aiai people live on the ii-th floor of the house. Every person uses elevator twice a day: to get from...原创 2018-12-12 23:15:22 · 359 阅读 · 0 评论 -
【HDU 6023】Automatic Judge
Automatic JudgeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 3949 Accepted Submission(s): 1485 Problem DescriptionWelcome to HDU ...原创 2018-09-02 15:13:37 · 239 阅读 · 0 评论 -
【CF 1028A】Find Square
A. Find SquareConsider a table of size n×mn×m, initially fully white. Rows are numbered 11 through nn from top to bottom, columns 11 through mm from left to r...原创 2018-08-28 16:05:28 · 479 阅读 · 0 评论 -
【PTA】7-7 大炮打蚊子
7-7 大炮打蚊子(15 分)现在,我们用大炮来打蚊子:蚊子分布在一个M×N格的二维平面上,每只蚊子占据一格。向该平面的任意位置发射炮弹,炮弹的杀伤范围如下示意: OOXO O其中,X为炮弹落点中心,O为紧靠中心的四个有杀伤力的格子范围。若蚊子被炮弹命中(位于X格),一击毙命,若仅被杀伤(位于O格),则损失一半的生命力。也就是说,一次命中或者两次杀伤均可消灭蚊子。现...原创 2018-07-22 18:06:38 · 4394 阅读 · 0 评论 -
【CF 1020A】New Building for SIS
A. New Building for SISYou are looking at the floor plan of the Summer Informatics School's new building. You were tasked with SIS logistics, so you really care abou...原创 2018-08-17 11:36:47 · 268 阅读 · 0 评论