Codeforces Round #394 (Div. 2) - A】的更多相关文章

E. Dasha and Puzzle time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Dasha decided to have a rest after solving the problem. She had been ready to start her favourite activity — origami, bu…
昨天晚上(今天凌晨),又忍不住去打CF.(本蒟弱到只能打Div.2)... 我觉得我可以用一个词概括我这次的CF: 呵呵 刚一开赛,我就codeforces访问失败.. 后来好不容易能上了,两三分钟才能加载完一个网页. 磨蹭到我打开题目界面,已经过去了7min了!! 这还不是重点. 等我看到题目的时候,WOC!!!!这是啥???俄文???? 我找google translate,翻译成中文,,什么玩意??根本读不通!! 翻译成英文!啥?? 2 3你给我翻译成March 3??靠不靠谱?? 后来我…
E. Dasha and Puzzle 题目连接: http://codeforces.com/contest/761/problem/E Description Dasha decided to have a rest after solving the problem. She had been ready to start her favourite activity - origami, but remembered the puzzle that she could not solve…
D. Dasha and Very Difficult Problem 题目连接: http://codeforces.com/contest/761/problem/D Description Dasha logged into the system and began to solve problems. One of them is as follows: Given two sequences a and b of length n each you need to write a se…
C. Dasha and Password 题目连接: http://codeforces.com/contest/761/problem/C Description After overcoming the stairs Dasha came to classes. She needed to write a password to begin her classes. The password is a string of length n which satisfies the follo…
B. Dasha and friends 题目连接: http://codeforces.com/contest/761/problem/B Description Running with barriers on the circle track is very popular in the country where Dasha lives, so no wonder that on her way to classes she saw the following situation: Th…
A. Dasha and Stairs 题目连接: http://codeforces.com/contest/761/problem/A Description On her way to programming school tiger Dasha faced her first test - a huge staircase! The steps were numbered from one to infinity. As we know, tigers are very fond of…
http://codeforces.com/contest/761/problem/E 题意:给出一棵树,现在要把这棵树上的结点放置在笛卡尔坐标上,使得每一条边与x轴平行或者与y轴平行.输出可行解,即每个点放置的坐标. 思路: 一开始我想,这个每条边的边长都是可长可短的,好像很麻烦啊. 做法还是很巧妙的,因为最多也就30个点,所以我们直接让该点连接的边未len长度,然后dfs它的子节点并使它的子节点的边长为len/2.你会发现,这样线段就不会相交了. #include<iostream> #i…
http://codeforces.com/contest/761/problem/C 题意:给出n个串,每个串的初始光标都位于0(列)处,怎样移动光标能够在凑出密码(每个串的光标位置表示一个密码的字符,密码至少包含3种字符:数字,小写字母,特殊符号)的情况下使得移动的光标步数最小. 思路: 因为每个串只提供一个密码,所以我们先预处理计算出每个字符串3种字符的最少移动步数. 然后接下三重循环枚举,分别表示数字,小写字母,特殊符号由第i,j,k行提供. #include<iostream> #i…
http://codeforces.com/contest/761/problem/B 题意: 有一个长度为l的环形跑道,跑道上有n个障碍,现在有2个人,给出他们每过多少米碰到障碍,判断他们跑的是不是同一个跑道. 思路: 如果是同一个跑道,那么障碍与障碍之间的距离是相同的. 所以我们可以先计算出两个人的跑道的障碍之间的距离,然后暴力比较,如果全部一样就是同一个跑道(因为是环形跑道,所以在比较的时候每次都需要将第一个加到最后). #include<iostream> #include<st…
题目链接:http://codeforces.com/contest/761/problem/D D. Dasha and Very Difficult Problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Dasha logged into the system and began to solve problem…
题目链接:http://codeforces.com/problemset/problem/761/C C. Dasha and Password time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output After overcoming the stairs Dasha came to classes. She needed to w…
题目链接:http://codeforces.com/contest/761/problem/B B. Dasha and friends time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Running with barriers on the circle track is very popular in the count…
题目链接:http://codeforces.com/contest/761/problem/C 题意:给定n个长度为m的字符串.每个字符串(字符串下标从0到m-1)都有一个指针,初始指针指向第0个位置.现在让你把每个字符串的指针移动到某个位置使得n个字符串中个个字符串的指针指向的字符组成一个新的密码串.并且这个密码串要合法. 一个合法的密码串一个满足:至少有一个数字,一个小写字母,一个给定的符号中的其中一个.问组成合法密码串的最小总移动步数.思路:因为只有数字,字母,符号三个要求,并且密码串中…
题目链接:http://codeforces.com/contest/761/problem/B 题意:给定一个环形跑道.里面有n个障碍,跑道长度为L.然后有两个人在两个起点(起点可能相同),每个人都按逆时针走.现在给出这两个人遇到这n个障碍时走的步数.问是否存在合法的障碍分布.思路:我们假设第一个人的起点为原点.那么对于第一个人来说n个障碍的位置就是对于他的输入序列.然后枚举第二个人的起点.根据第二个人的序列来判断是否和第一个人的位置一样.一样则说明存在合法分布. 注意由于跑道是环形所以要进行…
题目链接:http://codeforces.com/contest/761/problem/A 题意:给定a个偶数,b个奇数,问是否能构成奇偶相间的阶梯.思路:a和b相差小于等于1即可构造出来.特判 a=0,b=0. import java.io.PrintWriter; import java.util.*; public class Main { public static final int MAXN=100000+5; public static int v[]=new int [MA…
C. Dasha and Password time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output After overcoming the stairs Dasha came to classes. She needed to write a password to begin her classes. The password i…
A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On her way to programming school tiger Dasha faced her first test — a huge staircase! The steps were numbered from one t…
前一半是刚刚打完比赛的时候写的……不知为啥手腕有点僵,估计是前一个小时用力过度了吧= = 前四题看着还好,后两题就有点懵逼了……现在还不知道E题的题意到底是啥…… 不管了……还没找着官方题解,贴一下自己的做法算了…… A显然是傻逼题啊……没注意到a,b都是0的情况,被hack了一次…… #include<cstdio> using namespace std; int main(){ int a,b; scanf("%d%d",&a,&b); &&a…
A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On her way to programming school tiger Dasha faced her first test — a huge staircase! The steps were numbered from one t…
E. Dasha and Puzzle time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Dasha decided to have a rest after solving the problem. She had been ready to start her favourite activity — origami, bu…
D. Dasha and Very Difficult Problem time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Dasha logged into the system and began to solve problems. One of them is as follows: Given two sequences…
B. Dasha and friends time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Running with barriers on the circle track is very popular in the country where Dasha lives, so no wonder that on her wa…
A. Dasha and Stairs time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output On her way to programming school tiger Dasha faced her first test — a huge staircase! The steps were numbered from one t…
C. Dasha and Password time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output After overcoming the stairs Dasha came to classes. She needed to write a password to begin her classes. The password i…
纪念死去的智商(虽然本来就没有吧……) 三重循环枚举将哪三个fix string作为数字.字母和符号位.记下最小的值就行了. 预处理之后这个做法应该是O(n^3)的,当然完全足够.不预处理是O(n^3*m)的,也够. 我写了一个O(n^2+n*m)的分类讨论贪心做法……蜜汁错,容我查一下. 现在查出个错,交了一下在in queue……容我明天看看对不对. 如果对的话,这题的加强版今年留作趣味赛题吧,嘿嘿嘿…… UPDATE:果然过了……我就是傻逼 #include<cstdio> #inclu…
无需吟唱,直接传送 problem A 题目大意 已知有n个偶数,m个奇数,问这些数有没有可能组成一个严格递增1的序列 题解 判断abs(n,m) <= 1即可,注意n,m均为0的情况. Code #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long ll; inline void read(int &x){ x=0;…
开始啦~ 始まった T1 #include <stdio.h> int l,r,even,odd; void Jud(){ for(int i=1;i<=200;i++){ for(int j=i;j<=200;j++){ odd=even=0; for(int k=i;k<=j;k++) k&1?odd++:even++; if(even==l&&odd==r){ puts("YES"); return; } } } puts(&…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/output 1 s, 256 MB    x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB    x1462 C Vasya and String standard input/output 1 s, 256 MB    x1393…