A. Fox and Box Accumulation 题目连接: http://codeforces.com/contest/388/problem/A Description Fox Ciel has n boxes in her room. They have the same size and weight, but they might have different strength. The i-th box can hold at most xi boxes on its top…
C. Fox and Box Accumulation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Fox Ciel has n boxes in her room. They have the same size and weight, but they might have different strength. The…
题目:http://codeforces.com/contest/389/problem/C 题意:给n个箱子,给n个箱子所能承受的重量,每个箱子的重量为1: 很简单的贪心,比赛的时候没想出来...... 先从小到大排一下序,然后从最上层向下找,只要能承受住重量就行.而且因为已经排序了找的都是尽量小的... #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib>…
C. Fox and Card Game 题目连接: http://codeforces.com/contest/388/problem/C Description Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns…
B. Fox and Minimal path 题目连接: http://codeforces.com/contest/388/problem/B Description Fox Ciel wants to write a task for a programming contest. The task is: "You are given a simple undirected graph with n vertexes. Each its edge has unit length. You…
链接:http://codeforces.com/problemset/problem/388/B [题意] 给出一个整数K,构造出刚好含有K条从1到2的最短路的图. [分析] 由于是要自己构造图,当然构造的方法很多了,需要考虑简单性和可行性.出于简单考虑,图中从1到2的所有路径都是最短路,为了保证路径长度一样,在构图时就需要分层次,使得每一层的点距离上一层的点的距离都是一个单位. 那么如何使得路径条数刚好为K呢,这里涉及到相邻层次的点的链接方式.比如说每个点和上一层的所有点都有链接,那么这样总…
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main(){ int n; cin >> n; vector<string> board(n); ; ; i < n; ++ i ){ cin >> board[i]; } ; i < n-; i ++ ){…
#include <iostream> #include <algorithm> #include <vector> #include <numeric> using namespace std; int main(){ int n; cin >> n; vector<); ; i < n; ++ i ){ cin >> x[i]; } bool flag = true; while(flag){ flag = false…
做codeforces以来题目最水的一次 A题: Fox and Number Game 题意:就是用一堆数字来回减,直到减到最小值为止,再把所有最小值加,求这个值 sol: 简单数论题目,直接求所有数字的最大公约数即可 ps: 以前cf出过这道题目啊,出题人没救了 5分钟300人过  ; ? a : gcd(b,a%b);  }   {           )      {          ;i<n;i++) scanf(         ];          ;i<n;i++)    …
A. Fox and Box Accumulation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Fox Ciel has n boxes in her room. They have the same size and weight, but they might have different strength. The…
D. Fox And Jumping 题目连接: http://codeforces.com/contest/510/problem/D Description Fox Ciel is playing a game. In this game there is an infinite long tape with cells indexed by integers (positive, negative and zero). At the beginning she is standing at…
C. Fox And Names 题目连接: http://codeforces.com/contest/510/problem/C Description Fox Ciel is going to publish a paper on FOCS (Foxes Operated Computer Systems, pronounce: "Fox"). She heard a rumor: the authors list on the paper is always sorted in…
B. Fox And Two Dots 题目连接: http://codeforces.com/contest/510/problem/B Description Fox Ciel is playing a mobile puzzle game called "Two Dots". The basic levels are played on a board of size n × m cells, like this: Each cell contains a dot that ha…
A. Fox And Snake 题目连接: http://codeforces.com/contest/510/problem/A Description Fox Ciel starts to learn programming. The first task is drawing a fox! However, that turns out to be too hard for a beginner, so she decides to draw a snake instead. A sna…
E. Fox And Dinner time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Fox Ciel is participating in a party in Prime Kingdom. There are n foxes there (include Fox Ciel). The i-th fox is ai year…
B. Fox and Minimal path time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Fox Ciel wants to write a task for a programming contest. The task is: "You are given a simple undirected graph with …
B. Fox Dividing Cheese time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Two little greedy bears have found two pieces of cheese in the forest of weight a and b grams, correspondingly. The be…
今天学长给我们挂了一套Div.1的题,难受,好难啊. Problem A: 题目大意:给你n个数字,让你叠成n堆,每个数字上面的数的个数不能超过这个数,如 3 上面最多放三个数字 问你,最少能放几堆. 刚开始看错题意,以为只要比这个数字小的数都能放上去,后来看清了题意,一直想的是怎么从下往上放,感觉 二分加贪心可以做,但是太麻烦了,后来想如果从上往下放就好做多了,每次从小的开取,这样到取下一个数的 时候就知道上面有多少,能不能取这个数,这样的话也能保证这一堆是最优的. #include<bits…
http://codeforces.com/problemset/problem/510/B #include "cstdio" #include "cstring" int r,c; ][]; ][]; int mark; ]={,-,,},dy[]={,,,-}; int judge(int x,int y) { ||x>=r||y<||y>=c) ; ; } void dfs(int x,int y,int perX,int perY) {…
题目传送门 /* DFS:每个点四处寻找,判断是否与前面的颜色相同,当走到已走过的表示成一个环 */ #include <cstdio> #include <iostream> #include <cstring> #include <string> #include <map> #include <algorithm> #include <vector> #include <set> #include <…
题目传送门 /* 水题 找规律输出 */ #include <cstdio> #include <iostream> #include <cstring> #include <string> #include <map> #include <algorithm> #include <vector> #include <set> #include <cmath> using namespace std…
题目传送门 /* 给出n个字符串,求是否有一个“字典序”使得n个字符串是从小到大排序 拓扑排序 详细解释:http://www.2cto.com/kf/201502/374966.html */ #include <cstdio> #include <iostream> #include <cstring> #include <string> #include <map> #include <algorithm> #include &…
嘎嘎,今天被一些事耽误了,可是还是A了几个题目,这道题还不错 题目链接: 题意:两个人玩游戏,有N堆纸牌,纸牌上有数字,A每次仅仅能取N堆中的 当中一个的顶部的 纸牌,B仅仅能取N堆中的当中一个底部 的纸牌,A.B都想让自己取的和最大,问最后比分为多少 画了一下.假设某一堆里的 纸牌数量为偶数,发现事实上是两个人各分一半,由于假设对方想从这里拿走本来属于自己那半部分的 较大的牌,自己全然来得及阻止的, 接下来就是奇数了,奇数 事实上先手者就抢到了中间的一张牌.另外两半还是各自一半,所以 应该以每…
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…
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输出”#Color”,如果只有”G”,”B”,”W”就输出”#Black&White”. #include <cstdio> #include <cstring> using namespace std; const int maxn = 200; const int INF =…
 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 #262 (Div. 2) 1003 C. Present time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little beaver is a beginner programmer, so informatics is his favorite subject. Soon his info…
Codeforces Round #262 (Div. 2) 1004 D. Little Victor and Set time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Victor adores the sets theory. Let us remind you that a set is a group of…