time limit per test 3 seconds memory limit per test 512 megabytes input standard input output standard output Artsem is on vacation and wants to buy souvenirs for his two teammates. There are n souvenir shops along the street. In i-th shop Artsem can…
题目链接:https://vjudge.net/problem/CodeForces-960F You are given a directed graph with n nodes and m edges, with all edges having a certain weight. There might be multiple edges and self loops, and the graph can also be disconnected. You need to choose…
https://codeforces.com/contest/1080/problem/F 题意 有k个区间,区间的种类有n种,有m个询问(n,m<=1e5,k<=3e5),每次询问a,b,x,y,代表对于种类编号为[a,b]的每一种区间,是否都存在一个区间x<=l,r<=y,输出yes or no 思路 现将区间按左端点从小到大排序,对于每一个询问首先找出第一个左端点大于x的区间,然后看[a,b]中最大的右端点是否>y即可 需要一颗以种类编号为下标,右端点为权值的主席树,维…