CF Educational Codeforces Round 57划水记】的更多相关文章

因为是unrated于是就叫划水记了,而且本场也就用了1h左右. A.B:划水去了,没做 C:大水题,根据初三课本中圆的知识,可以把角度化成弧长,而这是正多边形,所以又可以化成边数,于是假设读入为a,就是周长的a/180,gcd一下就行了,注意如果a/b这个分数满足a+1=b,那么就要ans*=2 #include<bits/stdc++.h> using namespace std; int main() { int T;scanf("%d",&T); while…
又被虐了... (记一次惨痛的Codeforces) 好不容易登上去了Codeforces,22:35准时开打 第一题,一看:这不SB题嘛?直接枚举因数上啊.9min才过掉了pretest 第二题... ... 什么鬼东西??? 写了个网络流上去 TLE 看来我还是太天真了 第三题呢? 貌似是个dp,不会... 剩下的没心情看了...然后老妈催我睡觉. 于是我一觉睡到了七八点 躺床上,我不甘心又去想B题,发现好像...直接贪心模拟可做!!! 立马爬了起来去码,测样例才发现刚刚想的做法没有考虑到每…
题目链接:http://codeforces.com/problemset/problem/652/D 大意:给若干个线段,保证线段端点不重合,问每个线段内部包含了多少个线段. 方法是对所有线段的端点值离散化,按照左端点从大到小排序,顺着这个顺序处理所有线段,那么满足在它内部的线段一定是之前已经扫到过的.用树状数组判断有多少是在右端点范围内. #include <iostream> #include <vector> #include <algorithm> #incl…
题目链接:http://codeforces.com/problemset/problem/609/E 大致就是有一棵树,对于每一条边,询问包含这条边,最小的一个生成树的权值. 做法就是先求一次最小生成树,标记最小生成树上的边,对于这些边,直接就是原始最小生成树.否则必然可以在去掉u到v路径上最长边,再加上边u->v,这一定是包含此边最小的生成树. 查询最长边,可以用树链剖分,也可以树上倍增. #include <iostream> #include <vector> #in…
我好菜啊. A - Find Divisible 好像没什么可说的. #include<cstdio> #include<cstring> #include<algorithm> #include<queue> #include<set> #include<map> #include<vector> #include<cmath> #include<cctype> using namespace s…
题目总链接:https://codeforces.com/contest/1096 A. Find Divisible 题意: 给出l,r,在[l,r]里面找两个数x,y,使得y%x==0,保证有解. 题解: 直接输出l,2*l就好啦,但我还是写了个循环... 代码如下: #include <bits/stdc++.h> using namespace std; typedef long long ll; ; int T; ll l,r; int main(){ cin>>T; w…
https://codeforces.com/contest/1096/problem/D 题意 给一个串s,删掉一个字符的代价为a[i],问使得s的子串不含"hard"的最小代价 题解 定义\(dp[i][j]\)为到第i位下一个将要匹配j的最小代价 \(若s[i]==t[j]\) 删掉:\(min(dp[i+1][j],dp[i][j]+a[i])\) 不删,若j<3:\(min(dp[i+1][j+1],dp[i][j])\) \(若s[i]!=t[j]\) 不用删:\(m…
https://codeforces.com/contest/1096/problem/C 题意 问是否存在一正多边形内三点构成的角度数为ang,若存在输出最小边数 题解 三点构成的角是个圆周角,假设n为多边形边数,则能构成的角范围是\(\frac{180}{n} \leq ang \leq \frac{n-2}{n}*180\),每次变化\(\frac{180}{n}\) 首先明确正多边形一定存在,并且最大边数不会超过360,若边数等于360,则可以组成的角的范围是\(0.5\leq ang…
2018.12.28  22:30 看着CF升高的曲线,摸了摸自己的头发,我以为我变强了,直到这一场Edu搞醒了我.. 从即将进入2018年末开始,开启自闭场集合,以纪念(dian)那些丢掉的头发 留坑睡觉..明天看题解再补 A.Find Divisible 题意:输出[l,r]中满足x|y的x,y,保证有解 思路:直接输出x, 2x即可 #include<iostream> #include<cstdio> #include<algorithm> #include&l…
F. Frogs and mosquitoes time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output There are n frogs sitting on the coordinate axis Ox. For each frog two values xi, ti are known — the position and th…
E. Minimum spanning tree for each edge time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Connected undirected weighted graph without self-loops and multiple edges is given. Graph contains n …
D. Gadgets for dollars and pounds time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Nura wants to buy k gadgets. She has only s burles for that. She can buy each gadget for dollars or for po…
C. Load Balancing time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output In the school computer room there are n servers which are responsible for processing several computing tasks. You know the…
B. The Best Gift time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Emily's birthday is next week and Jack has decided to buy a present for her. He knows she loves books so he goes to the loc…
A. USB Flash Drives time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Sean is trying to save a large file to a USB flash drive. He has n USB flash drives with capacities equal to a1, a2, ...…
传送门 Div 2的比赛,前四题还有那么多人过,应该是SB题,就不讲了. 这场比赛一堆计数题,很舒服.(虽然我没打) E. The Top Scorer 其实这题也不难,不知道为什么这么少人过. 考虑枚举那人的分数和有多少人和他同分,推一下就会发现我们只需要知道\(calc(sum,n,top)\)表示\(sum\)分,分给\(n\)个人,分数小于\(top\),的方案数. 好像不是很好直接搞,考虑容斥,枚举一下至少有几个人不满足条件即可. #include<bits/stdc++.h> na…
A.Find Divisible 沙比题 显然l和2*l可以直接满足条件. 代码 #include<iostream> #include<cctype> #include<cstdio> #include<cstring> #include<string> #include<cmath> #include<ctime> #include<cstdlib> #include<algorithm> #d…
A. Find Divisible 签到. #include <bits/stdc++.h> using namespace std; int t, l, r; int main() { scanf("%d", &t); while (t--) { scanf("%d%d", &l, &r); printf(); } ; } B. Substring Removal 签到. #include <bits/stdc++.h&g…
#include<bits/stdc++.h>using namespace std;char s[100007];long long a[100007];long long dp[100007][4];int main(){    int n;    scanf("%d",&n);    scanf("%s",s);    for(int i=0;i<n;i++)        scanf("%lld",&a[…
A. Lucky Year time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Apart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lu…
感慨 最终就做出来一个题,第二题差一点公式想错了,又是一波掉分,不过我相信我一定能爬上去的 A Find Divisible(思维) 上来就T了,后来直接想到了题解的O(1)解法,直接输出左边界和左边界*2即可 代码 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long x,y,t; cin>>t;…
人生第二场codeforces.然而遇上了Education场这种东西 Educational Codeforces Round 40 下午先在家里睡了波觉,起来离开场还有10分钟. 但是突然想起来还没报名呢,并且电脑又是开机黑屏什么情况 莫非为之后的凉凉埋下了伏笔? 比赛之前联系了下余翱和叶可禾,似乎都要去切题的样子? 想到第一次有人一起打CF还是有点小激动的.于是果断屏蔽余翱QQ上的刷屏去看A题了. A. Diagonal Walking 非常仔细地把题读了一遍,然后……啥这不是字符串入门题…
[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…
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 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 71 (Rated for Div. 2)-E. XOR Guessing-交互题 [Problem Description] ​ 总共两次询问,每次询问给出\(100\)个不同的数,评测系统对于每次询问,随机从\(100\)个数中选择一个数\(a\),返回\(x\oplus a\).让你通过两次返回的值猜出\(x\)值是多少.要求两次询问的\(200\)个数互不相同,且题目保证\(x\)值固定不变. [Solution] ​ 题目要求所…
UPD:变色了!!!历史最高1618~ Educational Codeforces Round 81 (Rated for Div. 2) The 2019 University of Jordan Collegiate Programming Contest   充实的一天,打两场可还行.补的一些题记录一下. edu81 Educational Codeforces Round 81 (Rated for Div. 2) 还不知道上分还是掉分,还挺可惜的,被B卡了没做出来,C也调了一会儿答案…
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]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…