CF 1108A Two distinct points 题目意思:给你两个线段的起点和终点,让你给出两个不同的点,这两点分别处于两个不同的线段之中.解题思路:题目说如果存在多种可能的点,随意一组答案即可,这样其实我们只需要取最特殊的起点即可.但要注意如果起点相同,那我们需要找一个起点一个终点. #include<cstdio> #include<cmath> #include<cstring> #define ll long long int using namesp…
题目链接:https://vjudge.net/contest/28079#problem/P 题目大意:给你数组A[]以及如下所示的函数f: long long f( int A[], int n ) { // n = size of A long long sum = 0; for( int i = 0; i < n; i++ ) for( int j = i + 1; j < n; j++ ) sum += A[i] - A[j]; return sum; } 有两个操作:0 x v…
Positive Negative Sign Time Limit: 2000MS Memory Limit: 32768KB 64bit IO Format: %lld & %llu Submit Status Description Given two integers: n and m and n is divisible by 2m, you have to write down the first n natural numbers in the following form.…
CF 1114A Got Any Grapes(葡萄)? 题目意思:给三个人分葡萄,三个人对葡萄的颜色有一些要求,问所准备的三种颜色的葡萄能否满足三人的要求. 解题意思:直接按条件判断即可. #include<cstdio> #include<cmath> #include<cstring> #define ll long long int using namespace std; int main() { int x,y,z; int g,p,b; ; scanf(…