CF844 C 置换 水】的更多相关文章

由于每个数字只出现一次,离散化一下,置换求个循环节就好了. /** @Date : 2017-08-25 01:39:39 * @FileName: C.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https://github.com/ * @Version : $Id$ */ #include <bits/stdc++.h> #define LL long long #define…
http://blog.csdn.net/a3070173/archive/2008/11/20/3342062.aspx Dislace Mapping其实就是在顶点着色器中 对顶点进行置换偏移,经常用于水仿真流体绘制. 顶点着色器: uniform float g_fScale; uniform sampler2D g_DisplaceTexture; void main() { float fDisplace = texture2DLod(g_DisplaceTexture, gl_Mul…
Problem A: 回文 Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 1719  Solved: 528 Description 小王想知道一个字符串是否为ABA’型字符串.ABA’型字符串的定义:S=ABA’,A,B,A’都是原字符串的子串(不能是空串),A’的意思是A的反转串,B不一定要和A或A’不同.符合ABA’型的例如:"aba”,"acbbca”,"abcefgcba”等."Abcefgcba”是ABA…
为什么是水题选做呢?因为我只会水题啊 ( 为什么是$Atcoder$呢?因为暑假学长来讲课的时候讲了三件事:不要用洛谷,不要用dev-c++,不要用单步调试.$bzoj$太难了,$Topcoder$整了好久没学会用,中国人要长期打$codeforces$那作息简直反人类,所以就选到$atcoder$啦.而且$AT$的英语感觉比较好懂,或许是因为都是亚洲人,思维比较同步? 那么哪些题目会被放到这个地方呢?$ABC$的后两题,也就是$ARC$的前两题(如果同时举办的话).至于$ARC$的后两题以及$…
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…
Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: get and put. get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.pu…
Given a string that consists of only uppercase English letters, you can replace any letter in the string with another letter at most k times. Find the length of a longest substring containing all repeating letters you can get after performing the abo…
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;…