A.Teemo's bad day Today is a bad day. Teemo is scolded badly by his teacher because he didn't do his homework.But Teemo is very self-confident, he tells the teacher that the problems in the homework are too simple to solve. So the teacher gets much a…
65536K Teemo is very interested in convex polygon. There is a convex n-sides polygon, and Teemo connect every two points as diagonal lines, and he want to kown how many segments which be divided into intersections. Teemo ensure that any three diago…
M. Big brother said the calculation 通过线段树维护. 这个题和杭电的一道题几乎就是一样的题目.HDU5649.DZY Loves Sorting 题意就是一个n的排列,执行Q次操作,每次操作是对某个区间从小到大排序或者从大到小排序.最后只查询一次,输出第k个位置当前的数. 直接按HDU5649这个题写了. 因为只查询一次,而且这是n的全排列,所以直接二分答案,比mid小的赋值为0,大的赋值为1.区间查询判断的时候直接与0和1比较就可以了. 这个题写的简直要骂人…
65536K Today is a bad day. Teemo is scolded badly by his teacher because he didn't do his homework.But Teemo is very self-confident, he tells the teacher that the problems in the homework are too simple to solve. So the teacher gets much angrier an…
Teemo likes to drink raspberry juice. He even spent some of his spare time tomake the raspberry juice himself. The way to make the raspberries juice is simple. You just have to press the raspberries through a fine sieve. Unfortunately,today Teemo wa…
Teemo has a formula and he want to calculate it quickly. The formula is . As the result may be very large, please output the result mod 1000000007. Input Format The input contains several test cases, and the first line is a positive integer T indicat…
A. Majestic 10 题意:三个数均大于10则输出"triple-double",如果两个数大于10则输出"double-double",如果一个大于10则输出"double",如果没有数大于10则输出"zilch" #include<stdio.h> int main(){ int n,a,b,c; scanf("%d",&n); while(n--){ scanf("…
A Appeal to the Audience 要想使得总和最大,就要使最大值被计算的次数最多.要想某个数被计算的多,就要使得它经过尽量多的节点.于是我们的目标就是找到 k 条从长到短的链,这些链互不重合,且一端是叶子节点.可以通过长链剖分来将这棵树分为 k 条互不相交的长链,然后按照长度分配元素(长度越大,分配给它的元素值越大). #include<bits/stdc++.h> using namespace std; const int N = 1e5+10; const int M =…
I题 求 a 数组平方的前缀和和求 a 数组后缀和,遍历一遍即可 AC代码 #include<iostream>#include<cmath>using namespace std;int a[1000005];long long l[1000005], r[1000005];int main(){ int i,n; cin>>n; long long int sum; for(i=0;i<n;i++){ cin>>a[i]; } l[0]=a[0]…
牛客网暑期ACM多校训练营(第三场)H Diff-prime Pairs (贡献) 链接:https://ac.nowcoder.com/acm/contest/141/H来源:牛客网 Eddy has solved lots of problem involving calculating the number of coprime pairs within some range. This problem can be solved with inclusion-exclusion meth…
题目链接 题目描述 Eddy has solved lots of problem involving calculating the number of coprime pairs within some range. This problem can be solved with inclusion-exclusion method. Eddy has implemented it lots of times. Someday, when he encounters another copr…
2018 HDU多校第三场赛后补题 从易到难来写吧,其中题意有些直接摘了Claris的,数据范围是就不标了. 如果需要可以去hdu题库里找.题号是6319 - 6331. L. Visual Cube 题意: 在画布上画一个三维立方体. 题解: 模拟即可. 代码: #include <bits/stdc++.h> using namespace std; int a, b, c, R, C; char g[505][505]; int main () { int T; cin >>…