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.…
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.…
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…
就暴力枚举所有起点和终点就行了. 我做这题时想的太多了,最简单的暴力枚举起始点却没想到...应该先想最简单的方法,层层深入. #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<map> #include<set> #include<vector> #include<…
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 <…
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>…
B. Hamming Distance Sum time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Genos needs your help. He was asked to solve the following programming problem by Saitama: The length of some string…
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…