codeforces Round #258(div2) D解题报告】的更多相关文章

D. Count Good Substrings time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output We call a string good, if after merging all the consecutive equal characters, the resulting string is palindrome. F…
C. Predict Outcome of the Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n games in a football tournament. Three teams are participating in it. Currently k games had alread…
C. Little Pony and Expected Maximum time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle was playing Ludo with her friends Rainbow Dash, Apple Jack and Flutter Shy. But she kept…
CF一如既往在深夜举行,我也一如既往在周三上午的C++课上进行了virtual participation.这次div2的题目除了E题都水的一塌糊涂,参赛时的E题最后也没有几个参赛者AC,排名又成为了手速与精准的竞争--(遗憾,如果参加了一定可以上分的吧orz) A题: 先判断起点和终点的距离是否被每次跳的距离整除,如果不整除就到不了.再检验跳跃过程中的落点是否均合法即可. #include<stdio.h> #include<bits/stdc++.h> #include <…
---恢复内容开始--- Codeforces Round #324 (Div. 2) Problem A 题目大意:给二个数n.t,求一个n位数能够被t整除,存在多组解时输出任意一组,不存在时输出“-1”. 数据范围: 1 ≤ n ≤ 100, 2 ≤ t ≤ 10 so easy!首先考虑无解的时候,只有当n==1,t==10是无解,其他情况都存在解.很容易想到最简单的n位数能被t整除的数是,t个n组成的数. 参考代码: By Royecode, contest: Codeforces Ro…
第一次全程参加的CF比赛(虽然过了D题之后就开始干别的去了),人生第一次codeforces上分--(或许之前的比赛如果都参加全程也不会那么惨吧),终于回到了specialist的行列,感动~.虽然最后也只过了A.B.D3题,但能上分还是非常的激动不已呀. 先发出来A.B.D的参考解法,C比赛时读了题感觉自己可以做出来,但时间只剩20分钟了,索性弃疗--. 11.23 补充上了C的参考代码 A题: 题目地址 用一些str函数应该也可以做,但考虑到字符串长度只有不到100以及题目整体不是很复杂,不…
题目地址:http://codeforces.com/contest/493 A题 写完后就交了,然后WA了,又读了一遍题,没找出错误后就开始搞B题了,后来回头重做的时候才发现,球员被红牌罚下场后还可以再出现,但不能再参与计算,这里需要开一个flag数组判重 .打比赛时要调整好心态. #include<cstdio> #include<iostream> #include<string.h> #include<stdlib.h> #include<st…
题目地址:http://codeforces.com/contest/486 A题.Calculating Function 奇偶性判断,简单推导公式. #include<cstdio> #include<iostream> using namespace std; int main() { long long n; cin>>n; ==) { cout<<(-)*((n-)/+)+n<<endl; } else cout<<((n-…
题目地址:http://codeforces.com/contest/485 A题.Factory 模拟.判断是否出现循环,如果出现,肯定不可能. 代码: #include<cstdio> #include<stdbool.h> using namespace std; int main() { int a,m; ]={}; scanf("%d%d",&a,&m); while(true) { ){ printf("Yes\n"…
codeforces 670A. Holidays 题目链接: http://codeforces.com/contest/670/problem/A 题意: A. Holidays On the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings — 5 work days and then 2 days…
题目链接: http://codeforces.com/contest/977 A. Wrong Subtraction 题意 给定一个数x,求n次操作输出.操作规则:10的倍数则除10,否则减1 直接写,手速题,没啥好说的 B. Two-gram 题意 求出现次数最多的连续两个字符 还是签到题,我居然很麻烦地用了map,= =算了,思路畅通都无所谓了 #include <iostream> #include<stdio.h> #include<algorithm> #…
题目链接:http://codeforces.com/contest/1066 1066 A. Vova and Train 题意:Vova想坐火车从1点到L点,在路上v的整数倍的点上分布着灯笼,而在路上从l到r处停着别的火车,它挡着Vova的视线使他看不到灯笼.给定L,v,l,r求Vova能看到的灯笼数. 分析:从1到x上所有的灯笼数量为x/v个.则路上所有的灯笼数为L/v个,被挡住的则为 r/v - (l-1)/v 个,相减即为答案. #include<iostream> #include…
详见:http://robotcator.logdown.com/posts/221514-codeforces-round-262-div-2 1:A. Vasya and Socks   http://codeforces.com/contest/460/problem/A 有n双袜子,每天穿一双然后扔掉.每隔m天买一双新袜子,问最多少天后没有袜子穿. . 简单思维题:曾经不注重这方面的训练,结果做了比較久.这样的题自己边模拟边想.只是要多考虑trick ```c++ int main(){…
题目地址:http://codeforces.com/contest/479 这次自己又仅仅能做出4道题来. A题:Expression 水题. 枚举六种情况求最大值就可以. 代码例如以下: #include <iostream> #include <cstdio> #include <string> #include <cstring> #include <stdlib.h> #include <math.h> #include &…
题目地址:http://codeforces.com/contest/474 A题:Keyboard 模拟水题. 代码例如以下: #include <iostream> #include <cstdio> #include <string> #include <cstring> #include <stdlib.h> #include <math.h> #include <ctype.h> #include <que…
这场CF水题都非常的水,D题如果对树.DFS相关比较熟练的话也不难.比赛时前三题很快就过了,可是因为毕竟经验还是太少,D题就卡住了.比赛之后A题还因为没理解对题意fst了--(为什么这次就没人来hack我orz).唉,本来发挥好一些这次上蓝名是很有可能的,只能等待下一次了.Z神这次顺利AK,差距还是太大,虽然有初学为理由,但这个烤漆之后就会到来的假期还是要好好加油了,要学要练的东西实在是太多了. A题: 如果起点和终点是一家航空公司,那么显然0元就可到达.如果不是,0和1一定有一个分界处,先做起…
本来是打算所有半夜进行的CF都不参加的,但看到这次比赛22:35就开始,还是没有忍住orz--晚上总是不够清醒,做题思维不如白天活跃,低级错误常常出现.出的比较早的C因为一个书写错误有点小bug,在比赛快结束时被hack,还好一下子就发现改正了过来,b题很水,却刚开始没想到合适的做法,也卡了比较久.D题因为刚学到DP,还很不熟练,比赛前没能写完.整体来说这一场实在是表现的菜的一塌糊涂.不过因为现在rating低,还在神奇的上分,算是一点慰藉了. A 题目地址 简要题意: 输入一个整数n,输出13…
题目地址 本次CF是在今天早上深夜进行,上午有课就没有直接参加.今天早上上课坐到后排参加了virtual participation.这次CF前面的题目都非常的水,不到10分钟就轻松过了前两题,比较郁闷的是之后一直卡在C,开始是脑残的没有用二分TLE,后来又是因为一个常数打错而一直WA--于是模拟赛就只过了2道题(太弱了orz).时间到了后很快发现了脑残错误,终于A了C题.下午上完课回到宿舍看D题才发现D题水的不行,很快就A了.不过E和F就比较超出我现在知识范围了,暂时就先放下.第一次参加vir…
Problem A. Nineteen 思路: 除了首位像连的n,其他的字母不能共用nineteenineteen.所以可以扫描一遍所有的字符串将出现次数保存到hash数组,n的次数(n - 1) / 2,e为e / 3.最小值就是min(i, e / 3, t , (n - 1) / 2). #include <cstdio> #include <algorithm> int main() { #ifndef ONLINE_JUDGE freopen("in.txt&q…
又范低级错误! 只做了两题!一道还被HACK了,囧! A:看了很久!应该是到语文题: 代码:#include<iostream> #include<];    ,m2=;    ;i<=n;i++)    {        cin>>a[i];        ) m1++;        ;      ) ans=;      cout<<ans<<endl;      ; } 写的超级垃圾!反正就是乱搞! B题:又是一类构建题!先用SK构建好啊…
A.Mr. Kitayuta, the Treasure Hunter 很显然的一个DP,30000的数据导致使用map+set会超时.题解给了一个非常实用的做法,由于每个点有不超过250种状态,并且这些状态都是以包含d连续的一段数字,那么可以以对d的偏移量作为状态.这算是很常见的一个优化了. #include<bits/stdc++.h> using namespace std; ; ],a[INF]; , x; int main() { scanf ("%d %d",…
D. A Lot of Games time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Andrew, Fedor and Alex are inventive guys. Now they invent the game with strings for two players. Given a group of n non-em…
E. Little Pony and Summer Sun Celebration time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle learnt that the evil Nightmare Moon would return during the upcoming Summer Sun Ce…
A.Middle of the Contest 考虑把输入的时间单位化成分钟,相加除以2就好了 #include<bits/stdc++.h> using namespace std; #define re register #define sys system("pause"); inline int read(){ re ,f=;char c=getchar(); ;c=getchar();} )+(x<<)+(c^),c=getchar(); return…
CF1108A. Two distinct points 做法:模拟 如果两者左端点重合就第二条的左端点++就好,然后输出左端点 #include <bits/stdc++.h> using namespace std; int T; int l1, r1, l2, r2; int main() { scanf("%d", &T); while(T--) { scanf("%d%d%d%d", &l1, &r1, &l2,…
A.Reachable Numbers 题意: 给定操作f(x):将x加1,删去得到的数的所有末尾0,如f(10099)=10099+1=10100→1010→101.现在给定一个数n,对n进行无限次该操作,输出过程中能得到的所有数的数量. 输入:一个正整数n(n≤1e9) 输出:操作过程中得到的所有数数量 限制:1s,256M 样例: input 1098 output 20 样例解释:1098在操作过程中得到的数有:1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17…
A. Currency System in Geraldion: 题意:有n中不同面额的纸币,问用这些纸币所不能加和到的值的最小值. 思路:显然假设这些纸币的最小钱为1的话,它就能够组成随意面额. 假设这些纸币的最小值大于1,那么它所不能组成的最小面额就是1.所以自学求最小值就可以. 我的代码: #include <set> #include <map> #include <cmath> #include <stack> #include <queue…
D. Little Pony and Harmony Chest time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Princess Twilight went to Celestia and Luna's old castle to research the chest from the Elements of Harmony…
前置扯淡 真是神了,我半个小时切前三题(虽然还是很菜) 然后就开始看\(D\),不会: 接着看\(E\),\(dp\)看了半天,交了三次还不行 然后看\(F\):一眼\(LCA\)瞎搞,然后\(15min \space A\)掉 幸亏加时了\(10min\),否则\(F\)题\(AC\)不掉啥没有了 送我自闭,如果先全看一遍,发现\(D\)题和\(E\)题都不可做,直接刚\(F\),新年就上蓝了(然而还是菜) 题目&&解答 A.Collecting Coins link 思路 这水题吧,就…
Codeforces Round#320 Div2 先做个标题党,骗骗访问量,结束后再来写咯. codeforces 579A Raising Bacteria codeforces 579B Finding Team Member codeforces 579C A Problem about Polyline codeforces 579D "Or" Game codeforces 579E Weakness and Poorness codeforces 579F LCS Aga…