传送门 今天的签到题. 有一个很显然的结论,gcd(n∗m,k)≤2gcd(n*m,k)\le 2gcd(n∗m,k)≤2. 本蒟蒻是用的行列式求三角形面积证明的. 如果满足这个条件,就可以直接构造出一个满足限制的直角三角形了. 代码: #include<bits/stdc++.h> #define ll long long using namespace std; inline ll read(){ ll ans=0; char ch=getchar(); while(!isdigit(ch…
A. In Search of an Easy Problem time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output When preparing a tournament, Codeforces coordinators try treir best to make the first problem as easy as poss…
传送门 考试的时候卡了一会儿. 显然这个答案只跟二进制位为1的数量有关. 还有一个显然的结论. 对于一个区间[l,r][l,r][l,r],如果其中单个数二进制位为1的数量最大值不到区间所有数二进制位为1的数量之和的一半即maxn∗2≤summaxn*2\le summaxn∗2≤sum,并且sum是偶数那么这个区间是好的. 继续考虑,如果我们枚举左端点l和右端点r,那么当sum[r0]−sum[l−1]≥64sum[r_0]-sum[l-1]\ge 64sum[r0​]−sum[l−1]≥64…
这题,全零是esay有1是hard,真难呀. #include<bits/stdc++.h> using namespace std; int main(){ int n,i,x,flag=0; cin>>n; for(int i=1;i<=n;i++) { cin>>x; if(x==1) flag=1; } if(flag) cout<<"HARD"; else cout<<"EASY"; ret…
Hard problem 题目链接: http://codeforces.com/contest/706/problem/C Description Vasiliy is fond of solving different tasks. Today he found one he wasn't able to solve himself, so he asks you to help. Vasiliy is given n strings consisting of lowercase Engl…
题目链接: http://codeforces.com/contest/1174/problem/D 题意: 构造一个序列,满足以下条件 他的所有子段的异或值不等于$x$ $1 \le a_i<2^n$ 输出一个最长的这样的序列 数据范围: $1 \le n \le 18$$1 \le x<2^{18}$ 分析: 比赛的时候搞混$subsegment$和$subsequence$,前者为子段一定要连续,后者为子序列可以不连续 赛后看的官方题解 假设构造的序列为$a_i$,它的前缀异或和为$b_…
C Halting Problem In computability theory, the halting problem is the problem of determining, from a description of an arbitrary computer program, whether the program will finish running (i.e., halt) or continue to run forever. Alan Turing proved in…
[LeetCode]95. Unique Binary Search Trees II 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.me/ 题目地址:https://leetcode.com/problems/unique-binary-search-trees-ii/description/ 题目描述: Given an integer n, generate all s…
C#/AutoCAD 2018/ObjectArx/二次开发添加圆对象的的例子(五) 1.创建一个图形对象的步骤如下见上一篇博客(三)2.添加删除实体的工具函数见上一篇博客(四) 3.添加圆的例子(完整源代码请加云幽学院免费课yunyun.ke.qq.com)   [CommandMethod("MKCircle")]        public void MKCircle()        {            //(1)获取当前活动图形数据库            Databa…
本人编程小白,如果有写的不对.或者能更完善的地方请个位批评指正! 这个是leetcode的第35题,这道题的tag是数组,python里面叫list,需要用到二分搜索法 35. Search Insert Position Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were in…