Submission #800763

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8007632023-08-01 20:05:58Oz121Bank (IZhO14_bank)Java
0 / 100
49 ms8604 KiB
import java.io.*;
import java.util.*;
public class bank {
public static void main(String[] args) throws IOException {
BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer l1 = new StringTokenizer(scan.readLine());
int num = Integer.parseInt(l1.nextToken()); int m = Integer.parseInt(l1.nextToken());
int[] a = new int[num];
StringTokenizer st1 = new StringTokenizer(scan.readLine());
for (int i = 0;i<num;i++) {
a[i] = Integer.parseInt(st1.nextToken());
}
int[] b = new int[m];
StringTokenizer st2 = new StringTokenizer(scan.readLine());
for (int i = 0;i<m;i++) {
b[i] = Integer.parseInt(st2.nextToken());
}
Pair[] dp = new Pair[1<<num]; //Stores first i people we can satisfy and the leftover
dp[0] = new Pair(-1,0);
for (int i = 0;i<1<<num;i++) {
dp[i] = new Pair(0,0);
for (int j = 0;j<num;j++) {
if ((i&(1<<j))==0)
continue;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...