From 83467b231b615df2bc7e5832bf0e6fb7344f7b6d Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 21 Sep 2020 23:41:49 +0200 Subject: Answer should be modded with 1000000007. --- challenge-079/abigail/node/ch-1.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 }); -- cgit