The link to problem:Problem - D - Codeforces   D. Range and Partition  time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output Given an array a of n integers, find a range of values [x,y] (x≤y…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mishka is trying really hard to avoid being kicked out of the university. In particular, he was doing absolutely nothing for the whole semes…
题目链接:https://codeforces.com/contest/1093 A. Dice Rolling 题意: 有一个号数为2-7的骰子,现在有一个人他想扔到几就能扔到几,现在问需要扔多少次,能使扔出的总和等于xi. 题解: 由于是special judge,模拟一下搞搞就行了= = 代码如下: #include <bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; int n; while(t--…
涨rating啦.. 不过话说为什么有这么多数据结构题啊,难道是中国人出的? A - Dice Rolling 傻逼题,可以用一个三加一堆二或者用一堆二,那就直接.. #include<cstdio> #include<cstring> #include<algorithm> #include<queue> #include<set> #include<map> #include<vector> #include<c…
A. Dice Rolling 签到. #include <bits/stdc++.h> using namespace std; int t, n; int main() { scanf("%d", &t); while (t--) { scanf("%d", &n); ) puts("); else { ; res += n / ; printf(); } } ; } B. Letters Rearranging 签到. #…
Codeforces Round #521 (Div. 3)  E. Thematic Contests 题目传送门 题意: 现在有n个题目,每种题目有自己的类型要举办一次考试,考试的原则是每天只有一种题目类型一种题目类型只能出现在一天每天的题目类型不能相同,而且后一天的题目数量必须正好为前一天的两倍,第一天的题目数量是任意的求怎么安排能使题目尽量多.注意:不是天数尽量多 思路: 首先我们知道一件事,题目属于哪种类型并不重要,重要的是每种类型的个数所以我们先统计出所有类型的个数,存进一个数组,而…
题目链接: https://codeforces.com/contest/1093/problem/G 题目: 题意: 在k维空间中有n个点,每次给你两种操作,一种是将某一个点的坐标改为另一个坐标,一种操作是查询[l,r]中曼哈顿距离最大的两个点的最大曼哈顿距离. 思路: 对于曼哈顿距离,我们将其绝对值去掉会发现如下规律(以二维为例): 故这题我们可以用线段树来维护[l,r]中上述每种情况的最大值和最小值,用二进制来枚举xy的符号(1为正,0为负),最后答案是 每种情况中区间最大值-区间最小值…
传送门:http://codeforces.com/contest/1093/problem/D D. Beautiful Graph time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an undirected unweighted graph consisting of nn vertices a…
给你一个无向图 以及点的个数和边  每个节点只能用1 2 3 三个数字 求相邻 两个节点和为奇数   能否构成以及有多少种构成方法 #include<bits/stdc++.h> using namespace std; #define LL long long #define maxn 300005 ; vector<int>q[maxn]; LL fa[maxn],sumx,sumy; ; LL poww(LL a,LL b){ LL ans = ; while(b){ ){…
A:签到. B:仅当只有一种字符时无法构成非回文串. #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define ll long long #define N 1010 ')) c=getchar();return c;}…