quantity专题

Codeforces 1133 problem D Zero Quantity Maximization —— 求a*k=b的最大数量

You are given two arrays a and b, each contains n integers. You want to create a new array c as follows: choose some real (i.e. not necessarily integer) number d, and then for every i∈[1,n] let ci:=d

Codeforces Round #544 (Div. 3) D. Zero Quantity Maximization(思维)

题目链接:http://codeforces.com/contest/1133/problem/D 题意:是输入一个n,加下来分别输入n个a[i]和b[i],现在让你找一个d,现在要求一个c数组,c[i] = d * a[i] + b[i],也就是找一个d使得c数组中有最多的0,问最多的0的个数为多少。 思路:对b[i] / a[i]化成最简分数,用map存一下分数,最大的分数个数就是答案。需