PLEASE HELP SIR, USE BINARY SEARCH, THX. USING C LANGUAGE. ".Ifthere is no data to display, output "-1".Constraints1SN,M S5 x 10All given AccNumber and x in each query are a string consists of...


PLEASE HELP SIR, USE BINARY SEARCH, THX. USING C LANGUAGE.


+<br>(D Page view A Read aloud V Draw<br>F Highlight<br>O Erase<br>4<br>of 17<br>B. Record Finder[EN]<br>You are given N customer data where each data contains AccNumber, name, age, and ballance. The<br>given data is sorted lexicographically ascending based on the AccNumber. Then, there are M queries.<br>For each query, given a variable x. You are asked to tel whether a customer whose AccNumber is x<br>exists. If so, output the customer's data. If the customer does not exist, output
". Ifthere is no data to display, output "-1". Constraints 1SN,M S5 x 10 All given AccNumber and x in each query are a string consists of exactly 4 upper case Latin alphabet characters. It is guaranteed that there are no 2 data with the same AccNumber. • Length of the name is between 1 and 20 (inclusive). Names consist of Latin alphabets and whitespaces. It is guaranteed that the first and last character are not whitespaces. • Ages are between 10 and 100 (inclusive) Balances are between 0 and 10.It is guaranteed that the balances are givenin 2 decimal places. Subtask 1 (80 points): • 1 SN,M S 103 Subtasks 2 (20 points): No additional constraint Sample Input Sample Output "/>
Extracted text: + (D Page view A Read aloud V Draw F Highlight O Erase 4 of 17 B. Record Finder[EN] You are given N customer data where each data contains AccNumber, name, age, and ballance. The given data is sorted lexicographically ascending based on the AccNumber. Then, there are M queries. For each query, given a variable x. You are asked to tel whether a customer whose AccNumber is x exists. If so, output the customer's data. If the customer does not exist, output"-1". Input Format The first line consists of an integer N. The next N lines contain the given data. Each data consists of AccNumber, name, age, and balance, respectively, separated by commas. The next line consists of an integer M. The next M lines consist of an integer x, which representeach query. Output Format For each query, if the customer exists, then print the data with the following format: " ". Ifthere is no data to display, output "-1". Constraints 1SN,M S5 x 10 All given AccNumber and x in each query are a string consists of exactly 4 upper case Latin alphabet characters. It is guaranteed that there are no 2 data with the same AccNumber. • Length of the name is between 1 and 20 (inclusive). Names consist of Latin alphabets and whitespaces. It is guaranteed that the first and last character are not whitespaces. • Ages are between 10 and 100 (inclusive) Balances are between 0 and 10.It is guaranteed that the balances are givenin 2 decimal places. Subtask 1 (80 points): • 1 SN,M S 103 Subtasks 2 (20 points): No additional constraint Sample Input Sample Output
D Page view A Read aloud V Draw<br>F Highlight<br>O Erase<br>5<br>of 17<br>Frankie 16 999999999.99<br>ANGE ,Andrew Garfield,18,110933. 25<br>HAIS,Spectra Vgeist,18,2500e.ee<br>NERA, Frankie, 16, 999999999.99<br>TION,Dorot hy White, 22,0.ee<br>ww,Michael 1,17,100008.ee<br>Michael J 17 1e0eee.ee<br>NERA<br>JOLY<br>ww<br>Notes<br>In this problem, there are subtasks. If your solution can only solve subtask 1, then you will get 80<br>points. For example, yourprogram is not efficient enough such that it can solve the problem with the<br>constraint program 1<N,M < 103 underthe 1 second time limit, but unable to solve larger value of<br>N, such as N = M = 5x 10.<br>Note that for this problem, if your program can solve subtask 2, then the program can solve subtask 1<br>as well. Therefore, if your program can solve this problem within all of the constraints, then your<br>solution is considered correct and you will get 100 points.<br>+<br>

Extracted text: D Page view A Read aloud V Draw F Highlight O Erase 5 of 17 Frankie 16 999999999.99 ANGE ,Andrew Garfield,18,110933. 25 HAIS,Spectra Vgeist,18,2500e.ee NERA, Frankie, 16, 999999999.99 TION,Dorot hy White, 22,0.ee ww,Michael 1,17,100008.ee Michael J 17 1e0eee.ee NERA JOLY ww Notes In this problem, there are subtasks. If your solution can only solve subtask 1, then you will get 80 points. For example, yourprogram is not efficient enough such that it can solve the problem with the constraint program 1< 103 underthe 1 second time limit, but unable to solve larger value of n, such as n = m = 5x 10. note that for this problem, if your program can solve subtask 2, then the program can solve subtask 1 as well. therefore, if your program can solve this problem within all of the constraints, then your solution is considered correct and you will get 100 points. + 103="" underthe="" 1="" second="" time="" limit,="" but="" unable="" to="" solve="" larger="" value="" of="" n,="" such="" as="" n="M" =="" 5x="" 10.="" note="" that="" for="" this="" problem,="" if="" your="" program="" can="" solve="" subtask="" 2,="" then="" the="" program="" can="" solve="" subtask="" 1="" as="" well.="" therefore,="" if="" your="" program="" can="" solve="" this="" problem="" within="" all="" of="" the="" constraints,="" then="" your="" solution="" is="" considered="" correct="" and="" you="" will="" get="" 100="" points.="">
Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here