A. Petya and Origamitime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya is having a party soon, and he has decided to invite his n friends. He wants to make invitations in the form of origami. Fo…
A. Petya and Origami Water. #include <bits/stdc++.h> using namespace std; #define ll long long ll n, k; ll Get(ll x) { ? (x * n) / k : (x * n) / k + ; } int main() { while (scanf("%lld%lld", &n, &k) != EOF) { ll res = Get() + Get()…
题目链接:http://codeforces.com/contest/832/problem/B B. Petya and Exam time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It's hard times now. Today Petya needs to score 100 points on Informatics…
地址:http://codeforces.com/contest/832/problem/B 题目: B. Petya and Exam time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It's hard times now. Today Petya needs to score 100 points on Informati…
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即可 需要一颗以种类编号为下标,右端点为权值的主席树,维…