Educational Codeforces Round 23】的更多相关文章

E. Choosing The Commander time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output As you might remember from the previous round, Vova is currently playing a strategic game known as Rage of Empires…
C. Really Big Numbers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ivan likes to learn different things about numbers, but he is especially interested in really big numbers. Ivan thinks…
B. Makes And The Product time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output After returning from the army Makes received a gift — an array a consisting of n positive integer numbers. He hadn'…
F. MEX Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a set of integer numbers, initially it is empty. You should perform n queries. There are three different types…
D. Imbalanced Array time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an array a consisting of n elements. The imbalance value of some subsegment of this array is the differenc…
C. Really Big Numbers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ivan likes to learn different things about numbers, but he is especially interested in really big numbers. Ivan thinks…
昨晚听说有教做人场,去补了下玩. 大概我的水平能做个5/6的样子? (不会二进制Trie啊,我真菜) A. 傻逼题.大概可以看成向量加法,判断下就好了. #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> using namespace std; int x1,x2,yy1,y2,x,y; int main(){ scanf("%d%d%d%d%d%d&qu…
A题 分析:注意两个点之间的倍数差,若为偶数则为YES,否则为NO #include "iostream" #include "cstdio" #include "cstring" #include "string" #include "cmath" using namespace std; int main() { int x1,y1,x2,y2; cin>>x1>>y1>&…
A Treasure Hunt 注意负数和0的特殊处理.. 水题.. 然而又被Hack了 吗的智障 #include<bits/stdc++.h> using namespace std; int main() { int sa,sb,da,db,x,y; scanf("%d%d%d%d%d%d",&sa,&sb,&da,&db,&x,&y); sa=da-sa;sb=db-sb; if(sa<0)sa*=-1; if(…
人生第二场codeforces.然而遇上了Education场这种东西 Educational Codeforces Round 40 下午先在家里睡了波觉,起来离开场还有10分钟. 但是突然想起来还没报名呢,并且电脑又是开机黑屏什么情况 莫非为之后的凉凉埋下了伏笔? 比赛之前联系了下余翱和叶可禾,似乎都要去切题的样子? 想到第一次有人一起打CF还是有点小激动的.于是果断屏蔽余翱QQ上的刷屏去看A题了. A. Diagonal Walking 非常仔细地把题读了一遍,然后……啥这不是字符串入门题…
Educational Codeforces Round 65 (Rated for Div. 2)题解 题目链接 A. Telephone Number 水题,代码如下: Code #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e5 + 5; int a[N] ; int n, T; char s[N] ; int main() { cin >> T; whil…
Educational Codeforces Round 17 A. k-th divisor 水题,把所有因子找出来排序然后找第\(k\)大 view code //#pragma GCC optimize("O3") //#pragma comment(linker, "/STACK:1024000000,1024000000") #include<bits/stdc++.h> using namespace std; function<voi…
[Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file for some programming competition problem. His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he will manually ge…
[Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic progressions: a1k + b1 and a2l + b2. Find the number of integers x such that L ≤ x ≤ R andx = a1k' + b1 = a2l' + b2, for some integers k', l' ≥ 0. 输入 Th…
[Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different numbers from 1 to n2, so the sum in each row, column and both main diagonals are odd. 输入 The only line contains odd integer n (1 ≤ n ≤ 49). 输出 Print n lines…
[Educational Codeforces Round 16]B. Optimal Point on a Line 试题描述 You are given n points on a line with their coordinates xi. Find the point x so the sum of distances to the given points is minimal. 输入 The first line contains integer n (1 ≤ n ≤ 3·105)…
[Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board. You are given his position in format "cd", where c is the column from 'a' to 'h' and dis the row from '1' to '8'. Find the number of moves perm…
Educational Codeforces Round 6 C. Pearls in a Row 题意:一个3e5范围的序列:要你分成最多数量的子序列,其中子序列必须是只有两个数相同, 其余的数只能出现一次. 策略: 延伸:这里指的延伸如当发现1-1如果以最后出现重叠的数为右边界则就表示左延伸,若以1.0.1..0第二个0前一个位置作为右边界就为右延伸: 开始时想是右延伸,考虑到可能只出现一组两个数相同,认为向左延伸会出错,但是直接WA了之后,发现这并不是题目的坑点(其实只需将最后一组改成左右…
Educational Codeforces Round 9 Longest Subsequence 题目描述:给出一个序列,从中抽出若干个数,使它们的公倍数小于等于\(m\),问最多能抽出多少个数,并输出方案与公倍数. solution 枚举每一个数,将它的倍数的答案加一,最大值就是答案. 时间复杂度:\(O(nlogn)\) Thief in a Shop 题目描述:给出\(n\)中物品与它们的价值,每种物品都有无限个,问从中拿出\(m\)个,价值有可能是什么,输出所有的价值. soluti…
Educational Codeforces Round 37 这场有点炸,题目比较水,但只做了3题QAQ.还是实力不够啊! 写下题解算了--(写的比较粗糙,细节或者bug可以私聊2333) A. Water The Garden 题意:给你一个长度为\(n\)的池子,告诉你哪些地方一开始有水, 每秒可以向左和向右增加一格的水, 问什么时候全部充满水.(\(n \le 200\)) 题解:按题意模拟.每次进来一个水龙头,就更新所有点的答案 (取\(min\)).最 后把所有点取个\(max\)就…
Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec Problem Description Input Output The only line should contain the minimal number of days required for the ship to reach the point (x2,y2)(x2,y2). If it…
Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec Problem Description Input The input contains a single line consisting of 2 integers N and M (1≤N≤10^18, 2≤M≤100). Output Print one integer, the total n…
616A - Comparing Two Long Integers    20171121 直接暴力莽就好了...没什么好说的 #include<stdlib.h> #include<stdio.h> #include<math.h> #include<cstring> #include<iostream> #include<algorithm> using namespace std; string a,b;int sa,sb;…
Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define IT set<ll>::iterator #define sqr(x)…
Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define IT set<ll>::iterator #define sqr(…
Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://codeforces.com/contest/985/problem/F Description You are given a string s of length n consisting of lowercase English letters. For two given strings s an…
Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://codeforces.com/contest/985/problem/E Description Mishka received a gift of multicolored pencils for his birthday! Unfortunately he lives in a monochrome w…
Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进行一次翻转,问是否存在一种方案,可以使得翻转后字符串的字典序可以变小.   这个很简单,贪心下就行了. 代码如下: Code #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 3e5…
这两道题都需要用到拓扑排序,所以先介绍一下什么叫做拓扑排序. 这里说一下我是怎么理解的,拓扑排序实在DAG中进行的,根据图中的有向边的方向决定大小关系,具体可以下面的题目中理解其含义 Educational Codeforces Round 25  E. Minimal Labels 题目链接:http://codeforces.com/contest/825/problem/E 题意:给你一个有向无环图(DAG),有n个顶点,m条边,顶点的序号分别是1-n,现在给你1-n的数对n个顶点进行赋值…
Educational Codeforces Round 40 F. Runner's Problem 题意: 给一个$ 3 * m \(的矩阵,问从\)(2,1)$ 出发 走到 \((2,m)\) 的方案数 \(mod 1e9 + 7\), 走的规则和限制如下: From the cell (i, j) you may advance to: (i - 1, j + 1) - only if i > 1, (i, j + 1), or (i + 1, j + 1) - only if i <…