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…
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. Vika and Segments 题目连接: http://www.codeforces.com/contest/610/problem/D Description Vika has an infinite sheet of squared paper. Initially all squares are white. She introduced a two-dimensional coordinate system on this sheet and drew n black hor…
D. Vika and Segments     Vika has an infinite sheet of squared paper. Initially all squares are white. She introduced a two-dimensional coordinate system on this sheet and drew n black horizontal and vertical segments parallel to the coordinate axes.…
题目链接:http://codeforces.com/contest/610/problem/D 就是给你宽度为1的n个线段,然你求总共有多少单位的长度. 相当于用线段树求面积并,只不过宽为1,注意y和x的最大都要+1,这样才相当于求面积. #include <iostream> #include <cstdio> #include <cstring> #include <map> #include <algorithm> using names…
Codeforces Round #297 (Div. 2)C. Ilya and Sticks Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  Solved: 2xx 题目连接 http://codeforces.com/contest/525/problem/C Description In the evening, after the contest Ilya was bored, and he really felt like ma…
水 A - Pasha and Stick #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5; const int INF = 0x3f3f3f3f; int main(void) { int n; scanf ("%d", &n); int ans = n / 4; if (n % 4 == 0) { ans--; } if (n %…
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…