CodeForces 610B Vika and Squares】的更多相关文章

#include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; +; long long a[maxn],n; long long Min; long long ans; long long b[maxn]; int main() { while(~scanf("%lld",&n)){ Min=; ;i<=…
B. Vika and Squares time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vika has n jars with paints of distinct colors. All the jars are numbered from 1 to n and the i-th jar contains ai liter…
B. Vika and Squares 题目连接: http://www.codeforces.com/contest/610/problem/B Description Vika has n jars with paints of distinct colors. All the jars are numbered from 1 to n and the i-th jar contains ai liters of paint of color i. Vika also has an infi…
B. Vika and Squares   Vika has n jars with paints of distinct colors. All the jars are numbered from 1 to n and the i-th jar contains ai liters of paint of color i. Vika also has an infinitely long rectangular piece of paper of width 1, consisting of…
B. Vika and Squares time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vika has n jars with paints of distinct colors. All the jars are numbered from 1 to n and the i-th jar contains ai liter…
D. Spongebob and Squares Spongebob is already tired trying to reason his weird actions and calculations, so he simply asked you to find all pairs of n and m, such that there are exactly x distinct squares in the table consisting of n rows and m colum…
Description Vika has n jars with paints of distinct colors. All the jars are numbered from 1 to n and the i-th jar contains ai liters of paint of color i. Vika also has an infinitely long rectangular piece of paper of width 1, consisting of squares o…
discription Sereja painted n points on the plane, point number i (1 ≤ i ≤ n) has coordinates (i, 0). Then Sereja marked each point with a small or large English letter. Sereja don't like letter "x", so he didn't use it to mark points. Sereja thi…
C - Two Squares 思路: 点积叉积应用 代码: #include<bits/stdc++.h> using namespace std; #define fi first #define se second #define pi acos(-1.0) #define LL long long #define mp make_pair #define pb push_back #define ls rt<<1, l, m #define rs rt<<1|1…
输入n个点,问可以构成多少个正方形.n,xi,yi<=100,000. 刚看题的时候感觉好像以前见过╮(╯▽╰)╭最近越来越觉得以前见过的题偶尔就出现类似的,可是以前不努力啊,没做出来的没认真研究 首先想到的朴素是n^2的算法,10^10显然不行=.=抱着过预判的侥幸心理写了一发,打算过预判之后锁上看别人代码怎么做,结果TLE 13 第二天早上起来看题解,看不懂,看别人的代码才懂的.... 大概就是,避开最坏情况,枚举正方形左下角的点,然后如果当前x的点数量比sqrt(n)要小,就用当前x的上边…