CodeForces 610C Harmony Analysis】的更多相关文章

构造 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; ][][]; int main() { a[][][]=; a[][][]=; a[][][]=; a[][][]=-; ; ; i<=; i++) { len=len*; ; r<=len/; r++) ; c<=len/; c++) a[i][r][…
C. Harmony Analysis time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output The semester is already ending, so Danil made an effort and decided to visit a lesson on harmony analysis to know how do…
time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output The semester is already ending, so Danil made an effort and decided to visit a lesson on harmony analysis to know how does the professor look li…
C. Harmony Analysis 题目连接: http://www.codeforces.com/contest/610/problem/C Description The semester is already ending, so Danil made an effort and decided to visit a lesson on harmony analysis to know how does the professor look like, at least. Danil…
C. Harmony Analysis   The semester is already ending, so Danil made an effort and decided to visit a lesson on harmony analysis to know how does the professor look like, at least. Danil was very bored on this lesson until the teacher gave the group a…
[题目链接] http://codeforces.com/problemset/problem/610/C [题目大意] 构造出2^n个由1和-1组成的串使得其两两点积为0 [题解] 我们可以构造这样一个矩阵,右下角四分之一和其余三个分块相反, 不断扩展这个矩阵即可. [代码] #include <cstdio> #define rep(i,n) for(int i=1;i<=n;i++) using namespace std; const int N=1000; int k,p[N]…
题目链接:http://codeforces.com/contest/610/problem/C 解题思路: 将后一个矩阵拆分为四个前一状态矩阵,其中三个与前一状态相同,剩下一个直接取反就行.还有很多种取法,这种比较方便就是. 实现代码: #include<iostream> #include<string> #include<cmath> using namespace std; ][],b[][]; int main() { int n; cin>>n;…
水 A - Pasha and Stick #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5; const int INF = 0x3f3f3f3f; int main(void) { int n; scanf ("%d", &n); int ans = n / 4; if (n % 4 == 0) { ans--; } if (n %…
A - Forgetting Things 题意:给 \(a,b\) 两个数字的开头数字(1~9),求使得等式 \(a=b-1\) 成立的一组 \(a,b\) ,无解输出-1. 题解:很显然只有 \(a=b\) 和 \(a=b-1\) 的时候有解,再加上一个从 \(9\) 越到 \(10\) 的就可以了.被样例的 \(199,200\) 误导了. #include<bits/stdc++.h> using namespace std; typedef long long ll; int mai…
C. Harmony Analysis time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output The semester is already ending, so Danil made an effort and decided to visit a lesson on harmony analysis to know how do…