Codeforces Round #328 (Div. 2) C 数学】的更多相关文章

C. The Big Race time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vector Willman and Array Bolt are the two most famous athletes of Byteforces. They are going to compete in a race with a dist…
C. The Big Race Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/592/problem/C Description Vector Willman and Array Bolt are the two most famous athletes of Byteforces. They are going to compete in a race with a distance of…
B. The Monster and the Squirrel Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/592/problem/B Description Ari the monster always wakes up very early with the first ray of the sun and the first thing she does is feeding her…
这场CF,准备充足,回寝室洗了澡,睡了一觉,可结果...   水 A - PawnChess 第一次忘记判断相等时A先走算A赢,hack掉.后来才知道自己的代码写错了(摔 for (int i=1; i<=8; ++i) { scanf ("%s", s[i]); //!!! } 数学(找规律) B - The Monster and the Squirrel 题意:多边形每个顶点向其它的点引射线,如果碰到其他射线则停止,问最后多边形被分成多少个区域 分析:搬题解: Proble…
题目链接: http://codeforces.com/contest/592/problem/D 题意: 给你一颗树,树上有一些必须访问的节点,你可以任选一个起点,依次访问所有的必须访问的节点,使总路程最短. 题解: 由于是树,任意两点间路径唯一,是确定的. 首先我们要先建一颗树:包括所有必须访问的节点,已经它们之间的路径. 我们选的起点一定是某个必须访问的节点,如果我们把所有的必须访问的节点访问一遍并且回到起点,那么我们用的最小花费就是边数*2(这个可以用反证法证明),所以只要我们找出新树的…
D. Super M Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/592/problem/D Description Ari the monster is not an ordinary monster. She is the hidden identity of Super M, the Byteforces’ superhero. Byteforces is a country that…
A. PawnChess Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/592/problem/A Description Galois is one of the strongest chess players of Byteforces. He has even invented a new variant of chess, which he named «PawnChess». Thi…
http://codeforces.com/contest/716/problem/C 题目大意:感觉这道题还是好懂得吧. 思路:不断的通过列式子的出来了.首先我们定义level=i, uplevel = i + 1,目前的uplevel,然后我们可以知道,之前求出来的restgrade%level = 0,于是我们可以列出一个式子sqrt(k1 * i + grade) = uplevel * k.因为grade也是i的倍数,假定grade = k2 * i,所以我们写成sqrt((k1 +…
题目: Little C loves number «3» very much. He loves all things about it. Now he has a positive integer nn. He wants to split nn into 3 positive integers a,b,ca,b,c, such that a+b+c=na+b+c=n and none of the 3 integers is a multiple of 3. Help him to fin…
https://codeforces.com/contest/1143/problem/D 题意 有nk个城市,第1,k+1,2k+1,...,(n-1)k+1城市有餐厅,你每次能走l距离,a为起始位置离最近餐厅的距离,b为走了一次后离最近餐厅的距离,给出n,k,a,b,求你回到起点最少和最多停留次数 题解 \(yl=xnk,有y=xnk/l,即y=lcm(xnk,l)/l\) 枚举a(两种情况),b(两种情况),维护最大,最小值 代码 #include<bits/stdc++.h> #def…
B. The Monster and the Squirrel time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ari the monster always wakes up very early with the first ray of the sun and the first thing she does is feed…
A. PawnChess time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Galois is one of the strongest chess players of Byteforces. He has even invented a new variant of chess, which he named «PawnChe…
D. Multipliers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ayrat has number n, represented as it's prime factorization pi of size m, i.e. n = p1·p2·...·pm. Ayrat got secret information…
题目: Mr. F has nn positive integers, a1,a2,…,an. He thinks the greatest common divisor of these integers is too small. So he wants to enlarge it by removing some of the integers. But this problem is too simple for him, so he does not want to do it by…
题目: There are nn points on the plane, (x1,y1),(x2,y2),…,(xn,yn)(x1,y1),(x2,y2),…,(xn,yn). You need to place an isosceles triangle with two sides on the coordinate axis to cover all points (a point is covered if it lies inside the triangle or on the s…
A. PawnChess time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Galois is one of the strongest chess players of Byteforces. He has even invented a new variant of chess, which he named «PawnChe…
B. The Monster and the Squirrel time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ari the monster always wakes up very early with the first ray of the sun and the first thing she does is feed…
D. As Fast As Possible time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output On vacations n pupils decided to go on excursion and gather all together. They need to overcome the path with the leng…
题目链接: A:Ostap and Grasshopper B:Urbanization C:Tennis Championship D:Taxes 分析:这场第一二题模拟,三四题数学题 A. 直接模拟即可 B. 排序从大到小取n1个数到城市1,n2个数到城市二,n1<=n2 C. 递推.斐波拉契数列 dp[i] 表示赢i场比赛需要多少人, 则 dp[0] = 1,dp[1] = 2,dp[3] = dp[1] +dp[0],  dp[ans] = dp[ans-1] + dp[ans-2]一次…
题目传送门 /* 贪心/数学:还以为是BFS,其实x1 + 4 * k = x2, y1 + 4 * l = y2 */ #include <cstdio> #include <algorithm> #include <cstring> using namespace std; ; const int INF = 0x3f3f3f3f; char s[MAXN][MAXN]; int main(void) //Codeforces Round #212 (Div. 2)…
题目传送门 /* 数学/暴力:只要一个数的最后三位能被8整除,那么它就是答案:用到sprintf把数字转移成字符读入 */ #include <cstdio> #include <algorithm> #include <cstring> #include <iostream> #include <cmath> #include <vector> using namespace std; ; const int INF = 0x3f3…
题目传送门 /* 题意:这题就是求b+1到a的因子个数和. 数学+DP:a[i]保存i的最小因子,dp[i] = dp[i/a[i]] +1;再来一个前缀和 */ /************************************************ Author :Running_Time Created Time :2015-8-1 14:08:34 File Name :B.cpp ************************************************…
题目传送门 /* 数学:这题一直WA在13组上,看了数据才知道是计算cost时超long long了 另外不足一个区间的直接计算个数就可以了 */ #include <cstdio> #include <cmath> #include <iostream> #include <algorithm> #include <cstring> using namespace std; typedef unsigned long long ull; int…
Pythagorean Triples 题目链接: http://codeforces.com/contest/707/problem/C Description Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positive integers such th…
题目传送门 /* 水题:求总数字个数,开long long竟然莫名其妙WA了几次,也没改啥又对了:) */ #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <cmath> #include <vector> #include <string> #include <queue> #incl…
Codeforces Round #622 (Div. 2) B. Different Rules 题意: 你在参加一个比赛,最终按两场分赛的排名之和排名,每场分赛中不存在名次并列,给出参赛人数 n 和你两场分赛的排名 x, y,问你最终名次最小和最大可能是多少. 思路: 以8人为例: x + y = 2,最小第一名,最大第一名:               1 2 3 4 5 6 7 8 8 7 6 5 4 3 2 1               x + y = 3,最小第一名,最大第二名.…
 cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....       其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/output 1 s, 256 MB  x2377 B Queue standard input/output 2 s, 256 MB  x1250 C Hacking Cypher standard input/output 1 s, 256 MB  x740 D Chocolate standard in…
---恢复内容开始--- 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…
今天老师(orz sansirowaltz)让我们做了很久之前的一场Codeforces Round #257 (Div. 1),这里给出A~C的题解,对应DIV2的C~E. A.Jzzhu and Chocolate time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Jzzhu has a big rectangular cho…