F. Xors on Segments 题目连接: http://www.codeforces.com/contest/620/problem/F Description You are given an array with n integers ai and m queries. Each query is described by two integers (lj, rj). Let's define the function . The function is defined for o…
传送门:http://codeforces.com/contest/895/problem/B B. XK Segments time limit per test1 second memory limit per test256 megabytes Problem Description While Vasya finished eating his piece of pizza, the lesson has already started. For being late for the l…
题意:给你 n 段区间,而且还是不相交的,然后你只能向左扩展左端点,或者向右扩展右端点,然后扩展最少的步数让整数总数能够整除 k. 析:很简单么,只要在记录算一下数量,然后再算出 k 的倍数差多少就行. 代码如下: #include <bits/stdc++.h> using namespace std; typedef long long LL; const int maxn = 500 + 5; const int INF = 0x3f3f3f3f; const int dr[] = {0…
D - Nested Segments CodeForces - 652D You are given n segments on a line. There are no ends of some segments that coincide. For each segment find the number of segments it contains. Input The first line contains a single integer n (1 ≤ n ≤ 2·105) - t…