Codeforces|Leetcode|Codechef free solutions
Open in Telegram
Free codeforces, Codechef, Leetcode solutions are available 😍😍😍😍😍😍 Helped More than 200+ students to crack coding round in 2022 and helped placed them in Good companies. 🥳🥳🥳🤩🤩🤩 Dm @Cpsoln if you want help in coding round.
Show more4 317
Subscribers
No data24 hours
-137 days
-5230 days
Posts Archive
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,m,sum,z,x,ans;
int t;
int a[200005];
map<int,int> v,p;
vector<int> q;
void solve(){
cin>>n;
v=p;
q.clear();
m=1;
ans=z=0;
for(int i=1;i<=n;i++){
cin>>x;
for(int j=2;j<=sqrt(x);j++){
if(!v[j]&&x%j==0){
q.push_back(j);
}
while(x%j==0){
v[j]++;
x/=j;
}
}
if(x!=1){
if(!v[x])
{
q.push_back(x);
}
v[x]++;
}
}
for(int i=0;i<q.size();i++)
{
ans+=v[q[i]]%2;
z+=v[q[i]]/2;
}
cout<<ans/3+z<<endl;
}
int main() {
int t;
cin >> t;
while (t--) {
solve();}
return 0;
}
Aur kisi channel parr bharosa matt krna doston woh apka paisa leke bhag jayenge kyuki unhe hello print krne nhi aata aur woh De shaw intuit jaisi company mai kaise karwayenge
📌📌📌📌📌📌📌📌📌📌📌
Don't trust on other channels
Repost from Codeforces|Leetcode|Codechef free solutions
Since your placement and intern session is coming 🤓🤓
So don't miss any opportunity in this recession😇😇😇😇
📌📌📌📌📌📌📌📌📌📌📌📌
No scam No fraud because we are not like other telegram channels.
If you want help in coding round of any company then Dm @Cpsoln and book your slot ✅✅✅✅
#include <math.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
int main() {
long long t;
cin >> t;
while (t--) {
long long n, k;
cin >> n;
cin >> k;
vector<int> vec(n + 1);
for (int i = 1; i <= n; i++) {
cin >> vec[i];
}
int count = 0;
for (int i = 1; i <= n; i++) {
if ((vec[i] - i) % k != 0) {
count++;
}
}
if (count == 0) {
cout << 0 << endl;
} else if (count <= 2) {
cout << 1 << endl;
} else {
cout << -1 << endl;
}
}
}
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int x;
cin >> x;
bool found_triplet = false;
for (int a = 1; a <= x; a++) {
for (int b = 1; b <= x; b++) {
int c = x - a*b;
if (c >= 1 && c <= x) {
cout << a << " " << b << " " << c << "\n";
found_triplet = true;
break;
}
}
if (found_triplet) {
break;
}
}
if (!found_triplet) {
cout << "-1\n";
}
}
return 0;
}
If anyone want to buy this 4 star account then dm @Cpsoln
Repost from Codeforces|Leetcode|Codechef free solutions
Since your placement and intern session is coming 🤓🤓
So don't miss any opportunity in this recession😇😇😇😇
📌📌📌📌📌📌📌📌📌📌📌📌
No scam No fraud because we are not like other telegram channels.
If you want help in coding round of any company then Dm @Cpsoln and book your slot ✅✅✅✅
A-D free code mila guys. Aage channel share kroge ya nhi?
