diff options
| author | Abigail <abigail@abigail.be> | 2020-09-21 23:41:49 +0200 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2020-09-21 23:41:49 +0200 |
| commit | 83467b231b615df2bc7e5832bf0e6fb7344f7b6d (patch) | |
| tree | d2c5705d7034271f8fee7f4743e407d25c0a2638 | |
| parent | 88acc407f4db3e21ac6701f49886728f2dc846b2 (diff) | |
| download | perlweeklychallenge-club-83467b231b615df2bc7e5832bf0e6fb7344f7b6d.tar.gz perlweeklychallenge-club-83467b231b615df2bc7e5832bf0e6fb7344f7b6d.tar.bz2 perlweeklychallenge-club-83467b231b615df2bc7e5832bf0e6fb7344f7b6d.zip | |
Answer should be modded with 1000000007.
| -rw-r--r-- | challenge-079/abigail/node/ch-1.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/challenge-079/abigail/node/ch-1.js b/challenge-079/abigail/node/ch-1.js index 6c9ca09ace..7d5f18664a 100644 --- a/challenge-079/abigail/node/ch-1.js +++ b/challenge-079/abigail/node/ch-1.js @@ -19,6 +19,9 @@ // bits (2 * N + 1) = 2 * bits (N) + N + 1 // + +let BIG_NUM = 1000000007; + // // Create an interface to read from STDIN // @@ -30,7 +33,7 @@ const rl = require ('readline') . createInterface ({ // Read lines of input, calculate the result, and print it. // rl . on ('line', (line) => { - console . log (bits (+line)); // Unary + numifies + console . log (bits (+line) % BIG_NUM); // Unary + numifies }); |
