From 3b5931ec72bf96a7bd7624cd84b6abcdc5a70b08 Mon Sep 17 00:00:00 2001 From: saida Date: Sun, 26 Oct 2025 21:11:07 +0600 Subject: [PATCH 1/2] added a SPOJ website folder and solution to a problem inside it --- SPOJ/DANGER.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 SPOJ/DANGER.cpp diff --git a/SPOJ/DANGER.cpp b/SPOJ/DANGER.cpp new file mode 100644 index 00000000..81cc3e13 --- /dev/null +++ b/SPOJ/DANGER.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; + +int main() +{ + while (true) + { + string s; + cin >> s; + if (s == "00e0") + break; + + int n = stod(s); + int a = floor(log2(n)); + int l = n - pow(2, a); + int result = 2 * l + 1; + + cout << result << endl; + } +} \ No newline at end of file From 7ba5c9d86b9cdf4dd21755967402181affb525bf Mon Sep 17 00:00:00 2001 From: Saida Jahan <161928308+sasasaida@users.noreply.github.com> Date: Sun, 26 Oct 2025 21:16:07 +0600 Subject: [PATCH 2/2] Add muself to contributors list --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 791a2e2c..4e74f727 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ In this repository, you can find the solutions (as source code) for the problems | [Nauman Chaudhary](https://github.com/nauman-chaudhary)
| Pakistan | Python | | | [Gourav Rusiya](https://github.com/GouravRusiya30)
| India | Java | https://www.hackerrank.com/gouravrusiya786 | | [Trushita Maurya](https://github.com/trushita23)
| India | Java +| [Saida Jahan](https://github.com/sasasaida)
| Bangladesh | C++, Python ### License [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/ows-ali/Hacktoberfest/blob/master/LICENSE)