洛谷
文章平均质量分 61
m0_61067261
这个作者很懒,什么都没留下…
展开
-
CF236A Boy or Girl
题目描述Those days, many boys use beautiful girls' photos as avatars in forums. So it is pretty hard to tell the gender of a user at the first glance. Last year, our hero went to a forum and had a nice chat with a beauty (he thought so). After that they talk原创 2021-11-06 17:22:22 · 334 阅读 · 2 评论 -
CF231A Team(dfs再次出现)
题目描述One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will im原创 2021-11-06 17:11:25 · 344 阅读 · 1 评论 -
CF230A Dragons(dfs深搜经典例题)
传送门传送门题意翻译小方在跟龙进行比赛,他要是想进入下一层级,就必须要击败在这一层级上的所有的n条龙。 小方和每一条龙都有一个可以用整数表示的力量值,在每一次战斗中,该次战斗的结果由战斗的双方的力量值所决定。在一开始,小方的力量值是s在任意一次战斗中,如果小方的力量值比第i条龙(1<=i<=n)的力量值大,那么小方可以击败这头龙并且获得额外的力量值y(i),如果小方的力量值小于这头龙的力量值,那么小方将在这场战斗中死亡小方可以以任意的一个顺序和龙进行战斗。请编写程序确定小方是原创 2021-11-06 17:00:10 · 305 阅读 · 2 评论 -
CF32B Borze(模拟+字符串)(大佬勿喷)
题目描述Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out the ternary number given its原创 2021-10-16 17:55:00 · 388 阅读 · 4 评论 -
入门好题集(CodeForces)
洛谷:CF14A Letter题解CF16A Flag题解CF22A Second Order Statistics题解CF32B Borze题解原创 2021-10-31 16:36:47 · 330 阅读 · 0 评论 -
CF22A Second Order Statistics(字符串+哈希+桶排序 或STL中的set)
题目描述Once Bob needed to find the second order statistics of a sequence of integer numbers. Lets choose each number from the sequence exactly once and sort them. The value on the second position is the second order statistics of the given sequence. In ot..原创 2021-10-16 17:43:54 · 147 阅读 · 0 评论 -
CF16A Flag(模拟+字符串+暴力搜索)(大佬勿喷)
题目描述According to a new ISO standard, a flag of every country should have a chequered fieldn×mn×m, each square should be of one of 10 colours, and the flag should be «striped»: each horizontal row of the flag should contain squares of the same colour,...原创 2021-10-16 17:31:14 · 239 阅读 · 0 评论 -
CF14A Letter(模拟+字符串)(C++题解)(大佬勿喷)
题目描述A boy Bob likes to draw. Not long ago he bought a rectangular graph (checked) sheet withnnrows andmmcolumns. Bob shaded some of the squares on the sheet. Having seen his masterpiece, he decided to share it with his elder brother, who lives in Fla...原创 2021-10-16 17:14:59 · 417 阅读 · 0 评论 -
P1165 日志分析
题目描述M海运公司最近要对旗下仓库的货物进出情况进行统计。目前他们所拥有的唯一记录就是一个记录集装箱进出情况的日志。该日志记录了两类操作:第一类操作为集装箱入库操作,以及该次入库的集装箱重量;第二类操作为集装箱的出库操作。这些记录都严格按时间顺序排列。集装箱入库和出库的规则为先进后出,即每次出库操作出库的集装箱为当前在仓库里所有集装箱中最晚入库的集装箱。出于分析目的,分析人员在日志中随机插入了若干第三类操作――查询操作。分析日志时,每遇到一次查询操作,都要报告出当前仓库中最大集装箱的重量。输入.原创 2021-10-16 12:57:07 · 278 阅读 · 0 评论 -
CF58A Chat room
题目描述Vasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the wordss. It is considered that Vasya managed to say hello if several letters can be deleted from..原创 2021-10-05 13:57:32 · 127 阅读 · 0 评论 -
CHAT ROOM AC 记录
https://www.luogu.com.cn/record/59189439https://www.luogu.com.cn/record/59189439原创 2021-10-05 13:56:50 · 90 阅读 · 0 评论 -
CF59A Word
题目描述Vasya is very upset that many people on the Net mix uppercase and lowercase letters in one word. That's why he decided to invent an extension for his favorite browser that would change the letters' register in every word so that it either only consis原创 2021-10-05 13:43:51 · 113 阅读 · 0 评论 -
CF41A Translation(洛谷水题记)
题目描述The translation from the Berland language into the Birland language is not an easy task. Those languages are very similar: a berlandish word differs from a birlandish word with the same meaning a little: it is spelled (and pronounced) reversely. For原创 2021-10-04 20:18:59 · 218 阅读 · 0 评论 -
CF964A Splits(洛谷水题记)
题目描述Let's define a split ofnnas a nonincreasing sequence of positive integers, the sum of which isnn.For example, the following sequences are splits of88:[4, 4][4,4],[3, 3, 2][3,3,2],[2, 2, 1, 1, 1, 1][2,2,1,1,1,1],[5, 2, 1][5,2,1].The ...原创 2021-10-04 20:17:46 · 188 阅读 · 0 评论 -
CF63A Sinking Ship(洛谷水题记)
题目描述The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. Allnncrew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 tonn) and await further in...原创 2021-10-04 19:52:55 · 103 阅读 · 0 评论 -
CF46A Ball Game(洛谷水题记)
题目描述A kindergarten teacher Natalia Pavlovna has invented a new ball game. This game not only develops the children's physique, but also teaches them how to count.The game goes as follows. Kids stand in circle. Let's agree to think of the children as nu原创 2021-10-04 19:51:32 · 321 阅读 · 0 评论 -
CF4A Watermelon(洛谷水题记)
题目描述One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showedwwkilos. They rushed home, dying of thirst, and decid..原创 2021-10-04 09:01:36 · 374 阅读 · 0 评论 -
CF1A Theatre Square(洛谷水题记)
题目描述Theatre Square in the capital city of Berland has a rectangular shape with the sizen×mn×mmeters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the sizea×aa×a...原创 2021-10-04 09:00:22 · 482 阅读 · 0 评论 -
P1077 [NOIP2012 普及组] 摆花(洛谷水题记)
题目描述小明的花店新开张,为了吸引顾客,他想在花店的门口摆上一排花,共m盆。通过调查顾客的喜好,小明列出了顾客最喜欢的 n种花,从1到n标号。为了在门口展出更多种花,规定第ii种花不能超过ai盆,摆花时同一种花放在一起,且不同种类的花需按标号的从小到大的顺序依次摆列。试编程计算,一共有多少种不同的摆花方案。输入格式第一行包含两个正整数n和m,中间用一个空格隔开。第二行有n个整数,每两个整数之间用一个空格隔开,依次表示 ai。输出格式一个整数,表示...原创 2021-10-03 18:57:34 · 223 阅读 · 0 评论 -
P7072 [CSP-J2020] 直播获奖
题目描述NOI2130 即将举行。为了增加观赏性,CCF 决定逐一评出每个选手的成绩,并直播即时的获奖分数线。本次竞赛的获奖率为w\%w%,即当前排名前w\%w%的选手的最低成绩就是即时的分数线。更具体地,若当前已评出了pp个选手的成绩,则当前计划获奖人数为\max(1, \lfloor p * w \%\rfloor)max(1,⌊p∗w%⌋),其中ww是获奖百分比,\lfloor x \rfloor⌊x⌋表示对xx向下取整,\max(x,y)max(x,y)表示xx和...原创 2021-10-03 13:20:03 · 685 阅读 · 6 评论 -
P7257 [COCI2009-2010#3] FILIP(洛谷水题记)
题目描述给你两个十进制正整数a, ba,b,输出将这两个数翻转后的较大数。「翻转」在本题中的定义详见「说明 / 提示」部分。输入格式第一行,两个十进制正整数a, ba,b。输出格式第一行,aa和bb翻转后的较大数。输入输出样例输入 #1734 893输出 #1437输入 #2221 231输出 #2132输入 #3839 237输出 #3938说明/提示「翻转」在本题中的定义设原数有ff位...原创 2021-09-18 21:25:19 · 292 阅读 · 0 评论 -
P5703 【深基2.例5】苹果采购(洛谷水题记)
题目描述现在需要采购一些苹果,每名同学都可以分到固定数量的苹果,并且已经知道了同学的数量,请问需要采购多少个苹果?输入格式输入两个不超过10^9109正整数,分别表示每人分到的数量和同学的人数。输出格式一个整数,表示答案。保证输入和答案都在int范围内的非负整数。输入输出样例输入 #15 3输出 #115CODE#include<iostream>using namespace std;long long a,b;int main..原创 2021-09-18 21:13:15 · 143 阅读 · 0 评论 -
P1000 超级玛丽游戏(洛谷水题记)
题目背景本题是洛谷的试机题目,可以帮助了解洛谷的使用。建议完成本题目后继续尝试P1001、P1008。另外强烈推荐新用户必读贴题目描述超级玛丽是一个非常经典的游戏。请你用字符画的形式输出超级玛丽中的一个场景。 ******** ************ ####....#. #..###.....##.... ###.......######原创 2021-09-18 21:11:01 · 62 阅读 · 0 评论 -
P7797 [COCI2015-2016#6] BELA(洛谷水题记)
题目描述有一个叫\text{Belote}Belote的纸牌游戏,游戏只用到A,K,Q,J,T,9,8,7共八种纸牌。 游戏规则就是将所有纸牌的值加起来,看看谁的值较大,谁就赢。每种纸牌的值都有两种,当其为特殊牌时有一个值,非特殊牌时也有一个值。每种卡牌的值见下表:现在\text{Mirko}Mirko有4\times N4×N张纸牌,并已知特殊牌的属性为BB,请计算\text{Mirko}Mirko所有纸牌值的总和。输入格式第一行包含整数NN和字符BB。...原创 2021-08-25 15:39:26 · 327 阅读 · 2 评论 -
P7798 [COCI2015-2016#6] PUTOVANJE(洛谷水题记)
题目描述\text{Mislav}Mislav最喜欢在森林里度过时光,因为森林里有各种各样的水果,吃了每种水果都能获得一定的饱食度。但他不会使自己的总饱食度超过CC。现在森林里有一条小径,小径旁顺次种了NN个的水果,每个水果都有一个饱食度w_iwi。\text{Mislav}Mislav可以选择从任意一个水果的位置开始,往第NN个水果前进。在前进的过程中,如果吃下当前位置的水果,总饱食度不会超过CC,他就一定会吃下该水果。否则,他就会跳过该水果,继续前进。请问\text{M...原创 2021-08-25 15:34:44 · 222 阅读 · 0 评论 -
805. x和y的最大值(acwing水题记)
输入两个整数xx和yy,请你编写一个函数,int max(int x, int y),计算并输出xx和yy的最大值。输入格式共一行,包含两个整数xx和yy。输出格式共一行,包含一个整数,表示两个数中较大的那个数。数据范围−100≤x,y≤100−100≤x,y≤100输入样例:3 6输出样例:6#include <iostream>#include <cstring>#include <algorith...原创 2021-08-23 16:47:52 · 102 阅读 · 1 评论 -
P3156 【深基15.例1】询问学号
题目描述有n(n \le 2 \times 10^6)n(n≤2×106)名同学陆陆续续进入教室。我们知道每名同学的学号(在 1 到10^9109之间),按进教室的顺序给出。上课了,老师想知道第ii个进入教室的同学的学号是什么(最先进入教室的同学i=1i=1),询问次数不超过10^5105次。输入格式第一行 2 个整数 n 和 m,表示学生个数和询问次数。第二行 n 个整数,表示按顺序进入教室的学号。第三行 m 个整数,表示询问第几个进入教室的同学。输出格式m ...原创 2021-08-23 13:07:15 · 255 阅读 · 1 评论 -
P3150 pb的游戏(1)
题目背景(原创)有一天 pb和zs玩游戏 你需要帮zs求出每局的胜败情况题目描述游戏规则是这样的: 每次一个人可以对给出的数进行分割,将其割成两个非零自然数,之后由另一个人选择留下两个数中的其中一个;之后由另一个人进行分割这个剩下的数,重复步骤……当一个人无法对数进行分割的时候游戏结束,另一个人获胜现在要你求出N次游戏的胜败每局由pb先进行分割,如果pb赢输出"pb wins" 如果zs赢输出"zs wins"注:双方都是绝顶聪明的输入格式第一行一个数N,表示数据组数原创 2021-08-23 12:59:14 · 76 阅读 · 1 评论 -
P2955 [USACO09OCT]Even? Odd? G
题目描述Bessie's cruel second grade teacher has assigned a list of N (1 <= N <= 100) positive integers I (1 <= I <= 10^60) for which Bessie must determine their parity (explained in second grade as 'Even... or odd?'). Bessie is overwhelmed by the原创 2021-08-23 12:39:59 · 138 阅读 · 1 评论 -
P2907 [USACO08OPEN]Roads Around The Farm S
题目描述Farmer John's cows have taken an interest in exploring the territory around the farm. Initially, all N (1 <= N <= 1,000,000,000) cows commence traveling down a road in one big group. Upon encountering a fork in the road, the group sometimes cho原创 2021-08-23 12:33:59 · 208 阅读 · 0 评论 -
P2788 数学1(math1)- 加减算式
题目背景蒟蒻HansBug在数学考场上,挠了无数次的头,可脑子里还是一片空白。题目描述好不容易啊,HansBug终于熬到了做到数学最后一题的时刻了,眼前是一堆杂乱的加减算式。显然成功就在眼前了。可是他脑细胞和RP已经消耗殆尽,所以这个重要的任务就交给你们啦。输入格式一行,包含一个字符串形式的加减法多项式(每一项数字范围为0-32767)。输出格式一个整数,为计算所得的结果(保证计算结果不会超过长整型范围)。输入输出样例输入 #11+2-3输出 #10说原创 2021-08-23 12:18:20 · 180 阅读 · 0 评论 -
P2708 硬币翻转
题目描述有很多个硬币摆在一行,有正面朝上的,也有背面朝上的。正面朝上的用1表示,背面朝上的用0表示。现在要求从这行的第一个硬币开始,将从第一个硬币开始的前若干个硬币同时翻面,求如果要将所有硬币翻到正面朝上,最少要进行这样的操作多少次?输入格式一个字符串,由0和1组成,表示硬币状态输出格式一个整数,表示要翻转的最少次数输入输出样例输入 #110输出 #12说明/提示【样例1说明】:第1次翻转:把第一个硬币翻到反面,字符串为00第2次翻转:把第一、原创 2021-08-23 12:13:34 · 133 阅读 · 0 评论 -
P5082 成绩(c++)
题目背景小奔的score题解:https://blog.csdn.net/kkkksc03/article/details/84928268说一句:本题已放开空间范围(不过真的貌似不用开数组就可以A呀题目描述小奔的期末考试结束了。他的成绩不久之后就会发下来。给出一个考试成绩表格,例如:科目/分值种类 语文 数学 英语 满分 100100 120120 150150 实际得分 9999 7373 100100 当原创 2021-08-22 16:29:07 · 298 阅读 · 0 评论 -
洛谷P2689
题目描述给出起点和终点的坐标及接下来T个时刻的风向(东南西北),每次可以选择顺风偏移1个单位或者停在原地。求到达终点的最少时间。如果无法偏移至终点,输出“-1”。输入格式第一行两个正整数x1,y1,表示小明所在位置。第二行两个正整数x2,y2,表示小明想去的位置。第三行一个整数T,表示T个时刻。第四至第N+3行,每行一个字符,表示风向,即东南西北的英文单词的首字母。输出格式最少走多少步。输入输出样例输入 #1复制1 12 25ENWWN输出原创 2021-08-22 15:54:49 · 245 阅读 · 0 评论 -
洛谷P1001
#include<iostream>using namespace std;int main(){ int a,b; cin>>a>>b; cout<<a+b<<endl; return 0;}不需要解释吧。。。原创 2021-08-21 15:28:06 · 42 阅读 · 0 评论