规律
nike0good
这个作者很懒,什么都没留下…
展开
-
CF 196B(Psychos in a Line-单调队列贪心)
B. Psychos in a Linetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n psychos standing in a line.原创 2013-06-24 10:01:51 · 2184 阅读 · 0 评论 -
CF 319A(Malek Dance Club-枚举Xor最高位)
C. Malek Dance Clubtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs a tradition, every year before IOI al原创 2013-06-24 08:31:34 · 2510 阅读 · 0 评论 -
CF 2013-2014CTS01E04(Arrangement of RGB Balls-RGBRGB..)
典型的观察题。在纸上试一下,易发现序列一定是RGBRGB..这样的循环序列T=3因此特判即可。Prov:假设第i-2,i-1位已知,则第i位确定。∴序列仅与前2位有关#include#include#include#include#include#include#include#include#include#includeusing nam原创 2013-10-09 21:13:15 · 1383 阅读 · 0 评论 -
TC Member SRM 478 DIV 1(CarrotJumping-操作观察)
Problem Statement Rabbits often feel hungry, so when they go out to eat carrots, they jump as quickly as possible.Initially, rabbit Hanako stands at position init. From position x, she原创 2014-07-02 13:00:15 · 1375 阅读 · 0 评论 -
BZOJ 3101(N皇后-N皇后O(n)构造一组解的方法)
3101: N皇后Time Limit: 10 Sec Memory Limit: 128 MBSec Special JudgeSubmit: 70 Solved: 32[Submit][Status]Descriptionn*n的棋盘,在上面摆下n个皇后,使其两两间不能相互攻击…Input一个数nOutput原创 2014-11-11 08:53:38 · 2747 阅读 · 0 评论 -
XJTU Summer Holiday Test 1(Divisibility by Eight-8的倍数)
C - Divisibility by EightTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionYou are given a non-negative integer n, its decimal re原创 2015-07-12 17:41:42 · 1474 阅读 · 0 评论 -
BZOJ 1258([CQOI2007]三角形tri-模拟)
1258: [CQOI2007]三角形triTime Limit: 5 Sec Memory Limit: 162 MBSubmit: 287 Solved: 165[Submit][Status][Discuss]Description画一个等边三角形,把三边的中点连接起来,得到四个三角形,把它们称为T1,T2,T3,T4,如图1。把前三个三角形也这样划分,得到12个原创 2015-09-02 20:58:09 · 863 阅读 · 0 评论 -
BZOJ 4401(块的计数-树的划分)
已知一棵树,请把它划分成k份,使得每个块中的点数都相同。求方案数。首先有2个结论一棵树划分成k份的方案是唯一的(但可以不存在)一棵树可以划分成k份,当且仅当有k个子节点的子树大小是n/k的倍数#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n原创 2016-03-28 20:07:26 · 834 阅读 · 0 评论 -
UOJ #278(【UTR #2】题目排列顺序-找规律)
有nn个数1…n1\dots n,求出一个排列,使序列中位置第i个数结尾的最长递增序列长度为aia_i,n≤105n\le10^5找规律后发现只要把以aia_i的权值为第一关键字升序,下标为第二关键字逆序,即可。#include<bits/stdc++.h> using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fo原创 2017-01-14 19:59:52 · 355 阅读 · 0 评论