There are nn segments [li,ri][li,ri] for 1≤i≤n1≤i≤n. You should divide all segments into two non-empty groups in such way that there is no pair of segments from different groups which have at least one common point, or say that it's impossible to do…
D. The Union of k-Segments   You re given n segments on the coordinate axis Ox and the number k. The point is satisfied if it belongs to at least k segments. Find the smallest (by the number of segments) set of segments on the coordinate axis Ox whic…
Sereja and Mugs Time Limit: 1000MS   Memory Limit: 262144KB   64bit IO Format: %I64d & %I64u Submit Status Description Sereja showed an interesting game to his friends. The game goes like that. Initially, there is a table with an empty cup and n wate…
#include<iostream> #include<cstdio> #include<algorithm> #include<cstdlib> #include<cstring> #include<string> #include<cmath> #include<map> #include<set> #include<vector> #include<queue> #in…
上sql select * FROM ( SELECT SUM(c.overtime_num) AS delay_num, ) rate , '全网' as reaCodeFROM calc_vmap_repair_timely_rate_mon_stat c and c.MONTH BETWEEN '2019-01' AND '2019-01' ) t1 UNION ALL SELECT t2.* FROM ( select tmp.* FROM ( SELECT SUM(c.overtime…
Educational Codeforces Round 58 (Rated for Div. 2)  题目总链接:https://codeforces.com/contest/1101 A. Minimum Integer 题意: 多组数据,给你三个数l,r,d,要求在区间[l,r]之外找一个最小的x,使得x%d==0. 题解: 当d<l or d>r的时候,直接输出d就好了. 当l<=d<=r的时候,找到最小的t,使得t*d>r就行了. 具体操作见代码: #include…
A. Minimum Integer 链接:http://codeforces.com/contest/1101/problem/A 代码: #include<bits/stdc++.h> using namespace std; #define ll long long int main() { int n,x,y,d; cin >> n; ;i <= n;i ++){ cin>>x>>y>>d; if(x > d) cout<…
A. Minimum Integer 签到. #include <bits/stdc++.h> using namespace std; #define ll long long ll l, r, d; int main() { int t; scanf("%d", &t); while (t--) { scanf("%lld%lld%lld", &l, &r, &d); if (d < l) printf(&quo…
A. Minimum Integer 水 #include<bits/stdc++.h> #define clr(a,b) memset(a,b,sizeof(a)) using namespace std; typedef long long ll; ; struct node{ ll num,mag; friend bool operator <(const node &a,const node &b){ return a.mag>b.mag; } }a[max…
A. Minimum Integer 如果\(d < l\),则\(d\)满足条件 否则,输出\(d * (r / d + 1)\)即可. #include <cstdio> #include <iostream> using namespace std; int main(){ int T; scanf("%d", &T); while(T--){ int l, r, d; scanf("%d%d%d", &l, &a…