#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 ++ ){…
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…
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…
题目:http://codeforces.com/contest/389/problem/C 题意:给n个箱子,给n个箱子所能承受的重量,每个箱子的重量为1: 很简单的贪心,比赛的时候没想出来...... 先从小到大排一下序,然后从最上层向下找,只要能承受住重量就行.而且因为已经排序了找的都是尽量小的... #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib>…
链接:http://codeforces.com/problemset/problem/388/B [题意] 给出一个整数K,构造出刚好含有K条从1到2的最短路的图. [分析] 由于是要自己构造图,当然构造的方法很多了,需要考虑简单性和可行性.出于简单考虑,图中从1到2的所有路径都是最短路,为了保证路径长度一样,在构图时就需要分层次,使得每一层的点距离上一层的点的距离都是一个单位. 那么如何使得路径条数刚好为K呢,这里涉及到相邻层次的点的链接方式.比如说每个点和上一层的所有点都有链接,那么这样总…
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…
#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++)    …
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…