Блог пользователя sahaun

Автор sahaun, история, 3 недели назад, По-английски

Advent of Code 2024!

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as interview prep, company training, university coursework, practice problems, a speed contest, or to challenge each other.

The first puzzles will unlock on December 1st at midnight EST (UTC-5).

Полный текст и комментарии »

Теги aoc
  • Проголосовать: нравится
  • +21
  • Проголосовать: не нравится

Автор sahaun, история, 7 месяцев назад, По-английски

This is not a problem from any online judge, but for a project I am working on.

There is an ellipse and a list of points. The task is to score the list with a number between $$$0$$$ and $$$1$$$. A score of $$$1$$$ means that the list of points forms a perfect ellipse. A list forms a perfect ellipse when:

  1. All the points in the list lie on the circumference of the ellipse.

  2. The points are evenly spaced (distributed evenly) across the circumference.

Formal-ish statement

The expected time complexity is less than $$$O(N^3)$$$, not strictly necessary. $$$N$$$ being the number of points in the list.

If you want some inspiration, I have attempted the same problem but checked matching with circles and polygons. I am explaining how I did it for the circle.

Circle

How it works
Code

You can see how the same method will work for regular polygons. For irregular (closed) polygons, I have a more sophisticated but similar way. The closed polygon method can work for ellipses (since an ellipse is actually a closed polygon with many small lines), but I am looking for a more natural solution for ellipses.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

Автор sahaun, история, 13 месяцев назад, По-английски

Advent of Code 2023!

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as interview prep, company training, university coursework, practice problems, a speed contest, or to challenge each other.

The first puzzles will unlock on December 1st at midnight EST (UTC-5).

Полный текст и комментарии »

Теги aoc
  • Проголосовать: нравится
  • +39
  • Проголосовать: не нравится

Автор sahaun, история, 23 месяца назад, По-английски

Hello!

We would like to invite you to participate in the Replay of AUST CSE Carnival 1.0 Programming Contest. It will be held on February 2, 2023 at 7:00 PM GMT+6. You will be given 11 problems and 4 hours to solve them.

AUST CSE Carnival 1.0 was a week-long event held at Ahsanullah University of Science and Technology (AUST). The event was organized by AUST CSE Society.

Participants with rating less than 1900 might find the problems interesting and/or educational.

Good luck!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

Автор sahaun, история, 2 года назад, По-английски

I submitted exactly the same code for 86D - Мощный массив on different platforms. Here are the results:

There is a small increase in memory when using 64-bit, but the time difference is pretty huge!

Can anybody explain why?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +24
  • Проголосовать: не нравится

Автор sahaun, история, 2 года назад, По-английски

The time limit per test 840D - Судьба is 2.5 seconds. But 157972351 passed in 3525 ms.

What's going on? ಠ_ಠ

Полный текст и комментарии »

  • Проголосовать: нравится
  • +10
  • Проголосовать: не нравится