HiCode2009's blog

By HiCode2009, history, 2 years ago, In English

As we know,each fraction can be expressed as the sum of multiple unit fractions.

$$$\frac{p}{q}=\frac{1}{a_1}+\frac{1}{a_2}+...+\frac{1}{a_n}$$$

When we want to express a fraction as the sum of multiple unit fractions,we can use a greedy algorithm invented by Fibonacci,subtract the maximum unit fraction which is smaller than this fraction from this fraction.For example,$$$\frac{13}{14}=\frac{1}{2}+\frac{1}{3}+\frac{1}{11}+\frac{1}{231}$$$.

But when we want to find out the minimum value of $$$n$$$,things may be different.Can Fibonacci's greedy algorithm still work?

Full text and comments »

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

By HiCode2009, history, 2 years ago, In English

https://codeforces.me/contest/4/submission/174376175

My code:Check if sumtime is in $$$[minsum,maxsum]$$$,minsum is the sum of all the $$$mintime$$$ and maxsum is the sum of all the $$$maxtime$$$.Then greedy for the solution.

Full text and comments »

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

By HiCode2009, history, 2 years ago, In English

CF1108B

First submission

Second submission

Don't laugh at where I have defined the variables.I did that many months ago,code style unlike now.

We can use sort after changing the divisors' value,but the code which changes them to -14248 runs faster.It's 15ms faster than the other.Why is this happening?

Full text and comments »

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

By HiCode2009, history, 2 years ago, In English

I'm not good at English.Sometimes I even spend more than ten minutes reading the problems during contests,so I always have more penalties than others.

I know most of the English words in the problem,but it's difficult for me to understand what the whole text is saying.

I'm Chinese,and our country has its own language.Thus,not everyone need to learn English well.In my opinion,English is only a subject in our school.Now I'm a middle school student,I realized that I was wrong,but it's too late.When I am a primary school student,my classmates and I hope we can go to Nanjing Foreign Language School,which is the best middle school in our city.We worked hard for it,I know the meanings of many words,but for some of them I don't know how and where to use these words.I fill those blanks with my intuition.If my intuition was right then I got high score.

Being not good at English for many years make me hate English classes.I want to listen carefully to the teachers,but I cannot do it.My rating is dropping only because I can't understand the problems in the contests.

Full text and comments »

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

By HiCode2009, history, 2 years ago, In English

Ela's Fitness and the Luxury Number

https://codeforces.me/contest/1737/submission/176165907

You may say I have defined $$$lcge$$$ in the wrong place,but that's even worse:https://codeforces.me/contest/1737/submission/176166395

I think it should get Accepted,so some of the details are wrong?

Full text and comments »

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

By HiCode2009, history, 2 years ago, In English

https://atcoder.jp/contests/abc161/submissions/35445063

I think it is obviously a greedy algorithm problem.

Full text and comments »

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