From 96271135b51b3dd57d73b4cd305510d44db6f485 Mon Sep 17 00:00:00 2001 From: Shreyas Vishwakarma <73514168+ShreyasV7@users.noreply.github.com> Date: Wed, 6 Oct 2021 12:03:24 +0530 Subject: [PATCH] Josephus_Problem.cpp --- josephus_problem_1.cpp | 78 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 josephus_problem_1.cpp diff --git a/josephus_problem_1.cpp b/josephus_problem_1.cpp new file mode 100644 index 0000000..b542cfd --- /dev/null +++ b/josephus_problem_1.cpp @@ -0,0 +1,78 @@ +#include +using namespace std; + +#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); +#define time cerr<<"Time taken : " <<(float)clock()/CLOCKS_PER_SEC <<" secs"<<"\n" ; +#define F first +#define S second +#define pb push_back +typedef long long int ll ; + + +const ll INF = (ll)1e18 ; +const ll MOD = (ll)1e9 + 7 ; + + +void solve() { + + int n; + cin >> n ; + + vectorarr(n) ; + + for(int i=0 ; i 1 ){ + + vectors ; + for(int i=0 ;i> t; + + while (t--) { + solve() ; + } + + + return 0 ; +}