RUN WITH INPUT #include <bits/stdc++.h> using namespace std; long minf(vector<long> arr){ long max=arr[0]; for(long i=0;i<arr.size();i++){ if(arr[i]<=max){ max=arr[i]; } } return max; } long sumf(vector<long> arr){ long sum=0; for(long i=0;i<arr.size();i++){ sum=sum+arr[i]Read more
RUN WITH INPUT
#include <bits/stdc++.h>
using namespace std;
long minf(vector<long> arr){
long max=arr[0];
for(long i=0;i<arr.size();i++){
if(arr[i]<=max){
max=arr[i];
}
}
return max;
}
long sumf(vector<long> arr){
long sum=0;
for(long i=0;i<arr.size();i++){
sum=sum+arr[i];
}
return sum;
}
long maxf(vector<long> arr){
long max=arr[0];
for(long i=0;i<arr.size();i++){
if(arr[i]>=max){
max=arr[i];
}
}
return max;
}
int isPrime(int n)
{
if(n%2==0){
return 0;
}
for (int i = 3; i <= sqrt(n);){
if (n % i == 0)
return 0;
i=i+2;
}
return 1;
}
int main() {
// your code goes here
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t=0;
cin>>t;
for(;t>0;t--){
int n=0;
cin>>n;
vector<int> arr;
for(int i=0;i<n;i++){
int temp=0;
cin>>temp;
arr.push_back(temp);
}
for(int i=2;i<999999999;i++){
int flag=0;
//cout<<i<<endl;
if(isPrime(i)==1){
for(int j=0;j<arr.size();j++){
if(arr[j]%i==0){
flag=1;
break;
}
}
if(flag==0){
cout<<i<<endl;
break;
}
}
}
}
return 0;
}
Assume that you have the following processes all arriving at time 0: Process Burst Priority P1 8 4 P2 …
You can get your answer by just tapping on the attachment button: Support Us By Voting Up Answers!
You can get your answer by just tapping on the attachment button:
Support Us By Voting Up Answers!
See lessML is a field of AI consisting of learning algorithms that?
ANSWER => 1.Improve their performance 2.At executing some task 3.Over time with experience
ANSWER =>
1.Improve their performance
2.At executing some task
3.Over time with experience
See lessThe new source of big data that will trigger a Big Data revolution in theyears to come is?
ANSWER => Transactional data and sensor data
ANSWER => Transactional data and sensor data
See lessAccording to analysts, for what can traditional IT systems provide afoundation when they’re integrated with big data technologies like Hadoop?
ANSWER => Big data management and data mining
ANSWER => Big data management and data mining
See lessData in _____ bytes size is called Big Data.
ANSWER => Peta
ANSWER => Peta
See lessYou’re given an array of NN elements. You need to find the MEXMEX of the prime divisors of the array, which is defined as …
RUN WITH INPUT #include <bits/stdc++.h> using namespace std; long minf(vector<long> arr){ long max=arr[0]; for(long i=0;i<arr.size();i++){ if(arr[i]<=max){ max=arr[i]; } } return max; } long sumf(vector<long> arr){ long sum=0; for(long i=0;i<arr.size();i++){ sum=sum+arr[i]Read more
RUN WITH INPUT
See less