题意:同POJ2318 #include<algorithm> #include<cstdio> #include<cstdlib> #include<cstring> using namespace std; struct point { int x, y; }; struct Node { point Low, High; }line[5010]; int Num[5010]; int par[5010]; bool cmp(Node A, Node B…
题目大意:给定一个矩形和一些线段,线段将矩形分割为从左至右的若干部分,之后给出一些玩具的坐标,求每个部分中玩具的数量 #include<cstdio> #include<cstdlib> #include<cstring> using namespace std; struct point { int x, y; }; struct Node { point a, b; }A[5010]; int pos[5010]; bool is_right(int xx, int…
Calculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away when he is finished playing with them. They gave John a rectangular box to put his toys in, but John i…
题面: 传送门:http://codeforces.com/problemset/problem/475/D Given a sequence of integers a1, -, an and q queries x1, -, xq on it. For each query xi you have to count the number of pairs (l, r) such that 1 ≤ l ≤ r ≤ n and gcd(al, al + 1, -, ar) = xi. 题目大意:…