Glassmorphism card design

Glassmorphism design is a card design that is made with different layers with smooth transitions between layers. We have used CSS and HTML to accomplish this. In the meantime, this card design is free to download and use. Glassmorphism card design – CSS Glassmorphism -HTML -CSS -JS Tutorial

High school programming competition preliminary preparation

There are two types of people in the world, those who can program and those who can’t program! The Japanese or the Russians are very advanced in science and technology without knowing English very well, but there is probably not a single example in the modern world where a nation has advanced without knowing programming. National High School Programming Competition (NHPC) is definitely going to be a milestone in the history of Bangladesh. Informatics Olympiad has been organized regularly for the past few years but due to many constraints it has not been possible to organize it with much fanfare. The preparation behind this competition is much more, it has been possible to reach many children, so it is expected to be a great competition like Maths Olympiad.

I would like to talk about preparation for high school programming contest. There was a time when in our country only university-educated children were doing programming, school-college children were few in number, now that number has increased a lot. Many people will come to the competition after maybe 1-2 weeks of learning programming, I want to give them some familiarity with the question types of such competitions.

The first part of preparation is of course learning programming. This competition requires coding with C/C++. Subin Bhai’s Computer Programming book can be a great resource for those who are starting from scratch to learn C/C++, you can read the book online. Those who want to know a little deeper can read Harvard Shield’s book. Logic, Loops, Arrays, Strings, Functions should be known to solve competitive problems. You might say that I know Java, PHP, Ruby, etc., what do I do? Our argument is that every programmer should know C, and if you know C, all other languages can be learned very easily.

The objective of programming competition is not only to test whether you know programming, but how good you are at solving problems with logic. Great programmers spend 70-80% of the time sitting in a chair thinking or scribbling on a whiteboard and the remaining 20-30% coding at the keyboard. So if you see a programmer thinking day and night bored but the computer is very little, it is not surprising!

We will now solve a problem to familiarize ourselves with the types of problems. First the easy version of the problem, then the slightly harder version. The problem is this:

  Problem description:

  Two numbers B and E are given. You have to sum all the numbers from B to E.

This is the description of the main problem. Then you will be given the input format. Most of the time the input starts with how many test-cases to solve, followed by a description of each test case. The input format for this problem could be:

  Input format:

  Then there will be T number of lines, each line containing two numbers B and E.

Judges have an input file against which your code is tested. Here is the description of that input file. After that you will be given the output format.

  Output format:

  For each test case you need to print the test case number and result. See sample output.

Judges will create an output file using their input file and your code. It will then match yours with its own solution file. You have to follow the output format exactly, even if you print the correct output in wrong format, the judge will say ‘Wrong answer’. Some sample input-output will also be provided:

Sample Input:

3

1 3

10 15

20 23

Sample Output:

Case 1: 6

Case 2: 75

Case 3: 86

Samples will be provided so you can understand what the judges’ input-output files look like and test your code before submitting.

Another very important part is input limit and time limit. In this problem they are:

  Time limit: 2 seconds

  1<=T<=1000

  1<=B<=E<=100

This means your code should return results within 2 seconds. And the testcase will have a maximum of 100, the values of B and E will be between 1 and 100.

How to understand the code will work in 2 seconds or not? The number of test cases is at most 1000, and the loop I ran from B to E inside can loop at most 100 times per case. That means, no matter how bad the input file judge is, your code can give the results of all test cases in approximately 1000×100 steps. Current judging computers can complete roughly 10000000 or 10^8 steps per second, this is not a fixed number, it can be more or less depending on the computer configuration. That means very easily your code will work within 2 seconds!

Be sure to test your code with uppercase and lowercase cases before submitting the code. These are called corner cases by programmers, many times it is seen that corner cases are the reason for getting wrong answer. A corner case in this problem can be B=E. Judges will test your code with all kinds of cases, so if you don’t write correct code, you will be caught.

Now what would happen if the input limits were as follows:

  Time limit: 2 seconds

  1<=T<=100000

  1<=B<=E<=100000

But now the previous code will require 100000×100000 or 10^10 steps to get the result. If you complete 10^8 steps in seconds, it will take 100 seconds to get the result in your code, the judges will inform Time limit exceed(TLE) or Execution timeout. Then you have to think about how to reduce the number of steps.

We will take an array named cumulative_sum, and the size of the array is at least 100001. In the ith index of that array we will pre-store the sum of all the numbers from 1 to i. Then sum of all numbers from B to E will be cumulative_sum[E]-cumulative_sum[B-1].

Before starting to take input we loop up to the maximum value of E and store the sum of 1 to i at the ith index. This way we don’t have to loop from B to E inside each test case! We will now test the code with a corner case, the case being

  1

  1 100000

We know that the formula for finding the sum of numbers from 1 to n is n*(n+1)/2, so the output should be 5000050000. But showing 705082704. That means there is a mistake somewhere, submitting this code will give wrong answer. What is the problem and how to solve it? (Hints: Integer overflow, sum too large)

Now let’s increase the input limit so that the above code also times out:

  Time limit: 2 seconds

  1<=T<=100000

  1<=B<=E<=1000000000000000

Now you can’t even take such a big array to save the sum, you can’t run a loop, running such a big loop will end the contest, our lifetime will also end. Now how to solve? Very easy, just use the formula above! You will write its code yourself.

Glassmorphism card design – CSS Glassmorphism -HTML -CSS -JS Tutorial

Before Download

You must Join our Facebook Group and Subscribe YouTube Channel

All Links in Below:






Join Our FreeWebsiteCreate Facebook Group to get an instant update for projects, templates, design resources, and solutions.

Join Our YouTube Channel & Subscribe with Bell Icon for New Video:

Join Our Official Facebook Page For the Latest updates All Code Projects are Free:

Visit our service page to get premium services.

Free Website Create – HTML CSS, PHP, JavaScript Programming Projects For Free

Follow Us

Thank You,

Stay with FreeWebsiteCreate.net

Share the post if necessary.

Before Download

You must Join our Facebook Group and Subscribe YouTube Channel




FreeWebsiteCreate.net tries to provide HTML, CSS, SCSS, JavaScript, React, Android Studio, Java, PHP, Laravel, Python, Django, C#(C Sharp), and ASP.net-related projects 100% free. We try to make learning easier. Free Website Create always tries to give free projects to those who are new learners. Free projects and source code will help to learn easily. They can save time and learn more. In this post, we share a free portfolio project website code with HTML and CSS. This free code portfolio contains a single landing page with a responsive design. In this post, we get a free best carpenter and craftsman service website designed by FreeWebsiteCreate with HTML, CSS, Bootstrap, and JavaScript.

To get a free website project code,

Keep bookmarking our website, Save categories links, Follow Social Media, Follow the youtube channel Join Facebook groups.

Stay with FreeWebsiteCreate.net

Share the post if necessary.

Leave a Comment