题目链接:http://agc015.contest.atcoder.jp/tasks/agc015_d 题意:给出两个数b,a(a>=b)问{a,a+1,....,b}的集合内取任意数求或运算最多能够表示多少个数. 题解:数据很吧不用想着暴力,主要是位运算一般都会想到用二进制来写.具体的写法详见代码注释,不好表达. #include <iostream> #include <cstring> using namespace std; typedef long long ll…
D - Handstand Time Limit: 2 sec / Memory Limit: 1024 MB Score : 400400 points Problem Statement NN people are arranged in a row from left to right. You are given a string SS of length NN consisting of 0 and 1, and a positive integer KK. The ii-th per…
题目链接:http://agc017.contest.atcoder.jp/tasks/agc017_c 题解:就是简单的模拟一下就行.看一下代码就能理解 #include <iostream> #include <cstring> #include <cstdio> using namespace std; const int M = 2e5 + 10; int a[M] , vis[M] , cnt[M]; int main() { int n , m; scanf…
Bracket Sequences Concatenation Problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A bracket sequence is a string containing only characters "(" and ")". A regular bra…
Chinese Postman Problem is a very famous hard problem in graph theory. The problem is to find a shortest closed path or circuit that visits every edge of a (connected) undirected graph. When the graph has an Eulerian Circuit (a closed walk that cover…
题意 题目链接 系统中有两个数\((a, b)\),请使用\(62\)以内次询问来确定出\((a, b)\) 每次可以询问两个数\((c, d)\) 若\(a \oplus c > b \oplus d\)返回\(1\) 若\(a \oplus c = b \oplus d\)返回\(0\) 若\(a \oplus c < b \oplus d\)返回\(-1\) 保证/需要保证\(0 \leqslant a, b, c, d, < 2^{30}\) Sol 严重怀疑自己小学数学没学好,…