codeforces 112B Petya and Square】的更多相关文章

B. Petya and Square time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little Petya loves playing with squares. Mum bought him a square 2n × 2n in size. Petya marked a cell inside the square…
题目链接 Codeforces Round #448 C. Square Subsets 题解 质因数 *质因数 = 平方数,问题转化成求异或方程组解的个数 求出答案就是\(2^{自由元-1}\) ,高消求一下矩阵的秩,完了 或者 由于数很小, 我们只需要对于每个数的质因数装压 对这组数求线性基,n - 线性基中的数就是自由元个数 代码 #include<bits/stdc++.h> using namespace std; inline int read() { int x = 0,f =…
C. Magic Odd Square time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Find an n × n matrix with different numbers from 1 to n2, so the sum in each row, column and both main diagonals are odd.…
http://codeforces.com/problemset/problem/716/C codeforces716C. Plus and Square Root 这个题就是推,会推出来规律,发现和等级有关系,等级的平方然后减去数字啥的,忘记了,推的草稿纸找不到了... 推出来就是类似a+b的题目. 代码: 1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 #include<cmath&…
Petya and Pipes Time Limit: 1000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ID: 362E64-bit integer IO format: %I64d      Java class name: (Any)   A little boy Petya dreams of growing up and becoming the Head Berland…
F - Expected Square Beauty 思路:https://codeforces.com/blog/entry/68111 代码: #pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize(4) #include<bits/stdc++.h> using namespace std; #define y1 y11 #define fi first #define se second #define…
A. Plus and Square Root time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) an…
题目链接:http://codeforces.com/problemset/problem/362/B 题目意思:给出整数n和m,表示有n级楼梯和m级dirty的楼梯,接下来m个数表示对应是哪一个数字的楼梯是dirty的楼梯,不一定是按小到大给定的,需要判断的是,在只可以走一级.二级或三级的情况,是否可以把所有的非dirty楼梯走完.当然,如果dirty的楼梯中包含第一级(初始位置)或者最后一级(最终位置),那么默认是不能走完非dirty楼梯的. 由于给定的dirty楼梯的数字是任意无序的,所以…
题目链接: http://codeforces.com/problemset/problem/710/C 题目大意: 构造一个N*N的幻方.任意可行解. 幻方就是每一行,每一列,两条对角线的和都相等. 题目思路: [模拟] 分为奇幻方.单偶幻方和双偶幻方三种构造. 具体分类可以查看百度.幻方的N种构造方法 // //by coolxxx //#include<bits/stdc++.h> #include<iostream> #include<algorithm> #i…
C. Petya and Catacombstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA very brave explorer Petya once decided to explore Paris catacombs. Since Petya is not really experienced, his exploration is…