[CF878D]Magic Breeding 题意:有k个物品,每个物品有n项属性值,第i个人的第j个属性值为aij,有q个操作: 1 x y 用x和y合成一个新的物品,新物品的编号是++k,新物品的每项属性值为x和y的对应项的属性值中的较大值.2 x y 用x和y合成一个新的物品,新物品的编号是++k,新物品的每项属性值为x和y的对应项的属性值中的较小值.3 x y 询问x物品的属性y的值. n,q<=100000,k<=12,aij<=10^9 题解:神题,很容易让人想到排序那道题,…
D. Magic Breeding time limit per test 4 seconds memory limit per test 1024 megabytes input standard input output standard output Nikita and Sasha play a computer game where you have to breed some magical creatures. Initially, they have kcreatures num…
C. Nice Garland time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have a garland consisting of nn lamps. Each lamp is colored red, green or blue. The color of the ii-th lamp is sisi ('R',…
题面 传送门:http://codeforces.com/problemset/problem/515/C Drazil is playing a math game with Varda. Let’s define f(x)f(x)for positive integer x as a product of factorials of its digits. For example, f(135)=1!∗3!∗5!f(135)=1!∗3!∗5! First, they choose a dec…
Police Recruits Time Limit: 1000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Submit Status Description The police department of your city has just started its journey. Initially, they don’t have any manpower. So, they started hiring n…
E. Magic Stones time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Grigory has nn magic stones, conveniently numbered from 11 to nn . The charge of the ii -th stone is equal to cici . Sometime…