暴力|模拟
哈哈哈哈哈v3v
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #719 (Div. 3) F1. Guess the K-th Zero (Easy version)(交互 二分)
题意:有一个隐藏的01序列,需要找到第k个0的位置,每次可以询问某区间的和,最多询问20次裸裸的二分,至于为什么WA了我也不知道,调一调就过了#include <bits/stdc++.h>using namespace std;typedef long long ll;const double down = 0.996;const double eps = 1e-15;const ll inf = 0x3f3f3f3f3f3f3f3f;const int N = 2e..原创 2021-05-06 11:14:22 · 294 阅读 · 0 评论 -
2020ccpc威海 H Message Bomb(差分)
HMessage BombWhile we enjoy chatting with friends on the internet, it is always annoying that we are overwhelmed by lots of messages in various chat groups. A great majority of these messages are actually not interesting to us, but we may miss some impo.原创 2020-10-29 11:48:36 · 171 阅读 · 0 评论 -
日期计算类
https://www.cnblogs.com/woxiaosade/p/11829060.htmlhttps://blog.csdn.net/Dream_Weave/article/details/80487951一、年月日-->星期X1、基姆拉尔森:w=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7 // w:0:星期一...依此类推int cal1(int y,int m,int d){ if(m==1||m==2) m+=转载 2020-10-27 21:14:23 · 126 阅读 · 0 评论 -
2020ICPC·小米 网络选拔赛第一场 A Intelligent Warehouse(dp)
链接:https://ac.nowcoder.com/acm/contest/7501/A来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述In MI Intelligent Warehouse, there are nn_{}n products, where the ii_{}i-th product is of size aia_iai. We always ne.原创 2020-10-26 14:39:54 · 405 阅读 · 2 评论 -
Ponk Warshall(思维 + 暴力)
链接:https://ac.nowcoder.com/acm/contest/7817/H来源:牛客网题目描述Listening to the rock music permutes your nuclear DNA. This astonishing and unbelievable fact was recently published in the Rock Nature Weekly, one of the top scientific journals on the planet. .原创 2020-10-02 00:18:23 · 265 阅读 · 0 评论 -
UCF “Practice” Local Contest —2013 G.Brett Favre Diaries filename(模拟)
Brett Favre Diaries filename: favreThe sporting world recently underwent a media overload with the Brett Favre story. The recordbreaking Green Bay Packers quarterback, after initially deciding to ...原创 2020-03-11 22:57:17 · 352 阅读 · 0 评论 -
codeforces 1305 C. Kuroni and Impossible Calculation(抽屉原理)
C. Kuroni and Impossible Calculationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputTo become the king of Codeforces, Kuroni has ...原创 2020-03-04 11:19:45 · 242 阅读 · 0 评论 -
codeforce 1311 D. Three Integers(暴力 + 剪枝)
D. Three Integerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given three integersa≤b≤ca≤b≤c.In one move, you can ...原创 2020-02-25 16:19:07 · 373 阅读 · 3 评论 -
CTU Open Contest 2019 F Beer Marathon(三分答案)
Beer Marathonmarathon.c, marathon.cpp, Marathon.java, marathon.pyIn the booths version of the popular annual Beer Marathon, many beer booths (also called beer stalls or beer stands) are installed al...原创 2020-02-22 23:19:50 · 419 阅读 · 0 评论 -
CTU Open Contest 2019 B Beer Bill(模拟)
Beer Billbill.c, bill.cpp, Bill.java, bill.pyPub bills were introduced into daily life long before computers even existed. People tend to think that once a bill has been paid, it is no more than a p...原创 2020-02-22 19:54:15 · 231 阅读 · 0 评论 -
CodeForces - 705C Thor (模拟)
Thor is getting used to the Earth. As a gift Loki gave him a smartphone. There are n applications on this phone. Thor is fascinated by this phone. He has only one minor issue: he can't count the numbe...原创 2020-01-29 10:44:10 · 232 阅读 · 0 评论 -
sdnu 1555.柳予欣的选择(二) (打擂台求众数)
Description柳予欣饿了,想要吃东西。现在有n个食物,第i个食物的种类是ai(1<=ai<=1e9)。柳予欣吃东西喜欢同时吃两个不同种类的食物,这样会增加她一点愉悦值,否则就不加。现在请问所有分配决策中能够获得的最大的愉悦值是多少?Input一个数字n(1 <= n <= 4.5e6)代表有几个食物,接下来一行n个数字,第i个数字ai代表每个食物的种...原创 2019-12-01 15:34:51 · 257 阅读 · 0 评论 -
sdnu 1207 多项式输出 (模拟)
Description一元 n 次多项式可用如下的表达式表示:f(x)=an*x^n+an-1*x^n-1+...+a1*x+a0 (an≠0)其中,a_i·x^i 称为i次项,a_i称为i 次项的系数。给出一个一元多项式各项的次数和系数,请按照如下规定的格式要求输出该多项式:1. 多项式中自变量为x,从左到右按照次数递减顺序给出多项式。2. 多项式中只包含系数不...原创 2019-12-01 15:24:40 · 202 阅读 · 0 评论 -
sdnu 1280.就问你慌不慌 (高精度N进制加法)
Description求N进制的高精度加法Input第一行输入N(2≤N≤10)第二行两个数X Y(长度均≤100)Output输出N进制下X和Y的和Sample Input52 4Sample Output11SourceSunshine时隔4个月。。我终于AC了这道题我也不知道为什么把字符数组换成string就REorz#...原创 2019-12-01 15:18:18 · 290 阅读 · 0 评论 -
四川大学第二届SCUACM新生赛 M lglg说要有题,于是便有了题。 (打表)
链接:https://ac.nowcoder.com/acm/contest/1838/M来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述lglg说要有题,于是便有了题。lglg的忠诚教徒为了纪念lglg大人的伟大。出了一道lglg题来纪念lglg大人。根据...原创 2019-11-17 19:40:46 · 186 阅读 · 2 评论 -
四川大学第二届SCUACM新生赛 E [模板]欧拉筛 (暴力)
链接:https://ac.nowcoder.com/acm/contest/1838/E来源:牛客网时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述lglg最近爱上了炒股,他想在股票市场内买一些股票。现在有编号为1,2,3,...,100000000的10000000...原创 2019-11-17 19:35:33 · 199 阅读 · 0 评论 -
Smooth Sequences(暴力 细节)
A sequence of n integers is called smooth, if the absolute values of the differences between successive numbers are at most d. We call a non-smooth sequence semi-smooth, if we can change exactly one n...原创 2019-10-16 21:31:40 · 211 阅读 · 0 评论 -
sdnuoj1170(模拟)
1170.津津的储蓄计划Description津津的零花钱一直都是自己管理。每个月的月初妈妈给津津300元钱,津津会预算这个月的花销,并且总能做到实际花销和预算的相同。 为了让津津学习如何储蓄,妈妈提出,津津可以随时把整百的钱存在她那里,到了年末她会加上20%还给津津。因此津津制定了一个储蓄计划:每个月的月初,在得到妈妈给的零花钱后,如果她预计到这个月的月末手中还会有多于100元或恰好100元...原创 2019-02-25 19:43:27 · 108 阅读 · 0 评论 -
sdnoj1072(模拟)
1072.我们爱递归Description我们想明白递归函数到底是怎么运作的,所以想用递归来计算当给定一个正整数n(n < 16)时,求出n + (n-1)……+1的值,同时进行一些输出要求写一个int plus1(int a)形式的函数,在进入递归函数时,输出相关信息。在调用结束返回值前,输出相关信息。最后输出n + (n-1)……+1的值Input3Output[plus1...原创 2019-02-28 20:21:25 · 147 阅读 · 0 评论 -
sdnu1341(日期)
virgo’s winter vacationDescription2017年1月15日是山师放寒假的日子,撒花,撒花。为此Virgo决定设计一个程序,来还有多少天回家:给出某一天的日期year-month-date, 求这一天到2017-1-15还差几天。Input第一行有个整数T, 表示测试组数。T≦100。接下来每个测试组,给出三个数year month date。(1900 &l...原创 2019-05-18 00:20:46 · 254 阅读 · 0 评论 -
sdnuoj1410(递归)
FJ的字符串DescriptionFJ在沙盘上写了这样一些字符串:A1 = “A”A2 = “ABA”A3 = “ABACABA”A4 = “ABACABADABACABA”… …你能找出其中的规律并写所有的数列AN吗?Input仅有一个数:N ≤ 26。Output请输出相应的字符串AN,以一个换行符结束。输出中不得含有多余的空格或换行、回车符。Samp...原创 2019-05-17 19:25:29 · 185 阅读 · 0 评论 -
sdnu1309.啤酒和饮料(暴力+卡精度)
Description啤酒每罐2.3元,饮料每罐1.9元。小明买了若干啤酒和饮料,一共花了N元。请你计算他买了几罐啤酒和几罐饮料(罐数为整数)。Input一个double型数据N(0<=N<=20000)Output输出啤酒和饮料的罐数,如果存在多组结果按照啤酒数从大到小排列;如果没有解答输出"No Solution"Sample Input82.3...原创 2019-07-25 17:22:21 · 280 阅读 · 0 评论 -
sdnuoj1186模拟
1186.字符串的展开Description 在初赛普及组的“阅读程序写结果”的问题中,我们曾给出一个字符串展开的例子:如果在输入的字符串中,含有类似于“d-h”或者“4-8”的字串,我们就把它当作一种简写,输出时,用连续递增的字母获数字串替代其中的减号,即,将上面两个子串分别输出为“defgh”和“45678”。在本题中,我们通过增加一些参数的设置,使字符串的展开更为灵活。具体...原创 2019-06-06 20:24:24 · 107 阅读 · 0 评论 -
sdnu1201.简单排序(水题)
Description再次出个排序题,题目是这样的,输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。Input输入包含多组测试用例,每组输入数据只有一行数字(数字之...原创 2019-07-29 20:57:36 · 408 阅读 · 0 评论 -
spojAE00(递推+找因子)
RectanglesByteman has a collection of N squares with side 1. How many different rectangles can he form using these squares?Two rectangles are considered different if none of them can be rotated and ...原创 2019-02-03 22:41:34 · 65 阅读 · 0 评论 -
HDU - 1287 破译密码 (异或)
有个叫“猪头帮”的国家,采用一种简单的文法加密,他们所用的语言里面只有大写字母,没有其他任何字符;现在还知道他们加密的方法是:只用一个大写字母和原文进行异或运算生成密文。请你帮忙解开。Input有若干组,每组输入有2行,第一行整数N表示有N个密文,接着一行有N个整数分别表示N个密文。Output输出仅有大写字母组成的原文。Sample Input3017 6 9 8 3...原创 2019-07-30 19:56:15 · 588 阅读 · 0 评论 -
v4t3564(暴力水题)
The Binding of IsaacOk, now I will introduce this game to you…Isaac is trapped in a maze which has many common rooms…Like this…There are 9 common rooms on the map.And there is only one super-secre...原创 2019-03-18 19:56:11 · 190 阅读 · 0 评论 -
Golden Radio Base (模拟+推公式)
Golden ratio base (GRB) is a non-integer positional numeral system that uses the golden ratio (the irrational number (1+√5)/2 ≈ 1.61803399 symbolized by the Greek letter φ) as its base. It is sometime...原创 2019-08-28 21:05:40 · 365 阅读 · 0 评论 -
Greedy Sequence(暴力)
You're given a permutation aaa of length nnn (1≤n≤1051 \le n \le 10^51≤n≤105).For each i∈[1,n]i \in [1,n]i∈[1,n], construct a sequence sis_isi by the following rules:si[1]=is_i[1]=isi[1]=i; The...原创 2019-09-02 17:17:31 · 245 阅读 · 0 评论 -
2019徐州网络赛K Center(暴力枚举)
You are given a point set with nnn points on the 2D-plane, your task is to find the smallest number of points you need to add to the point set, so that all the points in the set are center symmetric....原创 2019-09-11 21:56:00 · 175 阅读 · 0 评论 -
sdnu1110.The Little Girl who Picks Mushrooms(模拟 思维)
DescriptionIt's yet another festival season in Gensokyo. Little girl Alice planned to pick mushrooms in five mountains. She brought five bags with her and used different bags to collect mushrooms fr...原创 2019-09-21 00:28:39 · 446 阅读 · 0 评论 -
sdnu1416.一元三次方程求解(暴力枚举)
Description有形如:ax3+bx2+cx+d=0 这样的一个一元三次方程。给出该方程中各项的系数(a,b,c,d 均为实数),并约定该方程存在三个不同实根(根的范围在-100至100之间),且根与根之差的绝对值> =1。要求三个实根。Input四个实数:a,b,c,dOutput由小到大依次在同一行输出这三个实根(根与根之间留有空格),并精确到小数点后2位...转载 2019-09-24 16:25:26 · 666 阅读 · 0 评论 -
zoj3961(模拟+离散化)
Let’s ChatACM (ACMers’ Chatting Messenger) is a famous instant messaging software developed by Marjar Technology Company. To attract more users, Edward, the boss of Marjar Company, has recently added...原创 2019-04-09 19:47:29 · 144 阅读 · 0 评论 -
hdu6025(前后缀)
Coprime SequenceDo you know what is called ``Coprime Sequence’’? That is a sequence consists of nn positive integers, and the GCD (Greatest Common Divisor) of them is equal to 1.Coprime Sequence’’ i...原创 2019-05-23 18:34:15 · 306 阅读 · 0 评论 -
ZOJ3702(打表)
Gibonacci numberIn mathematical terms, the normal sequence F(n) of Fibonacci numbers is defined by the recurrence relationF(n)=F(n-1)+F(n-2)with seed valuesF(0)=1, F(1)=1In this Gibonacci numbers...原创 2019-03-27 23:10:41 · 148 阅读 · 0 评论 -
美丽度(找规律)
Problem Description街道上依次坐落着n个景点,每个景点都有一个美丽度a[i]。定义[l,r]之间景点的美丽度为(r-l+1)a[l]+(r-l)a[l+1]+…+2a[r-1]+1a[r]现在我们想要知道对于所有的子区间,景点的美丽度和为多少。Input第一行输入一个整数n(1<n<=1000000),第二行输入n个整数。0<=ai<=1e9O...原创 2019-04-11 22:02:17 · 227 阅读 · 0 评论 -
sdnuoj1052(模拟)
1052.水题3Descriptionlg是妹子,这是大家众所周知的但是lg有个恶趣味估计没人知道好吧既然没有人知道就算了的吧lg有的机器人,机器人能按照遥控器的指令来进行运动具体的指令如下:H&*^kf30pq 机器人走一步f03u5klfj# 机器人走两步lsuf9823ur 机器人走三步skhf9832ht ...原创 2019-02-22 22:24:14 · 292 阅读 · 0 评论 -
sdnu1246(素数 暴力)
1246.primeDescriptionThis is a verrrrrrrrrry easy problem, when Lulichuan was a freshman, he can ease to judge whether a number is a prime, there some TestCase, you just need to judge if the number ...原创 2019-05-14 22:17:07 · 253 阅读 · 0 评论 -
sdnu1271.小宇找MM(暴力水题)
Description大家都知道小宇是一个很纯洁的小孩!有一天他做梦了,梦见好多MM排着队随他挑。这些MM来自不同的国家,但也有同一个国家的,而他想尽量认识不同国家的MM。因此小宇想知道他可以认识到不同国家的MM区间长度的最大值,并且小宇想知道共有多少个国家的MM供他选择。题目来了:现在有多个MM,给出她们所在的国家的标号(标号仅由1个小写字母组成,不同的字母表示不同的国家)。她...原创 2019-07-26 14:38:32 · 207 阅读 · 0 评论