模拟
xuanweiace
一个热爱算法竞赛的弱校ACMer路过。青大本,浙大硕,方向后端开发,菜鸡一枚,奋斗ing...
展开
-
【HDU - 5012】Dice(模拟,bfs)
题干:There are 2 special dices on the table. On each face of the dice, a distinct number was written. Consider a1.a2,a3,a4,a5,a6to be numbers written on top face, bottom face, left face, right ...原创 2019-11-02 16:01:06 · 220 阅读 · 0 评论 -
【CodeForces - 260B 】Ancient Prophesy (暴力匹配,BF算法,日期字符串)
题干:A recently found Ancient Prophesy is believed to contain the exact Apocalypse date. The prophesy is a string that only consists of digits and characters "-".We'll say that some date is mentione...原创 2018-11-14 17:07:36 · 344 阅读 · 0 评论 -
【CodeForces - 260C】Balls and Boxes (思维模拟,有坑,时光倒流)
题干:Little Vasya had n boxes with balls in the room. The boxes stood in a row and were numbered with numbers from 1 to n from left to right.Once Vasya chose one of the boxes, let's assume that its ...原创 2018-11-14 22:47:34 · 352 阅读 · 0 评论 -
【HihoCoder - 1880】地铁环线 (前缀和,水题,模拟)
题干:H市有一环线地铁,一共包含N站,编号1~N。正向行驶的地铁会按1 -> 2 -> 3 -> ... -> N -> 1的方向行驶,反向会按1 -> N -> N-1 -> ... -> 3 -> 2 -> 1的方向行驶。 给定所有相邻两站之间地铁行驶的时间(正向、反向时间相同),假设小Hi要从第X站到第Y站,请你判断...原创 2018-11-19 14:26:15 · 532 阅读 · 0 评论 -
【 CodeForces - 799A 】Carrot Cakes(模拟,细节,有坑)
题干:In some game by Playrix it takes t minutes for an oven to bake k carrot cakes, all cakes are ready at the same moment t minutes after they started baking. Arkady needs at least n cakes to complet...原创 2018-11-24 16:18:20 · 370 阅读 · 0 评论 -
【牛客 - 283C】模拟只会猜题意(简单模拟)
题干: 小西突然觉得回文串是一种非常优雅的东西,她突然想要把身边所有的字符串都变成回文!所谓回文串就是一个倒置后仍与自身相等的字符串,如“gxuacmmcauxg”和“gxuacmcauxg”。 小西不喜欢单身狗,所以小西只会处理长度为偶数的字符串。小西也不喜欢肥宅,所以小西处理的字符串只有小写英文字母。但是小西是个肥宅,不怎么喜欢活动,所以小西对于每个字母只会将其变为与...原创 2018-11-25 20:35:44 · 539 阅读 · 0 评论 -
【牛客 - 283E】贪心只能过样例(模拟)
题干: 小西是单身狗,所以她不喜欢看到有CP在秀恩爱!有一天,小西出来闲逛,发现街上的行人都排成了一排,并且可以用这种形式表示:MMFMMFFFMMM其中M表示男孩子,F表示女装的男孩子小西想让所有的CP都消失! 小西可以把任意一对'MF'或者'FM‘赶走并变为一个真正的小姐姐‘J’例如上述的例子可以变为:MJMJFJMM本来街上有11个人,这样就只有8个...原创 2018-11-25 20:35:23 · 450 阅读 · 0 评论 -
【CodeForces - 304B】Calendar (前缀和,水题)
题干:Calendars in widespread use today include the Gregorian calendar, which is the de facto international standard, and is used almost everywhere in the world for civil purposes. The Gregorian reform...原创 2018-11-29 22:21:56 · 396 阅读 · 0 评论 -
【CodeForces - 298B 】Sail (模拟,题意)
题干:The polar bears are going fishing. They plan to sail from (sx, sy) to (ex, ey). However, the boat can only sail by wind. At each second, the wind blows in one of these directions: east, south, we...原创 2018-12-04 17:25:08 · 367 阅读 · 0 评论 -
【CodeForces - 266B 】Queue at the School (模拟)
题干:During the break the schoolchildren, boys and girls, formed a queue of n people in the canteen. Initially the children stood in the order they entered the canteen. However, after a while the boys...原创 2018-11-15 22:19:26 · 323 阅读 · 0 评论 -
【CodeForces - 264A】Escape from Stones (模拟,卡精度的处理)
题干:Squirrel Liss lived in a forest peacefully, but unexpected trouble happens. Stones fall from a mountain. Initially Squirrel Liss occupies an interval [0, 1]. Next, nstones will fall and Liss will...原创 2018-11-15 22:14:18 · 440 阅读 · 0 评论 -
【CodeForces - 266C】Below the Diagonal (递归,子问题,贪心模拟)
题干:You are given a square matrix consisting of n rows and n columns. We assume that the rows are numbered from 1 to n from top to bottom and the columns are numbered from 1to n from left to right. S...原创 2018-11-15 22:09:02 · 512 阅读 · 0 评论 -
*【CodeForces - 195B】After Training (多解,模拟)
题干:After a team finished their training session on Euro football championship, Valeric was commissioned to gather the balls and sort them into baskets. Overall the stadium has n balls and m baskets....原创 2018-10-23 09:44:41 · 362 阅读 · 0 评论 -
【CodeForces - 1051C 】Vasya and Multisets (模拟)
题干:Vasya has a multiset ss consisting of nn integer numbers. Vasya calls some number xxnice if it appears in the multiset exactly once. For example, multiset {1,1,2,3,3,3,4}{1,1,2,3,3,3,4} contains ...原创 2018-10-31 17:49:57 · 386 阅读 · 0 评论 -
【CodeForces - 214B】Hometask (模拟,有坑)
题干:Furik loves math lessons very much, so he doesn't attend them, unlike Rubik. But now Furik wants to get a good mark for math. For that Ms. Ivanova, his math teacher, gave him a new task. Furik so...原创 2018-10-31 22:03:14 · 383 阅读 · 0 评论 -
【CodeForces - 768C】Jon Snow and his Favourite Number(思维,技巧,套路,数学异或,循环节,trick)
题干:Jon Snow now has to fight with White Walkers. He has n rangers, each of which has his own strength. Also Jon Snow has his favourite number x. Each ranger can fight with a white walker only if the...原创 2018-12-23 09:35:19 · 531 阅读 · 0 评论 -
【Codeforces 631C 】Report(单调栈,思维模拟)
题干:Each month Blake gets the report containing main economic indicators of the company "Blake Technologies". There are n commodities produced by the company. For each of them there is exactly one in...原创 2018-11-01 19:08:21 · 461 阅读 · 0 评论 -
【CodeForces - 214C 】Game (拓扑排序,思维)
题干:Furik and Rubik love playing computer games. Furik has recently found a new game that greatly interested Rubik. The game consists of n parts and to complete each part a player may probably need t...原创 2018-11-01 19:49:44 · 429 阅读 · 0 评论 -
【CodeForces - 864C】Bus (模拟,有坑)
题干:A bus moves along the coordinate line Ox from the point x = 0 to the point x = a. After starting from the point x = 0, it reaches the point x = a, immediately turns back and then moves to the poi...原创 2018-11-10 11:28:47 · 391 阅读 · 0 评论 -
【CodeForces - 349C】Mafia(思维模拟,优秀的二分)
题干:One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how ...原创 2018-11-09 22:18:32 · 773 阅读 · 0 评论 -
【CodeForces - 195A】Let's Watch Football (追及问题,模拟)
题干:Valeric and Valerko missed the last Euro football game, so they decided to watch the game's key moments on the Net. They want to start watching as soon as possible but the connection speed is too...原创 2018-10-23 09:29:30 · 336 阅读 · 0 评论 -
【牛客 - 301哈尔滨理工大学软件与微电子学院第八届程序设计竞赛同步赛(高年级 )】小乐乐和25(模拟,技巧)
题干: 小乐乐特别喜欢25这个数字,他想把所有的数字都变成25的倍数。现在小乐乐得到一个数字,想问问你最少用几次操作才可以把这个数字改造成25的倍数。对于一次操作我们可以把相邻的两位做交换,比如123经过一次操作之后就可以变成213或者132。 输入描述:多组数据输入对于每组数据,只有一行输入一个整数n(1 <= n <= 1000000000)。输出描...原创 2018-12-05 00:37:26 · 386 阅读 · 0 评论 -
【UVA - 227】Puzzle (模拟,水题)
题干: Puzzle A children's puzzle that was popular 30 years ago consisted of a 5x5 frame which contained 24 small squares of equal size. A unique letter of the alphabet was printed on each small squar...原创 2018-12-08 10:15:08 · 304 阅读 · 0 评论 -
【Hihocoder - offer编程练习赛93 套题题解】交错01串(贪心,暴力)方格矩阵高度(模拟)数对(STLmultiset)修整土地(网络流)
A:题干:时间限制:10000ms单点时限:1000ms内存限制:256MB描述小Hi要将一个01串S传输给小Ho,由于S非常长,所以小Hi决定用长度为N的2个数组A = [A1, A2, ..., AN]和B = [B1, B2, ..., BN]表示S。 具体来讲,是指S由N段连续的字符串组成,其中第i段包含Ai个Bi。其中Bi可能是0或1。 例如 A = ...原创 2019-02-26 22:15:10 · 501 阅读 · 0 评论 -
【CodeForces - 545 ABCDE套题训练题解】贪心, 构造,模拟,dp,最短路树(Dijkstra+变形)
A:题干:InputThe first line contains integer n (1 ≤ n ≤ 100) — the number of cars.Each of the next n lines contains n space-separated integers that determine matrix A.It is guaranteed that on t...原创 2019-02-27 10:37:29 · 1617 阅读 · 0 评论 -
【CodeForces - 546C 】Soldier and Cards (模拟)
题干:Two bored soldiers are playing card war. Their card deck consists of exactly n cards, numbered from 1 to n, all values are different. They divide cards between them in some manner, it's possible ...原创 2019-02-27 11:00:25 · 421 阅读 · 0 评论 -
【POJ - 2632】Crashing Robots(模拟)
题干:In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destinations without crashing into each other. Of course, all wareh...原创 2019-03-16 18:44:13 · 287 阅读 · 0 评论 -
【PTA天梯赛CCCC -2017决赛L1-6 】整除光棍 (20 分)(大数模拟除法)
题干:这里所谓的“光棍”,并不是指单身汪啦~ 说的是全部由1组成的数字,比如1、11、111、1111等。传说任何一个光棍都能被一个不以5结尾的奇数整除。比如,111111就可以被13整除。 现在,你的程序要读入一个整数x,这个整数一定是奇数并且不以5结尾。然后,经过计算,输出两个数字:第一个数字s,表示x乘以s是一个光棍,第二个数字n是这个光棍的位数。这样的解当然不是唯一的,题目要求你输出最...原创 2019-03-21 14:26:13 · 251 阅读 · 0 评论 -
【ZOJ - 2968 】Difference Game (贪心,思维模拟)
题干:Now you are going to play an interesting game. In this game, you are given two groups of distinct integers andCcoins. The two groups, namedGaandGbrespectively, are not empty and contain the ...原创 2019-07-22 20:58:37 · 303 阅读 · 0 评论 -
【2019牛客暑期多校训练营(第八场)- G】Gemstones(栈,模拟)
题干:链接:https://ac.nowcoder.com/acm/contest/888/G来源:牛客网Gromah and LZR have entered the seventh level. There are a sequence of gemstones on the wall.After some tries, Gromah discovers that on...原创 2019-09-24 20:41:46 · 233 阅读 · 0 评论 -
【CodeForces - 1020B】Badge(模拟,图,环)
题干:In Summer Informatics School, if a student doesn't behave well, teachers make a hole in his badge. And today one of the teachers caught a group of nn students doing yet another trick.Let's assu...原创 2019-02-21 11:17:24 · 516 阅读 · 0 评论 -
【ZOJ - 2969】Easy Task (模拟,数学)
题干:Calculating the derivation of a polynomial is an easy task. Given a function f(x) , we use (f(x))' to denote its derivation. We use x^n to denote xn. To calculate the derivation of a polynomial, ...原创 2019-03-05 09:49:54 · 291 阅读 · 0 评论 -
【CodeForces - 299C 】Weird Game (思维,模拟,贪心,博弈,OAE思想)
题干:Yaroslav, Andrey and Roman can play cubes for hours and hours. But the game is for three, so when Roman doesn't show up, Yaroslav and Andrey play another game.Roman leaves a word for each of th...原创 2018-12-08 10:16:25 · 559 阅读 · 0 评论 -
【UVA - 11292】Dragon of Loowater (贪心,水题,模拟,twopointer双指针)
题干:题目大意:n条恶龙,m个勇士,用勇士来杀恶龙。一个勇士只能杀一个恶龙。而且勇士只能杀直径不超过自己能力值的恶龙。每个勇士需要支付能力值一样的金币。问杀掉所有恶龙需要花费的最少金币。解题报告: twopointer排序后从头到尾扫一遍就行了。AC代码:#include<cstdio>#include<iostream>#include&...原创 2018-12-09 13:29:52 · 277 阅读 · 0 评论 -
【UVA - 10038】Jolly Jumpers (模拟,水题,标记)
题干:题目大意:要任意相邻的两个数的绝对值在[1,n),而且这个范围内的每个数都要出现一次。解题报告: 直接模拟就行了、AC代码:#include<cstdio>#include<iostream>#include<algorithm>#include<queue>#include<map>#inc...原创 2018-12-07 16:27:51 · 311 阅读 · 0 评论 -
【CodeForces - 471B】MUH and Important Things (模拟,细节)
题干:It's time polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev got down to business. In total, there are ntasks for the day and each animal sho...原创 2019-01-22 00:20:43 · 262 阅读 · 0 评论 -
【CodeForces - 523C】Name Quest (模拟)
题干:A Martian boy is named s — he has got this name quite recently from his parents for his coming of age birthday. Now he enjoys looking for his name everywhere. If he sees that he can obtain his na...原创 2019-01-22 15:41:43 · 287 阅读 · 0 评论 -
【牛客 - 317G】小a的排列(模拟,构造)
题干: 小a有一个长度为nn的排列。定义一段区间是"萌"的,当且仅当把区间中各个数排序后相邻元素的差为11现在他想知道包含数x,yx,y的长度最小的"萌"区间的左右端点也就是说,我们需要找到长度最小的区间[l,r][l,r],满足区间[l,r][l,r]是"萌"的,且同时包含数xx和数yy如果有多个合法的区间,输出左端点最靠左的方案。 输入描述:第一行三个整数N...原创 2019-01-29 12:57:43 · 344 阅读 · 0 评论 -
笔试题 - 汽车加油问题
题干: 第一行输入n,k,代表共有k个加油站,加满油后可以跑n公里。 第二行k+1个数,其中前k个数代表加油站的位置,第k+1个数代表终点的位置。 一辆车从坐标零点加满油后出发,问最少加几次油,可以到达终点?如果到达不了终点,输出"Impossible"解题报告: 直接贪心模拟就好了。AC代码:#include<bits/stdc++.h>...原创 2019-02-19 00:28:45 · 634 阅读 · 0 评论 -
【CodeForces - 1020A】New Building for SIS(模拟)
题干:You are looking at the floor plan of the Summer Informatics School's new building. You were tasked with SIS logistics, so you really care about travel time between different locations: it is impo...原创 2019-02-20 11:33:50 · 367 阅读 · 0 评论