Live2d Test Env

随笔分类 -  OJ---SPOJ

摘要:Shadowman loves to collect box but his roommates woogieman and itman don't like box and so shadowman wants to hide boxes as many as possible. A box ca 阅读全文
posted @ 2018-04-29 19:50 nimphy 阅读(218) 评论(0) 推荐(0)
摘要:Problem statement: A string is said to be “PATHETIC” if all the characters in it are repeated the same number of times. You are given a string of leng 阅读全文
posted @ 2018-04-29 14:30 nimphy 阅读(268) 评论(0) 推荐(0)
摘要:You are given N(1<=N<=100000) integers. Each integer is square free(meaning it has no divisor which is a square number except 1) and all the prime fac 阅读全文
posted @ 2018-04-28 11:13 nimphy 阅读(364) 评论(0) 推荐(0)
摘要:Given an array of N integers A1, A2, A3…AN. If you randomly choose two indexes i ,j such that 1 ≤ i < j ≤ N, what is the expected value of Ai | Aj? In 阅读全文
posted @ 2018-04-25 23:28 nimphy 阅读(316) 评论(0) 推荐(0)
摘要:Waca loves maths,.. a lot. He always think that 1 is an unique number. After playing in hours, Waca suddenly realize that every integer can be represe 阅读全文
posted @ 2018-04-24 20:35 nimphy 阅读(376) 评论(0) 推荐(0)
摘要:As you might already know, Ada the Ladybug is a farmer. She grows a big fruit tree (with root in 0). There is a fruit on every node of the tree. Ada i 阅读全文
posted @ 2018-04-24 12:20 nimphy 阅读(188) 评论(0) 推荐(0)
摘要:Ada the Ladybug lives near an orange tree. Instead of reading books, she investigates the oranges. The oranges on orange tree can be in up to 5*50 Sha 阅读全文
posted @ 2018-04-23 18:33 nimphy 阅读(432) 评论(0) 推荐(0)
摘要:Rainbow 6 is a very popular game in colleges. There are 2 teams, each having some members and the 2 teams play some matches against each other. The te 阅读全文
posted @ 2018-04-23 09:35 nimphy 阅读(181) 评论(0) 推荐(0)
摘要:Problem description. The Fibonacci numbers defined as f(n) = f(n-1) + f(n-2) where f0 = 0 and f1 = 1. We define a function as follows D(n,x) = x + x^2 阅读全文
posted @ 2018-04-20 22:19 nimphy 阅读(456) 评论(0) 推荐(0)
摘要:You are given an array of size N. How many distinct arrays can you generate by swapping two numbers for exactly once? The two selected numbers can be 阅读全文
posted @ 2018-04-20 20:27 nimphy 阅读(351) 评论(0) 推荐(0)
摘要:Katniss Everdeen after participating in Hunger Games now wants to participate in NT Games (Number Theory Games). As she begins President Snow provides 阅读全文
posted @ 2018-04-20 16:38 nimphy 阅读(328) 评论(0) 推荐(0)
摘要:The northern part of the Pyramid contains a very large and complicated labyrinth. The labyrinth is divided into square blocks, each of them either fil 阅读全文
posted @ 2018-04-19 20:01 nimphy 阅读(180) 评论(0) 推荐(0)
摘要:A positive integer is called a palindrome if its representation in the decimal system is the same when read from left to right and from right to left. 阅读全文
posted @ 2018-04-19 18:57 nimphy 阅读(216) 评论(0) 推荐(0)
摘要:You are given a tree with N nodes. The tree nodes are numbered from 1 to N. Each node has an integer weight. We will ask you to perform the following 阅读全文
posted @ 2018-01-15 10:25 nimphy 阅读(328) 评论(0) 推荐(0)
摘要:You are given a sequence A[1], A[2], ..., A[N]. (0 ≤ A[i] < 231, 1 ≤ N ≤ 12000). A query is defined as follows: Query(x,y) = Max { a[i] xor a[i+1] xor 阅读全文
posted @ 2018-01-10 11:31 nimphy 阅读(467) 评论(1) 推荐(0)
摘要:You have two integers L and R, and you are required to find the max xor value of a and b where L <= a <= R and L <= b <= R Input Two integers in a lin 阅读全文
posted @ 2018-01-08 19:58 nimphy 阅读(367) 评论(0) 推荐(0)
摘要:Byteotian Interstellar Union (BIU) has recently discovered a new planet in a nearby galaxy. The planet is unsuitable for colonisation due to strange m 阅读全文
posted @ 2018-01-04 17:58 nimphy 阅读(312) 评论(0) 推荐(0)
摘要:You are given a tree (an undirected acyclic connected graph) with N nodes, and edges numbered 1, 2, 3...N-1. Each edge has an integer value assigned t 阅读全文
posted @ 2017-12-18 22:26 nimphy 阅读(183) 评论(0) 推荐(0)
摘要:You are given a node-labeled rooted tree with n nodes. Define the query (x, k): Find the node whose label is k-th largest in the subtree of the node x 阅读全文
posted @ 2017-12-18 22:26 nimphy 阅读(249) 评论(0) 推荐(0)
摘要:ιYou are given a tree (an acyclic undirected connected graph) with N nodes, and edges numbered 1, 2, 3...N-1. We will ask you to perfrom some instruct 阅读全文
posted @ 2017-12-18 21:57 nimphy 阅读(201) 评论(0) 推荐(0)