随笔分类 - CodeForces
摘要:Limak is an old brown bear. He often goes bowling with his friends. Today he feels really good and tries to beat his own record! For rolling a ball on
阅读全文
摘要:Zxr960115 is owner of a large farm. He feeds m cute cats and employs p feeders. There's a straight road across the farm and n hills along the road, nu
阅读全文
摘要:The sequence of integers a1,a2,…,aka1,a2,…,ak is called a good array if a1=k−1a1=k−1 and a1>0a1>0. For example, the sequences [3,−1,44,0],[1,−99][3,−1
阅读全文
摘要:Your friend is developing a computer game. He has already decided how the game world should look like — it should consist of nn locations connected by
阅读全文
摘要:I have an undirected graph consisting of n nodes, numbered 1 through n. Each node has at most two incident edges. For each pair of nodes, there is at
阅读全文
摘要:题意:给出N,以及三个矩阵A,B,C,大小都为N*N。问是否满足A*B=C; N<1000; 思路:由于矩阵乘法的复杂度为O(N^3);而部分验证又不能保证结果正确。我们巧妙地利用矩阵乘法的结合律:使其变为1*N和N*N的矩阵乘法,使复杂度降低为O(N^2); 即随机构造矩阵X(1*N),Y(N*1
阅读全文
摘要:Allen and Bessie are playing a simple number game. They both know a function f:{0,1}n→Rf:{0,1}n→R, i. e. the function takes nn binary arguments and re
阅读全文
摘要:For a vector →v=(x,y)v→=(x,y), define |v|=√x2+y2|v|=x2+y2. Allen had a bit too much to drink at the bar, which is at the origin. There are nn vectors
阅读全文
摘要:You are given a tree consisting of nn vertices. A number is written on each vertex; the number on vertex ii is equal to aiai. Let's denote the functio
阅读全文
摘要:For the given sequence with n different elements find the number of increasing subsequences with k + 1 elements. It is guaranteed that the answer is n
阅读全文
摘要:You are given a directed graph with n nodes and m edges, with all edges having a certain weight. There might be multiple edges and self loops, and the
阅读全文
摘要:In the lattice points of the coordinate line there are n radio stations, the i-th of which is described by three integers: xi — the coordinate of the
阅读全文
摘要:Once, Leha found in the left pocket an array consisting of n integers, and in the right pocket q queries of the form l r k. If there are queries, then
阅读全文
摘要:As you might remember from our previous rounds, Vova really likes computer games. Now he is playing a strategy game known as Rage of Empires. In the g
阅读全文
摘要:Jon fought bravely to rescue the wildlings who were attacked by the white-walkers at Hardhome. On his arrival, Sam tells him that he wants to go to Ol
阅读全文
摘要:Little Artem has invented a time machine! He could go anywhere in time, but all his thoughts of course are with computer science. He wants to apply th
阅读全文
摘要:In this problem you will meet the simplified model of game Pudding Monsters. An important process in developing any game is creating levels. A game fi
阅读全文
摘要:"Holiday is coming, holiday is coming, hurray hurray!" shouts Joke in the last day of his college. On this holiday, Joke plans to go to his grandmothe
阅读全文
摘要:A tree is a connected graph that doesn't contain any cycles. The distance between two vertices of a tree is the length (in edges) of the shortest path
阅读全文
摘要:Kuro is currently playing an educational game about numbers. The game focuses on the greatest common divisor (GCD), the XOR value, and the sum of two
阅读全文

浙公网安备 33010602011771号