题解
weixin_45664948
这个作者很懒,什么都没留下…
展开
-
21-1-16
洛谷P5087 数学动态规划,本来是想找个公式啥的看看一个数能加几次,但是也没找到比较好的方法,动态规划是比较好像到的,写了写发现也可以。#include <bits/stdc++.h>#define int long longusing namespace std;const int mod = 1000000007LL;int n, f[310][100010], k, a[100010];signed main() { scanf("%lld%lld",原创 2021-01-17 14:46:56 · 40 阅读 · 0 评论 -
数据结构RMQ问题最敏捷的机器人
为防止忘记RMQ算法特写一篇有关RMQ的题解#10120. 「一本通 4.2 例 2」最敏捷的机器人内存限制:512 MiB时间限制:1000 ms标准输入输出题目类型:传统评测方式:文本比较上传者:1bentong提交提交记录统计测试数据讨论题目描述Wind 设计了很多机器人。但是它们都认为自己是最强的,于是,一场比赛开始了……机器人们都想知道谁是最敏捷的,于是它们进行了如下一个比赛。首先,他们面前会有一排共n 个数,它们比赛看谁能最先把每连续k 个数中最大和最小值写...原创 2020-11-07 21:01:15 · 178 阅读 · 0 评论 -
有关10.24号codeforces的感悟
A. Reordertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFor a given arrayaaconsisting ofnnintegers and a given integermmfind if it is possible to reorder elements of the arraya...原创 2020-10-25 21:30:59 · 98 阅读 · 0 评论 -
有关10.20号codeforces的相关感悟
第一题Boring Apartments:大致是说数据的存入总是为x,xx,xxx这样,最多一个数的组合有4项,给出一个带重合的数,依次求和(特别注意:不是求有多少个数,应是有几位就加几)于是:可以先求出前面出现的数乘以出现时排序的总数为10,再加上从这个数开始的各个位即可:#include<iostream>#include<cstdio>using namespace std;int main(){ int n,t,x,y; cin>&g...原创 2020-10-21 17:15:42 · 54 阅读 · 0 评论 -
数学基础Biorhythms(中国剩余定理)
题目描述原题来自:POJ 1006人生来就有三个生理周期,分别为体力、感情和智力周期,它们的周期长度为天、天和天。每一个周期中有一天是高峰。在高峰这天,人会在相应的方面表现出色。例如,智力周期的高峰,人会思维敏捷,精力容易高度集中。因为三个周期的周长不同,所以通常三个周期的高峰不会落在同一天。对于每个人,我们想知道何时三个高峰落在同一天。对于每个周期,我们会给出从当前年份的第一天开始,到出现高峰的天数(不一定是第一次高峰出现的时间)。你的任务是给定一个从当年第一天开始数的天数,输...原创 2020-10-20 22:41:23 · 239 阅读 · 1 评论 -
数学基础曹冲养猪
题目描述自从曹冲搞定了大象以后,曹操就开始琢磨让儿子干些事业,于是派他到中原养猪场养猪,可是曹冲很不高兴,于是在工作中马马虎虎,有一次曹操想知道母猪的数量,于是曹冲想狠狠耍曹操一把。举个例子,假如有 16头母猪,如果建了 3 个猪圈,剩下 1 头猪就没有地方安家了;如果建造了 5 个猪圈,但是仍然有 1 头猪没有地方去;如果建造了 7 个猪圈,还有 2 头没有地方去。你作为曹总的私人秘书理所当然要将准确的猪数报给曹总,你该怎么办?输入格式第一行包含一个整数 n,n<=10表示建立猪圈.原创 2020-10-20 21:44:56 · 197 阅读 · 1 评论 -
数学基础转圈游戏
题目描述n个小伙伴(编号从0到n-1)围坐一圈玩游戏。按照顺时针方向给n个位置编号,从0到n-1。最初,第0号小伙伴在第0号位置,第1号小伙伴在第1号位置,……,依此类推。游戏规则如下:每一轮第0号位置上的小伙伴顺时针走到第m号位置,第1号位置小伙伴走到第m+1号位置,……,依此类推,第n−m号位置上的小伙伴走到第0号位置,第n-m+1号位置上的小伙伴走到第1号位置,……,第n-1号位置上的小伙伴顺时针走到第m-1号位置。...原创 2020-10-14 12:45:12 · 606 阅读 · 0 评论 -
数字基础快速幂(A的B次方)
题目描述给出三个整数 a b m,求 pow(a,b)%m 的值。输入格式一行三个整数 a,b,m。输出格式一个整数,表示 pow(a,b)%m 的值。样例样例输入2 100 1007样例输出169数据范围与提示对于全部数据,1<=a,b,m<=le9。#include<iostream>#include<cstdio>#include<cstring>using namespace st..原创 2020-10-14 10:51:38 · 836 阅读 · 0 评论 -
题解4-N
The new ITone 6 has been released recently and George got really keen to buy it. Unfortunately, he didn’t have enough money, so George was going to work as a programmer. Now he faced the following pro...原创 2020-03-23 15:49:11 · 107 阅读 · 0 评论 -
题解4-M
Igor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence opposite to Tanya’s house. Igor thinks that the larger the number is, the more chance to win Tan...原创 2020-03-23 15:48:09 · 84 阅读 · 0 评论 -
题解4-L
A and B are preparing themselves for programming contests.An important part of preparing for a competition is sharing programming knowledge from the experienced members to those who are just beginnin...原创 2020-03-23 15:46:15 · 101 阅读 · 0 评论 -
题解4-K
Appleman and Toastman play a game. Initially Appleman gives one group of n numbers to the Toastman, then they start to complete the following tasks:Each time Toastman gets a group of numbers, he sums...原创 2020-03-23 15:45:01 · 260 阅读 · 0 评论 -
题解4-J
Two soldiers are playing a game. At the beginning first of them chooses a positive integer n and gives it to the second soldier. Then the second one tries to make maximum possible number of rounds. Ea...原创 2020-03-23 15:44:07 · 138 阅读 · 0 评论 -
题解4-H
n participants of the competition were split into m teams in some manner so that each team has at least one participant. After the competition each pair of participants from the same team became frien...原创 2020-03-23 15:43:14 · 131 阅读 · 0 评论 -
题解4-F
Luke Skywalker gave Chewbacca an integer number x. Chewbacca isn’t good at numbers but he loves inverting digits in them. Inverting digit t means replacing it with digit 9 - t.Help Chewbacca to trans...原创 2020-03-23 15:42:12 · 191 阅读 · 0 评论 -
题解4-E
Kyoya Ootori has a bag with n colored balls that are colored with k different colors. The colors are labeled from 1 to k. Balls of the same color are indistinguishable. He draws balls from the bag one...原创 2020-03-23 15:41:16 · 159 阅读 · 0 评论 -
题解4-D
Berland, 2016. The exchange rate of currency you all know against the burle has increased so much that to simplify the calculations, its fractional part was neglected and the exchange rate is now assu...原创 2020-03-23 15:40:12 · 113 阅读 · 0 评论 -
题解4-B
The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We kn...原创 2020-03-23 15:38:08 · 143 阅读 · 0 评论 -
题解4-A
The new “Die Hard” movie has just been released! There are n people at the cinema box office standing in a huge line. Each of them has a single 100, 50 or 25 ruble bill. A “Die Hard” ticket costs 25 r...原创 2020-03-16 18:41:10 · 132 阅读 · 0 评论 -
题解3-P
There is a game called “I Wanna Be the Guy”, consisting of n levels. Little X and his friend Little Y are addicted to the game. Each of them wants to pass the whole game.Little X can pass only p leve...原创 2020-03-14 20:19:31 · 194 阅读 · 0 评论 -
题解3-O
One day Polycarp published a funny picture in a social network making a poll about the color of his handle. Many of his friends started reposting Polycarp’s joke to their news feed. Some of them repos...原创 2020-03-14 20:14:23 · 206 阅读 · 0 评论 -
题解3-M
DZY has a sequence a, consisting of n integers.We’ll call a sequence ai, ai + 1, …, aj (1 ≤ i ≤ j ≤ n) a subsegment of the sequence a. The value (j - i + 1) denotes the length of the subsegment.Your...原创 2020-03-14 19:53:38 · 48 阅读 · 0 评论 -
题解3-L
The end of the school year is near and Ms. Manana, the teacher, will soon have to say goodbye to a yet another class. She decided to prepare a goodbye present for her n students and give each of them ...原创 2020-03-14 19:41:56 · 97 阅读 · 0 评论 -
题解3-J
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 word s. It is considered that Vasya managed to ...原创 2020-03-14 19:37:00 · 228 阅读 · 0 评论 -
题解3-I
Little Chris is bored during his physics lessons (too easy), so he has built a toy box to keep himself occupied. The box is special, since it has the ability to change gravity.There are n columns of ...原创 2020-03-14 19:33:49 · 137 阅读 · 0 评论 -
题解3-H
You’ve got array a[1], a[2], …, a[n], consisting of n integers. Count the number of ways to split all the elements of the array into three contiguous parts so that the sum of elements in each part is ...原创 2020-03-14 18:40:18 · 203 阅读 · 0 评论 -
题解3-G
Kirito is stuck on a level of the MMORPG he is playing now. To move on in the game, he’s got to defeat all n dragons that live on this level. Kirito and the dragons have strength, which is represented...原创 2020-03-14 18:28:03 · 154 阅读 · 0 评论 -
题解3-E
Andrewid the Android is a galaxy-famous detective. In his free time he likes to think about strings containing zeros and ones.Once he thought about a string of length n consisting of zeroes and ones....原创 2020-03-14 18:20:01 · 338 阅读 · 0 评论 -
题解3-D
Imagine that you have a twin brother or sister. Having another person that looks exactly like you seems very unusual. It’s hard to say if having something of an alter ego is good or bad. And if you do...原创 2020-03-14 18:15:24 · 165 阅读 · 0 评论 -
题解3-C
We saw the little game Marmot made for Mole’s lunch. Now it’s Marmot’s dinner time and, as we all know, Marmot eats flowers. At every dinner he eats some red and white flowers. Therefore a dinner can ...原创 2020-03-14 11:09:53 · 110 阅读 · 0 评论 -
题解3-A
What joy! Petya’s parents went on a business trip for the whole year and the playful kid is left all by himself. Petya got absolutely happy. He jumped on the bed and threw pillows all day long, until…...原创 2020-03-14 10:12:50 · 75 阅读 · 0 评论 -
题解1
#Angry StudentsIt’s a walking tour day in SIS.Winter, so groups of students are visiting Torzhok. Streets of Torzhok are so narrow that students have to go in a row one after another.Initially, som...原创 2020-03-04 15:12:45 · 121 阅读 · 0 评论