AT2386 Colorful Hats (乱搞题,思维题)】的更多相关文章

分情况讨论的神题... max不等于min + 1 或者不等于min,这种情况显然不存在. 如果都等于一个数 有两种情况: 互相独立,那么a[i]肯定==n-1 有相同的,那么a[i]一定不是独立的. 那么就会有a[i]即为出现颜色的总个数. 因为又不是独立的.所以每种颜色至少出现两次. 所以满足\(2 * a[i] <= n\)即可. 继续分析,如果max == min + 1的情况. n : 人数 一个点至少能看到有max - 1种颜色. max : 能看到最多的颜色. (总颜色) max…
第一次做交互真有趣……:挺好的细节思维题 This is an interactive problem. In good old times dwarves tried to develop extrasensory abilities: Exactly n dwarves entered completely dark cave. Each dwarf received a hat — white or black. While in cave, none of the dwarves was…
题目链接:https://codeforces.com/contest/1137/problem/D 题意: 交互题. 给定如下一个有向图: 现在十个人各有一枚棋子(编号 $0 \sim 9$),在不知道 $t,c$ 的值的情况下,他们同时从home出发,要最终到达flag处. 你只能选择移动哪几个人的棋子,但棋子移动到哪里由程序确定并给出. 题解: 看网上大佬一个神仙解法……看得我一愣一愣的…… 选定两颗棋子,第一颗每次都移动,第二颗隔一次移动一次.所以,进行了 $2t$ 次之后第二颗棋子刚好…
题目链接 Description Final Pan likes prime numbers very much. One day, he want to find the super prime numbers.A prime numbers $n$($n$>4) is a super prime number only if $n$-4 and $n$+4 are both prime numbers,too. Your task is really easy:Give $N$,find t…
4148: [AMPPZ2014]Pillars Time Limit: 5 Sec  Memory Limit: 256 MBSec  Special JudgeSubmit: 100  Solved: 49 Description 给定一个n*m的矩形,其中有f个2*2的障碍物,其中任意两个障碍物中心之间的欧几里得距离至少为6, 且每个障碍物的中心到边缘的距离至少为3.请找到一条从左下角(1,1)出发经过所有没有障碍物的点各 一次的且最后回到左下角的回路. Input 第一行包含三个整数n,…
[BZOJ5288][HNOI2018]游戏(乱搞?) 题面 BZOJ 洛谷 题面自己到洛谷上看把 题解 考场上乱搞拿到了\(90\)分,简直不敢相信. 回家把代码再交了一份直接就\(AC\)了??? \(O(n^2)\)的做法应该很容易想 对于每个点作为起点,暴力向左右两侧拓展, 看看它能够到达的区间就行了. 考虑怎么优化一下,发现如果拓展的时候走到了一个已经拓展完的节点 那么一定能够到达这个点能够到达的左右位置 因此,直接沿着当前点能够到达的最远左右位置跳跃一下, 中间就不用计算了. 我们发…
题目链接:http://codeforces.com/problemset/problem/402/C /**算法分析: 乱搞题,不明白题目想考什么 */ #include<bits/stdc++.h> #define MAXN 1050 #define PI acos(-1.0) #define REP(i,n) for(int i=0; i<n; i++) #define FOR(i,s,t) for(int i=s; i<=t; i++) #define mem(a,b) m…
题目描述 给出一个长度为 $m$ 的序列 $a$ ,编号为 $a_1\sim a_m$,其中 $n$ 个位置的数已经确定,剩下的位置的数可以任意指定.现在令 $b$ 表示 $a$ 的前缀异或和,求 $\sum\limits_{i=1}^mb_i$ 的最小值. 输入 输入第一行两个非负整数n,m,分别表示原始序列a的长度及剩余元素的个数. 之后m行,每行2个数i,ai,表示一个剩余元素的位置和数值. 1<=N<=10^9,0<=M<=Min(n,10^5),0<=ai<=…
Rounders Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7697   Accepted: 4984 Description For a given number, if greater than ten, round it to the nearest ten, then (if that result is greater than 100) take the result and round it to th…
题目链接: C. Bear and Up-Down time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The life goes up and down, just like nice sequences. Sequence t1, t2, ..., tn is called nice if the following two…