B. Powers of Two You are given n integers a1, a2, ..., an. Find the number of pairs of indexes i, j (i < j) that ai + aj is a power of 2 (i. e. some integer xexists so that ai + aj = 2x). Input The first line contains the single positive integer n
链接:https://www.nowcoder.com/acm/contest/215/A来源:牛客网 题目描述 “White shores, and beyond. A far green country under a swift sunrise.”--灰魔法师 给出长度为n的序列a, 求有多少对数对 (i, j) (1 <= i < j <= n) 满足 ai + aj 为完全平方数. 输入描述: 第一行一个整数 n (1 <= n <= 10 5 )第二行 n 个整数
MZL's xor Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 800 Accepted Submission(s): 518 Problem Description MZL loves xor very much.Now he gets an array A.The length of A is n.He wants to
463. Island Perimeterhttps://leetcode.com/problems/island-perimeter/就是逐一遍历所有的cell,用分离的cell总的的边数减去重叠的边的数目即可.在查找重叠的边的数目的时候有一点小技巧,就是沿着其中两个方向就好,这种题目都有类似的规律,就是可以沿着上三角或者下三角形的方向来做.一刷一次ac,但是还没开始注意codestyle的问题,需要再刷一遍. class Solution { public: int islandPerime
2212: [Poi2011]Tree Rotations Time Limit: 20 Sec Memory Limit: 259 MBSubmit: 391 Solved: 127[Submit][Status] Description Byteasar the gardener is growing a rare tree called Rotatus Informatikus. It has some interesting features: The tree consists o
地址:http://acm.uestc.edu.cn/#/problem/show/1564 题目: G - GC?(X,Y) Time Limit: 3000/1000MS (Java/Others) Memory Limit: 131071/131071KB (Java/Others) One positive integer can be represented by the product of some prime numbers. Sort the prime numbers
Description Byteasar the gardener is growing a rare tree called Rotatus Informatikus. It has some interesting features: The tree consists of straight branches, bifurcations and leaves. The trunk stemming from the ground is also a branch. Each branch
BZOJ_2212_[Poi2011]Tree Rotations_线段树合并 Description Byteasar the gardener is growing a rare tree called Rotatus Informatikus. It has some interesting features: The tree consists of straight branches, bifurcations and leaves. The trunk stemming from t
155. Cartesian Tree time limit per test: 0.25 sec. memory limit per test: 65536 KB input: standard input output: standard output Let us consider a special type of binary search trees, called cartesian trees. Recall that a binary searchtree is a roote
2212: [Poi2011]Tree Rotations Time Limit: 20 Sec Memory Limit: 259 MB Description Byteasar the gardener is growing a rare tree called Rotatus Informatikus. It has some interesting features: The tree consists of straight branches, bifurcations and lea
被B的0的情况从头卡到尾.导致没看C,心情炸裂又掉分了. A. Pizza Separation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Students Vasya and Petya are studying at the BSU (Byteland State University). At one of the