D. Rat Kwesh and Cheese 题目连接: http://www.codeforces.com/contest/621/problem/D Description Wet Shark asked Rat Kwesh to generate three positive real numbers x, y and z, from 0.1 to 200.0, inclusive. Wet Krash wants to impress Wet Shark, so all generat…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Wet Shark asked Rat Kwesh to generate three positive real numbers x, y and z, from 0.1 to 200.0, inclusive. Wet Krash wants to impress Wet Shark…
题目链接 可以发现 十进制4 对应 二进制100 十进制16 对应 二进制10000 十进制64 对应 二进制1000000 可以发现每多两个零,4的次幂就增加1. 用string读入题目给定的二进制数字,求出其长len,当len为奇数时,第一位为1,后面的位数如果都为0,则输出len,如果有一个不为0,则输出len+1: 当len为偶数时,则输出len.(之所以这样输出是因为题目给定4的次幂是从0开始的) #include<iostream> #include<string> #…
嗯本来想着直接算出来不就行了吗 然后我想到了200^200^200....... 好吧其实也不难取两次log就行了 然后我第一次写出来log就写残了........... log里面的拆分要仔细啊... 果然涉及到log就容易出问题 一组小于等于1的数据直接就跪了= = 不过我猜跪在这组数据的人应该蛮多的.... 解决办法的话应该是对这个数据不log处理吧...懒得写了= = #include <cstdio> #include <cmath> #include <cstri…
题意:求表达式中最大的值. long double 128位 有效数字18-19 范围正负1.2*10^4932 注意取对数! #include<iostream> #include<string> #include<algorithm> #include<cstdlib> #include<cstdio> #include<set> #include<map> #include<vector> #includ…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Recently Maxim has found an array of n integers, needed by no one. He immediately come up with idea of changing it: he invented positive integer…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output In Absurdistan, there are n towns (numbered 1 through n) and m bidirectional railways. There is also an absurdly simple road network - for each…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Companies always have a lot of equipment, furniture and other things. All of them should be tracked. To do this, there is an inventory number ass…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output You are given an array of positive integers a1, a2, -, an × T of length n × T. We know that for any i > n it is true that ai = ai - n. Find the l…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Anton loves transforming one permutation into another one by swapping elements for money, and Ira doesn't like paying for stupid games. Help them…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output A big company decided to launch a new series of rectangular displays, and decided that the display must have exactly n pixels. Your task is to de…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output There are n servers in a laboratory, each of them can perform tasks. Each server has a unique id - integer from 1 to n. It is known that during…
神秘比赛,以<哈利波特>为主题……有点难. C题我熬夜切终于是写出来了,可惜比赛结束了,气啊. 比赛链接:点我. [A]汤姆·里德尔的日记 题意: 哈利波特正在摧毁神秘人的分灵体(魂器).第一个他见到的魂器是在密室中的日记本,现在这本日记令金妮打开了密室. 哈利波特想要知道哪些人没有被日记施魔,以确保他们不会被日记影响. 哈利波特有一个名单,依次记录了那些被日记本施魔的人,对于每个人,他想知道这个人的名字在之前有没有出现过. 如果第\(i\)个字符串之前有相同的字符串,那么输出"YE…
[题目链接]:http://codeforces.com/problemset/problem/709/D [题意] 给你一个序列; 给出01子列和10子列和00子列以及11子列的个数; 然后让你输出一个符合要求的序列; [题解] 这里 00和11可以确定出序列中0和1的个数; 但有边缘数据 00如果为0代表什么? ->没有0或者是有1个0 11如果为0代表什么? ->没有1或者是有1个1 对这两种情况需要特判一下(两种情况的特判需要用到01和10的数量) 看代码吧. 然后这两种情况排除之后;…
[题目链接]:http://codeforces.com/contest/514/problem/D [题意] 给你每个机器人的m种属性p1..pm 然后r2d2每次可以选择m种属性中的一种,进行一次攻击; 攻击过后每个机器人的该种属性都减少1; 可以最多攻击k次; 机器人只有m种属性都变为0之后才死掉; 然后问你如何分配这k次攻击,每次攻击时选择的属性; 使得连续的死掉的机器人的区间长度最长; [题解] 对于选择的一个区间[l..r] 如果要使得这个区间的机器人全都死掉; 则需要攻击的次数就为…
[题目链接]:http://codeforces.com/contest/799/problem/D [题意] 给你长方形的两条边h,w; 你每次可以从n个数字中选出一个数字x; 然后把h或w乘上x; 直到能够把一个长为a宽为b的长方形装下为止; 问你最小的数字选择次数; [题解] 把所给的n个数字从大到小排; 显然同样是选一个数字,选大的数字肯定比较优; 问题只是要让哪一条边乘上它; 这里可以知道 如果全都是2的话 最多需要34个数字; 因为log2(100000)≈17 然后两条边都最多需要…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output People do many crazy things to stand out in a crowd. Some of them dance, some learn by heart rules of Russian language, some try to become a…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vanya is doing his maths homework. He has an expression of form , where x1, x2, -, xn are digits from 1 to 9, and sign represents either a plus '…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vanya got an important task - he should enumerate books in the library and label each book with its number. Each of the n books should be assigne…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output A function is called Lipschitz continuous if there is a real constant K such that the inequality |f(x) - f(y)| ≤ K·|x - y| holds for all . We'll…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output A soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana, 2k dollars for the second one and so on (in other wor…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Limak is going to participate in a contest on the last day of the 2016. The contest will start at 20:00 and will last four hours, exactly until m…
time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Bogdan has a birthday today and mom gave him a tree consisting of n vertecies. For every edge of the tree i, some number xi was written on it. I…
[CodeForces - 1225C]p-binary [数论][二进制] 标签: 题解 codeforces题解 数论 题目描述 Time limit 2000 ms Memory limit 524288 kB Source Technocup 2020 - Elimination Round 2 Tags bitmasks brute force math *1600 Site https://codeforces.com/problemset/problem/1225/c 题面 Exa…
[CodeForces - 1225E]Rock Is Push [dp][前缀和] 标签:题解 codeforces题解 dp 前缀和 题目描述 Time limit 2000 ms Memory limit 524288 kB Source Technocup 2020 - Elimination Round 2 Tags binary search dp *2200 Site https://codeforces.com/problemset/problem/1225/E 题面 Examp…
企业IT管理员IE11升级指南 系列: [1]—— Internet Explorer 11增强保护模式 (EPM) 介绍 [2]—— Internet Explorer 11 对Adobe Flash的支持 [3]—— IE11 新的GPO设置 [4]—— IE企业模式介绍 [5]—— 不跟踪(DNT)例外 [6]—— Internet Explorer 11面向IT专业人员的常见问题 [7]—— Win7和Win8.1上的IE11功能对比 [8]—— Win7 IE8和Win7 IE11对比…
[codeforces 415D]Mashmokh and ACM 题意:美丽数列定义:对于数列中的每一个i都满足:arr[i+1]%arr[i]==0 输入n,k(1<=n,k<=2000),问满足[数列长度是k && 数列中每一个元素arr[i]在1~n之间 && 数列中元素可以重复]的数列有多少个?结果对10^9+7取余 解题思路:dp[i][j]表示长度是j,最后一位是i的种数 if(kk%i==0) dp[kk][j+1]+=dp[i][j] #inc…
题目链接: http://codeforces.com/problemset/problem/691/D 题目大意: 给一个1到N的排列,M个操作(1<=N,M<=106),每个操作可以交换X Y位置上的数字,求可以得到的最大字典序的数列. 题目思路: [搜索][并查集] 这题可以用搜索或者并查集写,都能过. 把位置分成若干块,每一块里面的位置都是可以被这一块里另一个位置经过若干次调换的(类似强连通,位置可达). 然后把每一块位置里的 位置按从小到大排序,位置上的值按从大到小排序,依次填入位置…
题目链接: http://codeforces.com/gym/100526 http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=11674&courseid=0 题目大意: N个学生M道题(1<=N<=12,1<=M<=30),每道题只有正误两种选项(0 1),每个学生的答题情况和正确题数已知,求标准答案可能有多少种. 如果标准答案只有一种则输出标准答案,否则输出解的个数. 题目思路: […
题目链接: http://codeforces.com/problemset/problem/706/E 题目大意: 给一个N*M的矩阵,Q个操作,每次把两个同样大小的子矩阵交换,子矩阵左上角坐标分别为(a,b)和(c,d),高度h,宽度w. (2 ≤ n, m ≤ 1000, 1 ≤ q ≤ 10 000) 题目思路: [链表][模拟] 这一看如果直接模拟的话时间复杂度是N*M*Q,肯定T了. 把矩阵看成链表,链表的方向有上下左右四种,其实每次交换两个子矩阵只改变的外围一圈的链表值,而内部的链…