[atARC102F]Revenge of BBuBBBlesort】的更多相关文章

定义以$i$为中心(交换$p_{i-1}$和$p_{i+1}$)的操作为操作$i$ 结论1:若执行过操作$i$,则之后任意时刻都无法执行操作$i-1$或操作$i+1$ 当执行操作$i$后,必然有$p_{i-1}<p_{i}$,然后不妨假设下一次与$i$相邻的操作为$i-1$($i+1$类似) 操作$i-1$的条件为$p_{i-2}>p_{i-1}>p_{i}$,即要增大$p_{i-1}$或减小$p_{i}$,可以执行操作$i-2$或操作$i+1$,后者根据假设不成立 对于操作$i-2$,…
Choosing Points 数学 Integers on a Tree 构造 Leftmost Ball 计数dp+组合数学 Painting Graphs with AtCoDeer tarjan+polya Building Cubes with AtCoDeer 枚举 AtCoDeer and Election Report 贪心 Snuke's Coloring 思维题 Snuke's Coloring 2 线段树+单调栈 Make Them Even 贪心 1D Reversi 模…
C - Triangular Relationship 题解 枚举一个数%K的值然后统计另两个 代码 #include <bits/stdc++.h> #define enter putchar('\n') #define space putchar(' ') #define pii pair<int,int> #define fi first #define se second #define MAXN 200005 #define pb push_back //#define…
比赛传送门 T1 Triangular Relationship 分析之后发现有两种情况: 1. n为奇数,那么所有数都是k的倍数. 2. n为偶数,那么所有数都是k/2的倍数. 然后就可以愉快A题了. 代码: #include<bits/stdc++.h> #define N 200005 #define ll long long using namespace std; inline ll read(){ ll ans=0; char ch=getchar(); while(!isdigi…
AtCoder Regular Contest 102 C - Triangular Relationship 题意: 给出n,k求有多少个不大于n的三元组,使其中两两数字的和都是k的倍数,数字可以重复. 分析: 思考什么样的三个数可以满足这样的要求,当然这三个数都是k的倍数的时候是可以满足的,还有就是这三个数在d对k取模之后都等于k/2也应该是可以的.直接枚举这样的数就可以了. #include <cstring> #include <cstdio> #include <a…
Lost's revenge Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 2262    Accepted Submission(s): 565 Problem Description Lost and AekdyCoin are friends. They always play "number game"(A bori…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5019 Problem Description In mathematics, the greatest common divisor (gcd), also known as the greatest common factor (gcf), highest common factor (hcf), or greatest common measure (gcm), of two or more i…
Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status Practice UVA 816 Appoint description:   Description  Abbott’s Revenge  The 1999 World Finals Contest included a problem based on a “dice maze.” At the time the probl…
最近手感有点差,所以做点水题来锻炼一下信心. 下周的南京区域赛估计就是我的退役赛了,bless all. Revenge of Fibonacci Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 204800/204800 K (Java/Others)Total Submission(s): 1582    Accepted Submission(s): 356 Problem Description The well-know…
Revenge of Nim II Problem DescriptionNim is a mathematical game of strategy in which two players take turns removing objects from distinct heaps. On each turn, a player must remove at least one object, and may remove any number of objects provided th…