codeforces round #394 (div. 2) A\B 题解】的更多相关文章

开始啦~ 始まった 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(&…
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…
这场比赛的出题人挺有意思,全部magic成了青色. 还有题目中的图片特别有趣. 晚上没打,开virtual contest打的,就会前三道,我太菜了. 最后看着题解补了第四道. 比赛传送门 A. Angry Students 题目大意:有t队学生,每个学生有两种状态,生气(A)或不生气(P).(话说为什么生气的戴着圣诞帽哇)所有生气的人都会往前一个人丢雪球,被丢到的人也会变得生气,也会丢雪球.问你每队人中最后一个学生变得生气的时刻. 这题就是统计最长的连续的'P'当然前提是左边有生气的人. 代码…
Codeforces Round #198 (Div. 2) 昨天看到奋斗群的群赛,好奇的去做了一下, 大概花了3个小时Ak,我大概可以退役了吧 那下面来稍微总结一下 A. The Wall Iahub and his friend Floyd have started painting a wall. Iahub is painting the wall red and Floyd is painting it pink. You can consider the wall being mad…
[Codeforces Round #672 (Div. 2) A - C1 ] 题目链接# A. Cubes Sorting 思路: " If Wheatley needs more than \(\frac{n \cdot (n-1)}{2}-1\) exchange operations, he won't do this boring work." 例如:5,4,3,2,1 我们需要移动4+3+2+1=10次,也就是\(\frac{n \cdot (n-1)}{2}\)次,所以…
无需吟唱,直接传送 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;…
昨天晚上(今天凌晨),又忍不住去打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/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…
链接:https://codeforces.com/contest/1293 A. ConneR and the A.R.C. Markland-N 题意:略 思路:上下枚举1000次扫一遍,比较一下上下最近的房间 AC代码: #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<map> #include<utility> #…
contest链接: https://codeforces.com/contest/1282 A. Temporarily unavailable 题意: 给一个区间L,R通有网络,有个点x,在x+r和x-r范围内,没有网络,问在这个区间上有网络的长度范围 思路:枚举区间覆盖情况,注意细节 AC代码: #include<iostream> #include<string> #include<vector> #include<cstring> #include…
contest链接:https://codeforces.com/contest/1283 A. Minutes Before the New Year 题意:给一个当前时间,输出离第二天差多少分钟 思路:略 AC代码: #include<iostream> #include<vector> #include<algorithm> #include<cmath> #include<cstring> using namespace std; ; ;…
题目: http://codeforces.com/contest/1011/problem/D This is an interactive problem. Natasha is going to fly to Mars. Finally, Natasha sat in the rocket. She flies, flies... but gets bored. She wishes to arrive to Mars already! So she decides to find som…
题目 http://codeforces.com/contest/1011/problem/C Natasha is going to fly on a rocket to Mars and return to Earth. Also, on the way to Mars, she will land on n−2n−2 intermediate planets. Formally: we number all the planets from 11 to nn. 11 is Earth, n…
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…
前一半是刚刚打完比赛的时候写的……不知为啥手腕有点僵,估计是前一个小时用力过度了吧= = 前四题看着还好,后两题就有点懵逼了……现在还不知道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…
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…
接着是C,D的题解 C. Tourist Problem Iahub is a big fan of tourists. He wants to become a tourist himself, so he planned a trip. There are n destinations on a straight road that Iahub wants to visit. Iahub starts the excursion from kilometer 0. The n destina…
A. Circle of Students      题目:https://codeforces.com/contest/1203/problem/A 题意:一堆人坐成一个环,问能否按逆时针或者顺时针正好是 1-n的顺序 思路:水题,把数组开两倍,或者标记当前位置都可以 #include<bits/stdc++.h> #define maxn 100005 #define mod 1000000007 using namespace std; typedef long long ll; int…
题目链接: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个障碍的位置就是对于他的输入序列.然后枚举第二个人的起点.根据第二个人的序列来判断是否和第一个人的位置一样.一样则说明存在合法分布. 注意由于跑道是环形所以要进行…