[Codeforces] Alex and a Rhombus】的更多相关文章

A. Alex and a Rhombus time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output While playing with geometric figures Alex has accidentally invented a concept of a nn-th order rhombus in a cell grid.…
A. Alex and a Rhombus 题目链接:http://codeforces.com/contest/1180/problem/A 题目: While playing with geometric figures Alex has accidentally invented a concept of an-th order rhombusin a cell grid.A1-st order rhombusis just a square1×1(i.e just a cell).An-…
A. Alex and a Rhombus time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output While playing with geometric figures Alex has accidentally invented a concept of a n-th order rhombus in a cell grid. A 1-s…
Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 2) 题目链接:https://codeforces.com/contest/1130 A. Be Positive 题意: 给出n个数,看是否正数的个数过半或者负数的个数过半. 题解:水题,代码如下: #include <bits/stdc++.h> using namespace std; ; int n; double a[N]; int main(){ ios::sync_…
链接: https://codeforces.com/contest/1220/problem/D 题意: Boy Dima gave Julian a birthday present - set B consisting of positive integers. However, he didn't know, that Julian hates sets, but enjoys bipartite graphs more than anything else! Julian was al…
Description 你需要维护 \(n\) 个可重集,并执行 \(m\) 次操作: 1 x v:\(X\leftarrow \{v\}\): 2 x y z:\(X\leftarrow Y \cup Z\): 3 x y z:\(X \leftarrow \{\gcd(a, b)\ |\ a\in Y, b\in Z\}\): 4 x v:询问 \(v\) 在 \(X\) 中出现次数 \(\bmod 2\) 的结果. Hint \(1\le n\le 10^5, 1\le m\le 10^6…
http://codeforces.com/contest/1129/problem/C #include<bits/stdc++.h> #define fi first #define se second #define INF 0x3f3f3f3f #define fio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define pqueue priority_queue #define NEW(a,b) memset(a,b,s…
A. Be Positive 链接:http://codeforces.com/contest/1130/problem/A 题意: 给一段序列,这段序列每个数都除一个d(−1e3≤d≤1e3)除完后,如果正数的个数可以大于序列长度的一半输出这个d,否则输出0 思路: 直接找正数和负数的个数,正数个数大于一半输出1,负数个数大于一半输出-1,都不大于一半长度输出0就好了 代码: #include<bits/stdc++.h> using namespace std; int main() {…
Codeforces Round 1129 这场模拟比赛做了\(A1\).\(A2\).\(B\).\(C\),\(Div.1\)排名40. \(A\)题是道贪心,可以考虑每一个站点是分开来的,把目的地最小编号的留到最后,所以答案稍微算一下就行了. \(B\)题是道找规律,首先可以很容易地发现只要前面弄个负数的开头,错误算法就会忽略掉这一个值,所以利用这个来构造答案.(最讨厌构造题了)然后推导一番式子就会发现如果我们将第一个值放-1,则 \(\sum_{i=2}^na_i=k+n\), 再更改一…
Alex decided to try his luck in TV shows. He once went to the quiz named "What's That Word?!". After perfectly answering the questions "How is a pseudonym commonly referred to in the Internet?" ("Um... a nick?"), "After…