Sereja and Coat Rack(水)】的更多相关文章

Sereja and Coat Rack Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Description Sereja owns a restaurant for n people. The restaurant hall has a coat rack with n hooks. Each restaurant visitor can use a ho…
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n,d; cin >> n >>d; vector<int>a(n); ; i < n ; ++ i ) cin >>a[i]; int m; cin >> m; sort(a.begin(),a.end()); ;…
题目链接: B. Coat of Anticubism time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output   As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane…
题目背景 警告:滥用本题评测者将被封号 We could have had it all. . . . . . 我们本该,拥有一切 Counting on a tree. . . . . . 何至于此,数数树上 Counting on a Tree(CoaT)即是本题的英文名称. 题目描述 Access Globe 最近正在玩一款战略游戏.在游戏中,他操控的角色是一名C 国士 兵.他的任务就是服从指挥官的指令参加战斗,并在战斗中取胜. C 国即将向D 国发动一场秘密袭击.作战计划是这样的:选择D…
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3049    Accepted Submission(s): 2364 Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of…
总时间限制:  1000ms 内存限制:  65536kB 描述 任意输入两个正整数m, n (1 < m < n <= 5000),依次输出m到n之间每个数的最大质因子(包括m和n:如果某个数本身是质数,则输出这个数自身). 输入 一行,包含两个正整数m和n,其间以单个空格间隔. 输出 一行,每个整数的最大质因子,以逗号间隔. 样例输入 5 10 样例输出 5,3,7,2,3,5 还是水题.. 查看 #include <iostream> #include <cstr…
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a containe…
炎炎夏日,还是呆在空调房里切切题吧. Container With Most Water,题意其实有点噱头,简化下就是,给一个数组,恩,就叫 height 吧,从中任选两项 i 和 j(i <= j),使得 Math.min(height[i], height[j]) * (j - i) 最大化,求解这个最大值. O(n^2) O(n^2) 复杂度的解法非常容易想到,直接两两枚举. var maxArea = function(height) { var len = height.length;…
Codeforces-566F 题目大意:给出一个有序数列a,这个数列中每两个数,如果满足一个数能整除另一个数,则这两个数中间是有一条边的,现在有这样的图,求最大联通子图. 题解:并不需要把图搞出来,可以直接dp,$f[i]$表示以第$i$个数为开头的最大的联通子图,转移类似最长上升子序列,$f[i]=max(f[i],f[j]+1)$ Code: #include<iostream> #include<cstdio> #include<algorithm> #incl…
Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 132  Solved: 75 Description 水叮当得到了一块五颜六色的格子形地毯作为生日礼物,更加特别的是,地毯上格子的颜色还能随着踩踏而改变.为了讨好她的偶像虹猫,水叮当决定在地毯上跳一支轻盈的舞来卖萌~~~地毯上的格子有N行N列,每个格子用一个0~5之间的数字代表它的颜色.水叮当可以随意选择一个0~5之间的颜色,然后轻轻地跳动一步,左上角的格子所在的联通块里的所有格子就会变成她选择的那…