Codeforces Round #415 (Div. 1) (CDE)】的更多相关文章

1. CF 809C Find a car 大意: 给定一个$1e9\times 1e9$的矩阵$a$, $a_{i,j}$为它正上方和正左方未出现过的最小数, 每个询问求一个矩形内的和. 可以发现$a_{i,j}=(i-1)\oplus (j-1)+1$, 暴力数位$dp$即可 #include <iostream> #include <sstream> #include <algorithm> #include <cstdio> #include <…
A. Straight «A» time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Noora is a student of one famous high school. It's her final year in school — she is going to study in university next year.…
C https://codeforces.com/contest/1130/problem/C 题意 给你一个\(n*m\)(n,m<=50)的矩阵,每个格子代表海或者陆地,给出在陆地上的起点终点,只允许挖一条穿越海的隧道,假设隧道连接的两个陆地分别为(x1,y1),(x2,y2),则挖隧道的花费为\((y1-x1)*(y1-x1)+(y2-x2)*(y2-x2)\) 题解 分别找出和起点,和终点连接的陆地(找联通块),枚举两个点维护最小值 代码 #include<bits/stdc++.h&…
A. Straight «A» 题面 Noora is a student of one famous high school. It's her final year in school - she is going to study in university next year. However, she has to get an «A» graduation certificate in order to apply to a prestigious one. In school, w…
(C) Wrong Addition Problem - C - Codeforces 题意 定义一种计算方式, 对于a+b=c,  给出a和c, 求b 题解 因为求法是从个位求得, 先求出来的最后输出, 符合栈的存储方式, 所以b用栈来存 每次拿c的最后一位(若小于a最后一位, 则取后两位)减去a的最后一位, 存入b的栈 需要注意的是,: 1.若c已经没了, 但是a还有, 则无解 2. 若c中出现00则无解(下面代码中, 以c后两位<a最后一位判断的) 3. 减去后有两位数, 因为每次求出来的…
CodeForces - 810A A. Straight «A» time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Noora is a student of one famous high school. It's her final year in school - she is going to study in univ…
A:考虑每对最大值最小值的贡献即可. #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define ll long long #define N 300010 #define P 1000000007 char getc(){…
反正又是一个半小时没做出来... 先排序,然后求和,第i个和第j个,f(a)=a[j]-a[i]=a[i]*(2^(j-i-1))因为从j到i之间有j-i-1个数(存在或者不存在有两种情况) 又有a[i+k]-a[i]=a[n]+a[n-1]+...+a[n-k]-a[k+1]-...-a[1] #include<map> #include<set> #include<cmath> #include<queue> #include<stack>…
A. Straight «A» time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Noora is a student of one famous high school. It's her final year in school — she is going to study in university next year.…
C. Do you want a date?   2 seconds 256 megabytes   Leha decided to move to a quiet town Vičkopolis, because he was tired by living in Bankopolis. Upon arrival he immediately began to expand his network of hacked computers. During the week Leha manage…