hrishabhpatel09's blog

By hrishabhpatel09, history, 9 months ago, In English

Given n students that are connected by edges. We have to find the maxiumum number of answers that can be passed.

An answer is said to be passed if it reaches every student.

There are 3 constraints:-

  • You can give only one answer to a particular student.
  • Student who recieved the answer directly from you, can share it with thier immediate neigbours.
  • Student who recvied the answer indirectly (not from you) cannot share it with anyone.

So we have to find the maxiumum number of answer that can be passed.

for example:

n = 3

1 — 2

2 — 3

ans1 can be given to student no 2, so he can pass it to student 1 and 3.

ans2 can be given to student 1 and 3 so they can pass it to student 3.

In both of the cases answer reaches all the students and you haven't given more than one answer directly to any student.

So the answer will be 2

Constraints:

n <=15

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By hrishabhpatel09, history, 11 months ago, In English

I have submitted a solution for this problem 1349A - Orac and LCM and got AC wondering if this is really a property?

Submission: 321223203

i figured out that i can write:

GCD( lcm(a1,a2), lcm(a1,a3), lcm(a1,a4) ... lcm(a1,an)) = LCM(a1, GCD(a2,a3,a4,a5,...an))

Full text and comments »

  • Vote: I like it
  • +7
  • Vote: I do not like it

By hrishabhpatel09, history, 14 months ago, In English
  • Vote: I like it
  • +2
  • Vote: I do not like it