Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Record Finder You are given customer data where each data contains AccNumber, name, age, and ballance. The given data is sorted lexicographically ascending based on

Record Finder

You are given 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 queries. For each query, given a variable . You are asked to tell whether a customer whose AccNumber is exists. If so, output the customers data. If the customer does not exist, output -1

Input Format The first line consists of an integer . The next 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 . The next lines consist of an integer , which represent each query.

Output Format For each query, if the customer exists, then print the data with the following format: . If there is no data to display, output -1.

Constraints 1 , 5 104 All given AccNumber and 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 109 . It is guaranteed that the balances are given in 2 decimal places.

Subtask 1 1 , 103

Subtasks 2 No additional constraint

Format Input

5 ANGE,Andrew Garfield,18,110933.25 HAIS,Spectra Vgeist,18,25000.00 NERA,Frankie,16,999999999.99 TION,Dorothy White,22,0.00 VVVV,Michael J,17,100000.00 3 NERA JOLY VVVV

Format Output Frankie 16 999999999.99 -1 Michael J 17 100000.00

Note Using Standard C Language (Not CPP) In this problem, there are subtasks. If your solution can only solve subtask 1, then you will get 80 points. For example, your program is not efficient enough such that it can solve the problem with the constraint program 1 , 103 under the 1 second time limit, but unable to solve larger value of , such as = = 5 104 . 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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions