abhi_yo's blog

By abhi_yo, history, 5 months ago, In English

Grid Path Counting Puzzle – Looking for a Pure Combinatorics Solution I came across the following interesting grid path problem. Problem A person starts at A and wants to reach B. He can move only Right or Down. He cannot pass through point C. How many valid paths are there?

Full text and comments »

  • Vote: I like it
  • -10
  • Vote: I do not like it

By abhi_yo, history, 6 months ago, In English

A Small Number Theory Challenge

Hello everyone,

I came across an interesting observation and wanted to hear different approaches and ideas from the community.

Problem

You are given two integers A and B (**B ≠ 0**).

Consider the decimal representation of the fraction A / B.

Your task is to determine whether the decimal representation will terminate after a finite number of digits or continue forever.

Output:

  • YES if the decimal representation terminates.
  • NO otherwise.

Examples

Example 1

Input:

3 8

Output:

YES

Explanation:

3 / 8 = 0.375

The decimal representation terminates.


Example 2

Input:

1 3

Output:

NO

Explanation:

1 / 3 = 0.333333...

The decimal representation never terminates.


Example 3

Input:

14 40

Output:

YES

Explanation:

14 / 40 = 0.35

The decimal representation terminates.


Example 4

Input:

5 14

Output:

NO

Explanation:

5 / 14 = 0.357142857142...

The decimal representation does not terminate.

Constraints

1 ≤ |A|, |B| ≤ 10^18

Discussion

I'm interested in seeing different observations, proofs, and solutions.

  • What property of A and B determines the answer?
  • Is there a mathematical characterization of such fractions?
  • Can it be solved efficiently for very large values?
  • Are there multiple approaches?

Feel free to share your reasoning, proofs, optimizations, or code snippets.

Full text and comments »

  • Vote: I like it
  • -16
  • Vote: I do not like it

By abhi_yo, history, 8 months ago, In English

Hi everyone,

I’m a student doing competitive programming and preparing for placements.

One problem I kept facing was missing contests.
There are so many platforms like Codeforces, LeetCode, CodeChef, etc., and it’s honestly hard to keep track of all contest timings.

Sometimes I realized after the contest was already over

So I decided to build a small tool for myself.

It shows all upcoming contests in one place and helps me keep track of them easily.

Site: https://contesttracker.smartpostai.online/

It’s still simple and I’m improving it.

I would really appreciate your feedback: – Is this useful? – What features would you like? – How do you currently track contests?

Thanks!

Full text and comments »

  • Vote: I like it
  • -2
  • Vote: I do not like it