摘要: 异或用法(转) 转自:https://www.lijinma.com/blog/2014/05/29/amazing-xor/ 什么是异或? Wikipedia的解释: 在逻辑学中,逻辑算符异或(exclusive or)是对两个运算元的一种逻辑析取类型,符号为 XOR 或 EOR 或 ⊕(编程语言 阅读全文
posted @ 2019-09-13 21:10 晴天要下雨 阅读(393) 评论(0) 推荐(0) 编辑
摘要: There are nn points in an array with index from 11 to nn, and there are two operations to those points. 1: 1 \ x1 x marking the point xx is not availa 阅读全文
posted @ 2019-09-09 17:36 晴天要下雨 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 链接:https://ac.nowcoder.com/acm/contest/1083/C 题目描述 给出直角三角形其中一条边的长度n,你的任务是构造剩下的两条边,使这三条边能构成一个直角三角形。 输入描述: 一个整数n。 输出描述: 另外两条边b,c。答案不唯一,只要输出任意一组即为合理,如果无法 阅读全文
posted @ 2019-09-07 11:19 晴天要下雨 阅读(284) 评论(0) 推荐(1) 编辑
摘要: For each prefix with length P of a given string S,if S[i]=S[i+P] for i in [0..SIZE(S)-p-1], then the prefix is a “period” of S. We want to all the per 阅读全文
posted @ 2019-08-06 17:23 晴天要下雨 阅读(350) 评论(0) 推荐(0) 编辑
摘要: Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had. Marge: Yeah, what is it? Homer: Take me for example. I 阅读全文
posted @ 2019-08-06 16:05 晴天要下雨 阅读(606) 评论(0) 推荐(1) 编辑
摘要: Period Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 22012 Accepted: 10679 Description For each prefix of a given string S with N charact 阅读全文
posted @ 2019-08-04 22:26 晴天要下雨 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 65854 Accepted: 27197 Description Given two strings a and b we define a*b to be their conca 阅读全文
posted @ 2019-08-04 22:01 晴天要下雨 阅读(107) 评论(0) 推荐(0) 编辑
摘要: During tea-drinking, princess, amongst other things, asked why has such a good-natured and cute Dragon imprisoned Lpl in the Castle? Dragon smiled eni 阅读全文
posted @ 2019-07-24 22:28 晴天要下雨 阅读(410) 评论(0) 推荐(0) 编辑
摘要: ///支持查询和区间的单值修改 #include using namespace std; const int N=1e6+10; int n,a[N],m; int sumv[N>1; build(o>1; if(q>1; if(qlmid)ans+=querysum(o using namespace std; const int N=1e6+10; int n,a... 阅读全文
posted @ 2019-07-24 14:43 晴天要下雨 阅读(112) 评论(0) 推荐(0) 编辑
摘要: (https://atcoder.jp/contests/abc134/tasks/abc134_e) 题意:找出最小个数的最长上升子序列 思路:找出最长上升子序列的最小个数,只需要找出每个最小上升子序列的最后一个元素,然后元素个数之和就是最长上升子序列的最小个数 阅读全文
posted @ 2019-07-21 10:54 晴天要下雨 阅读(345) 评论(0) 推荐(0) 编辑