From 09bdc1e4967ec8c84926ab0aac09be9eb7663b5d Mon Sep 17 00:00:00 2001 From: Ojaswi Awasthi <65769340+Ojaswi2000@users.noreply.github.com> Date: Wed, 23 Dec 2020 02:50:23 +0530 Subject: [PATCH 1/3] added the november files --- NOV20B/ADADISH.cpp | 42 ++++++++++++++++++++++++++++++++ NOV20B/Restore.java | 58 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 NOV20B/ADADISH.cpp create mode 100644 NOV20B/Restore.java diff --git a/NOV20B/ADADISH.cpp b/NOV20B/ADADISH.cpp new file mode 100644 index 0000000..e1be363 --- /dev/null +++ b/NOV20B/ADADISH.cpp @@ -0,0 +1,42 @@ +/* + Link to the problem: + https://www.codechef.com/NOV20B/problems/ADADISH + Link to my profile: + https://www.codechef.com/users/oj_17 +*/ + + +#include +#include +using namespace std; + +int main() { + int t; + cin>>t; + while(t--) + { + int n; + cin>>n; + int arr[n]; + for(int i=0;i>arr[i]; + int x=0,y=0; + sort(arr,arr+n,greater()); + x=arr[0]; + for(int i=1;iy) + cout <x) + cout<v=new ArrayList<>(); + static boolean primes[]=new boolean[max+1]; + public static void generatePrimes() + { + + for(int i=0;i<=max;i++) + primes[i]=true; + for(int p=2;p*p<=max;p++) + { + if(primes[p]==true) + { + for(int i=p*p;i<=max;i+=p) + primes[i]=false; + } + } + for(int i=2;i<=max;i++) + { + if(primes[i]==true) + v.add(i); + } + } + public static void main (String[] args) throws java.lang.Exception + { + Scanner sc=new Scanner(System.in); + int t=sc.nextInt(); + generatePrimes(); + while (t-- >0) + { + int n=sc.nextInt(); + int b[]=new int[n]; + ArrayList a=new ArrayList<>(); + HashMapm=new HashMap<>(); + for(int i=0;i Date: Wed, 23 Dec 2020 02:53:56 +0530 Subject: [PATCH 2/3] Update Restore.java --- NOV20B/Restore.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/NOV20B/Restore.java b/NOV20B/Restore.java index 5624af2..6f412aa 100644 --- a/NOV20B/Restore.java +++ b/NOV20B/Restore.java @@ -1,3 +1,10 @@ + +/* + Link to the problem: + https://www.codechef.com/NOV20B/problems/ADADISH + Link to my profile: + https://www.codechef.com/users/oj_17 +*/ import java.util.*; import java.lang.*; import java.io.*; @@ -55,4 +62,4 @@ public static void main (String[] args) throws java.lang.Exception System.out.println(); } } -} \ No newline at end of file +} From a2954f360c3579b01be158e02505a5daff57af40 Mon Sep 17 00:00:00 2001 From: Ojaswi Awasthi <65769340+Ojaswi2000@users.noreply.github.com> Date: Wed, 23 Dec 2020 02:55:54 +0530 Subject: [PATCH 3/3] Update Restore.java --- NOV20B/Restore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NOV20B/Restore.java b/NOV20B/Restore.java index 6f412aa..bc395f5 100644 --- a/NOV20B/Restore.java +++ b/NOV20B/Restore.java @@ -1,7 +1,7 @@ /* Link to the problem: - https://www.codechef.com/NOV20B/problems/ADADISH + https://www.codechef.com/NOV20B/problems/RESTORE Link to my profile: https://www.codechef.com/users/oj_17 */