Codeforces Round #337 Alphabet Permutations】的更多相关文章

E. Alphabet Permutations time limit per test:  1 second memory limit per test:  512 megabytes input:  standard input output: standard output You are given a string s of length n, consisting of first k lowercase English letters. We define a c-repeat o…
D. Vika and Segments 题目连接: http://www.codeforces.com/contest/610/problem/D Description Vika has an infinite sheet of squared paper. Initially all squares are white. She introduced a two-dimensional coordinate system on this sheet and drew n black hor…
C. Harmony Analysis 题目连接: http://www.codeforces.com/contest/610/problem/C Description The semester is already ending, so Danil made an effort and decided to visit a lesson on harmony analysis to know how does the professor look like, at least. Danil…
B. Vika and Squares 题目连接: http://www.codeforces.com/contest/610/problem/B Description Vika has n jars with paints of distinct colors. All the jars are numbered from 1 to n and the i-th jar contains ai liters of paint of color i. Vika also has an infi…
A. Pasha and Stick 题目连接: http://www.codeforces.com/contest/610/problem/A Description Pasha has a wooden stick of some positive integer length n. He wants to perform exactly three cuts to get four parts of the stick. Each part must have some positive…
题目链接:http://codeforces.com/contest/610/problem/D 就是给你宽度为1的n个线段,然你求总共有多少单位的长度. 相当于用线段树求面积并,只不过宽为1,注意y和x的最大都要+1,这样才相当于求面积. #include <iostream> #include <cstdio> #include <cstring> #include <map> #include <algorithm> using names…
题目链接:http://codeforces.com/contest/610/problem/C 解题思路: 将后一个矩阵拆分为四个前一状态矩阵,其中三个与前一状态相同,剩下一个直接取反就行.还有很多种取法,这种比较方便就是. 实现代码: #include<iostream> #include<string> #include<cmath> using namespace std; ][],b[][]; int main() { int n; cin>>n;…
D. Vika and Segments     Vika has an infinite sheet of squared paper. Initially all squares are white. She introduced a two-dimensional coordinate system on this sheet and drew n black horizontal and vertical segments parallel to the coordinate axes.…
水 A - Pasha and Stick #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5; const int INF = 0x3f3f3f3f; int main(void) { int n; scanf ("%d", &n); int ans = n / 4; if (n % 4 == 0) { ans--; } if (n %…
D. Vika and Segments time limit per test:  2 seconds     memory limit per test:  256 megabytes input : standard input output:  standard output Vika has an infinite sheet of squared paper. Initially all squares are white. She introduced a two-dimensio…