E -- Expected value of the expression DESCRIPTION You are given an expression: A0O1A1O2A2⋯OnAnA0O1A1O2A2⋯OnAn, where Ai(0≤i≤n)Ai(0≤i≤n) represents number, Oi(1≤i≤n)Oi(1≤i≤n) represents operator. There are three operators, &,|,^&,|,^, which means a…
A -- simple math problem Time Limit:2s Memory Limit:128MByte Submissions:1599Solved:270 SAMPLE INPUT 5 20 1314 SAMPLE OUTPUT 5 21 1317 SOLUTION “玲珑杯”ACM比赛 Round #19 题目链接:http://www.ifrog.cc/acm/problem/1145 分析: 这个题解是官方写法,官方代码如下: #include <iostream>…
“玲珑杯”ACM比赛 Round #19 Start Time:2017-07-29 14:00:00 End Time:2017-07-29 16:30:00 Refresh Time:2017-07-29 16:42:55 Private B -- Buildings Time Limit:2s Memory Limit:128MByte Submissions:590Solved:151 DESCRIPTION There are nn buildings lined up, and th…
1149 - Buildings Time Limit:2s Memory Limit:128MByte Submissions:588Solved:151 DESCRIPTION There are nn buildings lined up, and the height of the ii-th house is hihi. An inteval [l,r][l,r](l≤r)(l≤r) is harmonious if and only if max(hl,…,hr)−min(hl,…,…
A -- A simple math problem Time Limit:2s Memory Limit:128MByte Submissions:1599Solved:270 DESCRIPTION You have a sequence anan, which satisfies: Now you should find the value of ⌊10an⌋⌊10an⌋. INPUT The input includes multiple test cases. The number o…
我能说我比较傻么!就只能做一道签到题,没办法,我就先写下A题的题解&源码吧,日后补上剩余题的题解&源码吧!                                     A -- Niro plays Galaxy Note 7                    Time Limit:1s Memory Limit:128MByte DESCRIPTION Niro, a lovely girl, has bought a Galaxy Note 7 and wants to…
Start Time:2016-08-20 13:00:00 End Time:2016-08-20 18:00:00 Refresh Time:2017-11-12 19:51:52 Public A -- Absolute Defeat Time Limit:2s Memory Limit:64MByte Submissions:394Solved:119 DESCRIPTION Eric has an array of integers a1,a2,...,ana1,a2,...,an.…
“玲珑杯”ACM比赛 Round #18 Start Time:2017-07-15 12:00:00 End Time:2017-07-15 15:46:00 A -- 计算几何你瞎暴力 Time Limit:5s Memory Limit:256MByte Submissions:1764Solved:348 DESCRIPTION 今天HHHH考完了期末考试,他在教学楼里闲逛,他看着教学楼里一间间的教室,于是开始思考: 如果从一个坐标为 (x1,y1,z1)(x1,y1,z1)的教室走到(…
http://www.ifrog.cc/acm/problem/1050?contest=1006&no=4 DP[val]表示以val这个值结尾的等差数列有多少个 DP[val] += DP[val / 2]; 数值很大,用map<int, int>DP即可. #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <alg…
题目链接:http://www.ifrog.cc/acm/problem/1146?contest=1020&no=2 题解:显然知道这是一道dp而且 dp[i]=min(dp[j]+2^(x[j]-x[i])+a,dp[i])但是这题很显然2的次幂显然很容易比a大于是只要for一遍最多30次就行具体看一下代码,炒鸡简单的. #include <iostream> #include <cstring> #include <algorithm> #include…