2021年ECNU计科考研复试机试
D. Weights II
Merchants measured many commodities using weights and a two-pan balance. If you are using a limited set of weights, however, you can only measure certain quantities accurately. For example, suppose that you have only two weights: a 1-ounce weight and a 3-ounce weight. With these you can easily measure out 4 ounces, as shown in Figure1.
It is somewhat more interesting to discover that you can also measure out 2 ounces by shifting the 1-ounce weight to the other side, as shown in Figure2.
Write a program to determine whether it is possible to measure out the desired target amount with a given set of weights.
输入格式
First line contains a single integer \( t(t<1000 ) \)
The first line of each test case contains an integers \( n( 1\leq n \leq 100)\) – thesize of the given set of weights.
The second line of each test case contains \( n \)integers\( w_1,w_2,\cdots, w_n( 1\leq w_i \leq 10^4 )\)
The third line of each test case contains an integer\( q(1\leq q \leq 10^4 )\)– thenumber of queries.
The fourth line of each test cases contains distinct integers – the desired target amounts.
It’s guaranteed that the sum of all does not exceed \( 10^4\).
输出格式
For each test case, output a binary string ,\( s\) s.t. \(s_i=1 \) if it is possible measure out the desired target amount \( W_i\) with the given set of weights and \( s_i=0 \) otherwise.
测试样例
Input
3 2 1 3 6 1 2 3 4 5 6 2 1 4 6 1 2 3 4 5 6 3 3 5 9 18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Output
111100 101110 111111111011010010
25 thoughts on “2021年ECNU计科考研复试机试”
问一下m大,这些题目的时间限制是多少?Eoj平台1秒能跑多少呢?
只要选择适当的算法(大概10^9的数据量的话设计O(NlogN)的算法,10^5的数据量用O(N^2)算法)一般都可以。
具体时间的话,第1题时限1秒512MB,第2题1秒256MB,第3题3秒2GB,第4题2秒512MB。
Eoj一秒可以跑1e10吗,这么快吗。。。
不行的,m大乱说的
复试时英语与面试的权重还是1:2吗
复试之前会收到复试通知的Email,当中会清楚地说明的。
以后的机试也不直接计入复试成绩吗
以往线下复试的时候都计入复试成绩的。可能是因为线上复试的监考难免有漏洞所以暂时不计入成绩。
请问M佬计科的学硕专硕复试流程都一样嘛?机试的题目也是一个难度的嘛?
机试是同一套题。复试流程文字上写着的是一样的,不过学硕专硕是分开进行的,老师可能会问的侧重点可能不一样(当然,本来复试的时候老师聊的内容就是因人而异,都不相同)
请问大佬如果机试不计入成绩的话,最后复试得分是怎样构成的?
现在线上复试,是100%面试成绩,不过复试在总成绩中下调为了30$(初试成绩70%。之前是复试40%的)
M佬好~
请问软工的专硕有机试吗?
有的,https://www.malic.xyz/archives/3125
M大,请问软工的机试题还有别的吗,我看上面那个链接是E组,请问还有别组的题嘛
去年我只收集到这一组题
malic大佬,A题1120.00->325/9有误
对,录入错误,应该是「.22」,感谢反馈
问一下M大,软工的机试题只有21年的吗
2020年没有,2018和19可以看:http://cc.malic.xyz/solutions/
请问 软专机试可以用python解答吗?谢谢
软工机试平台EOJ是支持Python的,如果机考时不做针对考试的设定也是可以用的,历年应该是都能用。
学长你好 可以麻烦看下“复试面试问题”这里吗 链接点击去是历年机试真题的某一道题…
好的,感谢反馈
谢谢学长收集的资料!!