这次比上次多A了一道,但做得太慢,rating还是降了. Problem A Choose Two Numbers 题意:给出两个集合A,B,从A,B中分别选出元素a,b使得a+b既不属于集合A,又不属于集合B 数据范围:1<=集合A,B的大小<=100 1<=a,b<=200 我的做法是直接模拟就好了,复杂度:O(nm(n+m)) 题解的做法是分别取集合A,集合B中的最大值a,b就可以了,显然此时的a+b既不属于A,也不属于B #include <iostream>…
http://www.practice.geeksforgeeks.org/problem-page.php?pid=667 Equal to product Given an array of integers check whether there are two numbers present with given product. Input: The first line of input contains an integer T denoting the number of tes…
Given a non-repeating prime array arr, and each prime number is used at most once, find all the product without duplicate and sort them from small to large. Notice 2 <= |arr| <= 9 2 <= arr[i] <= 23 Have you met this question in a real intervie…