Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.Scanner;
- class type {
- /*
- * static int min(int a[]) { if (a.length == 0) return -1; else { int min =
- * 0; for (int i = 0; i < a.length; i++) { if (a[i] < min) min = a[i]; }
- * return min; } }
- */
- /*
- * static void remove(int a[], int value) { // if have two value has the
- * same value??? for(int i=0; i< a.length; i++) { if(a[i]==value) { for(int
- * j =i; j<a.length;j++) { a[j] = a[j+1]; } a.length-=1; //final array
- * length can not be assign break; } } }
- */
- public static void main(String args[]) {
- int pie, rack, a, n, count;
- ArrayList pies = new ArrayList();
- ArrayList racks = new ArrayList();
- Scanner scanner = new Scanner(System.in);
- a = scanner.nextInt();
- while (a-- > 0) {
- n = scanner.nextInt();
- for (int i = 0; i < n; i++) {
- pies.add(scanner.nextInt());
- }
- for (int i = 0; i < n; i++) {
- racks.add(scanner.nextInt());
- }
- while (pie=min(pies.toArray())!=-1) {
- while ((rack = min(racks)) != -1 && rack >= pie) {
- // remove rack from racks array
- }
- // remove both rack and pie
- // update count
- }
- ;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement