oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

stoning Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

reverse.html

Problem Description

Sijiejie has acquired a new collection of "Mathematics - Statistics" Textbooks!

He realises that the books have a mean weight of 2980 grams and standard deviation 1000g. Don't worry, being a math geek, Sijiejie has already calculated the normal distribution curve for this set of books.

To verify his calculations, Sijiejie needs to physically take out a stash of them and weigh! Alas, he lives in the stone age, so he only has access to balances.

Sijiejie needs to go collect some stones to weigh the books. But Sijiejie is lazy. He wants to collect the least number of stones such that he can weigh EVERY book <= N grams.

To clarify, there are stones of any integral weight. Also, Sijiejie can only put stones on one side of the weight balance.

Input

There will only be one number, N, the maximum weight that Sijiejie has to weigh.

Output

A single line, the minimum number of stones that he needs.

Subtasks

Subtask 1 (20%): max weight is guaranteed to be ≤298g each.

Subtask 2 (30%): max weight is guaranteed to be ≤99999g each.

Subtask 3 (50%): max weight is guaranteed to be ≤2^31kg each.

Subtask 4 (0%) will be the sample testcase

Sample Testcase 1

Input

6

Output

3

Explanation: 3 stones are needed to weigh any weight less than or equal to 6g. They are: 1g, 2g, 3g.
To weigh 1 gram, he uses a stone of 1g.
To weigh 2 grams, he uses a stone of 2g.
To weigh 3 grams, he uses a stone of 3g.
To weigh 4 grams, he uses a 1g stone and a 3g stone.
To weigh 5 grams, he uses a 2g stone and a 3g stone.
To weigh 6 grams, he uses all 3 stones.

balance.jpg

Tags

Number Theory

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
120401s32MBMinimum
230401s32MBMinimum
350401s32MBMinimum
4011s32MBMinimum

Judge Compile Command

g++-8 ans.cpp -o stoning -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.