CIELNUM2 - Editorial

PROBLEM LINKS

Practice
Contest

DIFFICULTY

EASY

EXPLANATION

This problem is the easiest problem in the set. We take the price for each menu, and check whether it is a Ciel number naively. For example, we can take the price as the last element by splitting each line by a single space.

SETTER’S SOLUTION

Can be found here.

TESTER’S SOLUTION

Can be found here.

1 Like

Setter’s solution with cin.getline() in it is giving a wrong answer but gets() is giving accepted. Does anyone know the technical reason behind this?

TO ALL THOSE PEOPLE WHO ARE SOLVING THIS QUESTION READ BELOW :

1.THIS QUESTION TEST CASES HAVE ERRORS. ERROR IS IN ‘N’. IN ONE TEST CASE N IS SPECIFIED ALONG WITH 2 CHARACTERS FURTHER. HENCE :scanf("%d",&n); WILL GIVE YOU ALL WRONG ANSWER. HENCE USE : scanf("%d",&n); getchar(); getchar();

YES , USE THEM 2 TIMES TO GET THE RIGHT INPUT OR USE gets(string) TO The ELIMINATE ERROR.If you just use :

scanf("%d",&n); 
getchar(); // used to eliminate new line character

you will get wrong answer .

@admin @laycurse PLEASE RECTIFY THIS ERROR AND DO NOT POST SUCH QUESTIONS WHICH HAVE WRONG TEST CASES.

1 Like
//