Codeforces Round #580 (Div. 1) A-E】的更多相关文章

Codeforces Round #580 (Div. 1) https://codeforces.com/contest/1205 A. Almost Equal 随便构造一下吧...太水了不说了,放个代码吧. #include<bits/stdc++.h> using namespace std; void read(int &x) { x=0;int f=1;char ch=getchar(); for(;!isdigit(ch);ch=getchar()) if(ch=='-'…
Contest Page A Tag:构造 将$a_i$看做一个无穷数列,$i > 2n$时$a_i = a_{i - 2n}$.设$sgn_i = \sum\limits_{j=i+1}^{i+n}a_i - \sum\limits_{j=i}^{i+n-1}a_i = a_{i+n} - a_i$,那么答案要满足:$\forall j \leq k , \sum\limits_{p=j}^k sgn_p \in [-1,1]$.且$\forall i , sgn_i \neq 0$. 上述条…
这次比上次多A了一道,但做得太慢,rating还是降了. Problem A Choose Two Numbers 题意:给出两个集合A,B,从A,B中分别选出元素a,b使得a+b既不属于集合A,又不属于集合B 数据范围:1<=集合A,B的大小<=100 1<=a,b<=200 我的做法是直接模拟就好了,复杂度:O(nm(n+m)) 题解的做法是分别取集合A,集合B中的最大值a,b就可以了,显然此时的a+b既不属于A,也不属于B #include <iostream>…
#define HAVE_STRUCT_TIMESPEC#include<bits/stdc++.h>using namespace std;const int maxn=300;const int inf=1e9;long long a[100007];long long b[100007];int val[maxn + 1][maxn + 1]; // 原图的邻接矩阵inline int floyd(const int &n) { static int dis[maxn + 1][…
You are given nn integer numbers a1,a2,…,ana1,a2,…,an. Consider graph on nn nodes, in which nodes ii, jj (i≠ji≠j) are connected if and only if, aiaiAND aj≠0aj≠0, where AND denotes the bitwise AND operation. Find the length of the shortest cycle in th…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/output 1 s, 256 MB    x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB    x1462 C Vasya and String standard input/output 1 s, 256 MB    x1393…
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输出”#Color”,如果只有”G”,”B”,”W”就输出”#Black&White”. #include <cstdio> #include <cstring> using namespace std; const int maxn = 200; const int INF =…
 cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....       其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/output 1 s, 256 MB  x2377 B Queue standard input/output 2 s, 256 MB  x1250 C Hacking Cypher standard input/output 1 s, 256 MB  x740 D Chocolate standard in…