Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
CommerceIQ referral form !!
https://docs.google.com/forms/d/e/1FAIpQLSeOsNJyOet4O-o3JR45eHWNiSbH2t29ZWwRZKDmRHsjCjdyTg/viewform
https://docs.google.com/forms/d/e/1FAIpQLSeOsNJyOet4O-o3JR45eHWNiSbH2t29ZWwRZKDmRHsjCjdyTg/viewform
Google Docs
CommerceIQ Referral
CommerceIQ is hiring for multiple roles including SDE 1, SDE 2, SDE 3, SDM, Data Scientist and more for Bengaluru and Chennai location. Please go through the open positions from the careers website and fill out this form with all the details for a referral.โฆ
def calc_valency(element):
return sum(map(int, str(sum(map(int, map(str, map(ord, element))))))) % 9 or 9
def balance_compound(compound, eq_point):
elem1, elem2 = compound[0], compound[1]
val1, val2 = calc_valency(elem1), calc_valency(elem2)
results = []
for mult1 in range(1, eq_point // val1 + 1):
rem_point = eq_point - mult1 * val1
if rem_point % val2 == 0:
mult2 = rem_point // val2
results.append(f"{elem1}{mult1} {elem2}{mult2}")
for i in range(len(results) - 2, -1, -1):
print(results[i])
if not results:
print("Not Possible")
compound_input = input().strip()
equivalent_point_input = int(input().strip())
balance_compound(compound_input, equivalent_point_input)
Compound โ
Codevita
return sum(map(int, str(sum(map(int, map(str, map(ord, element))))))) % 9 or 9
def balance_compound(compound, eq_point):
elem1, elem2 = compound[0], compound[1]
val1, val2 = calc_valency(elem1), calc_valency(elem2)
results = []
for mult1 in range(1, eq_point // val1 + 1):
rem_point = eq_point - mult1 * val1
if rem_point % val2 == 0:
mult2 = rem_point // val2
results.append(f"{elem1}{mult1} {elem2}{mult2}")
for i in range(len(results) - 2, -1, -1):
print(results[i])
if not results:
print("Not Possible")
compound_input = input().strip()
equivalent_point_input = int(input().strip())
balance_compound(compound_input, equivalent_point_input)
Compound โ
Codevita
๐1
๐Fullstack Developer Job
BlackLight Studio | Noida, India
Job Type: In-Office
Job Offer: โน 6LPA - 12LPA
Experience: 3+ years
โ Apply here๐ https://cuvette.tech/app/public/job/65605758c756a7f66e2f5dd0?referralCode=8T994D
BlackLight Studio | Noida, India
Job Type: In-Office
Job Offer: โน 6LPA - 12LPA
Experience: 3+ years
โ Apply here๐ https://cuvette.tech/app/public/job/65605758c756a7f66e2f5dd0?referralCode=8T994D
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int solve(string r) {
int c = 0;
for (int i = 0; i < r.size() - 2; i++) {
if (r[i] != r[i+1] && r[i+1] != r[i+2]) {
c++;
}
}
return c;
}
int main() {
string r1, r2;
cin >> r1 >> r2;
if (count(r1.begin(), r1.end(), 'M') + count(r1.begin(), r1.end(), 'L') != r1.size() ||
count(r2.begin(), r2.end(), 'M') + count(r2.begin(), r2.end(), 'L') != r2.size()) {
cout << "Invalid input" << endl;
return 0;
}
int s1 = solve(r1);
int s2 = solve(r2);
if (s1 > s2) {
cout << "Ashok" << endl;
} else if (s2 > s1) {
cout << "Anand" << endl;
} else {
cout << "Draw" << endl;
}
return 0;
}
Orchad โ
Codevita
#include <string>
#include <algorithm>
using namespace std;
int solve(string r) {
int c = 0;
for (int i = 0; i < r.size() - 2; i++) {
if (r[i] != r[i+1] && r[i+1] != r[i+2]) {
c++;
}
}
return c;
}
int main() {
string r1, r2;
cin >> r1 >> r2;
if (count(r1.begin(), r1.end(), 'M') + count(r1.begin(), r1.end(), 'L') != r1.size() ||
count(r2.begin(), r2.end(), 'M') + count(r2.begin(), r2.end(), 'L') != r2.size()) {
cout << "Invalid input" << endl;
return 0;
}
int s1 = solve(r1);
int s2 = solve(r2);
if (s1 > s2) {
cout << "Ashok" << endl;
} else if (s2 > s1) {
cout << "Anand" << endl;
} else {
cout << "Draw" << endl;
}
return 0;
}
Orchad โ
Codevita
Infinite multiplesโ
#include <bits/stdc++.h>
#define int long long
#define endl "\n"
using namespace std;
int K;
void solve(int curr, vector<int> &v, vector<int> &res, vector<vector<int>> &adj){
if(v.size()>=K){
res[curr]=v[v.size()-K];
}
bool flag=0;
if(adj[curr].size()==1){
v.push_back(curr);
flag=1;
}
for(auto &i:adj[curr]){
solve(i,v,res,adj);
}
if(flag){
v.pop_back();
}
}
void gogo(){
int n,k;
cin>>n>>k;
K=k;
vector<int> p(n+1);
for(int i = 2; i <= n; i++){
cin >> p[i];
}
vector<vector<int>> adj(n+1,vector<int>());
for(int i = 2; i <= n; i++){
adj[p[i]].push_back(i);
}
vector<int>v;
vector<int>res(n+1,-1);
solve(1,v,res,adj);
for(int i = 1; i <= n; i++){
cout<<res[i]<<' ';
}
cout<<endl;
}
main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--){
gogo();
}
}
Nice ancestorsโ
#define int long long
#define endl "\n"
using namespace std;
int K;
void solve(int curr, vector<int> &v, vector<int> &res, vector<vector<int>> &adj){
if(v.size()>=K){
res[curr]=v[v.size()-K];
}
bool flag=0;
if(adj[curr].size()==1){
v.push_back(curr);
flag=1;
}
for(auto &i:adj[curr]){
solve(i,v,res,adj);
}
if(flag){
v.pop_back();
}
}
void gogo(){
int n,k;
cin>>n>>k;
K=k;
vector<int> p(n+1);
for(int i = 2; i <= n; i++){
cin >> p[i];
}
vector<vector<int>> adj(n+1,vector<int>());
for(int i = 2; i <= n; i++){
adj[p[i]].push_back(i);
}
vector<int>v;
vector<int>res(n+1,-1);
solve(1,v,res,adj);
for(int i = 1; i <= n; i++){
cout<<res[i]<<' ';
}
cout<<endl;
}
main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--){
gogo();
}
}
Nice ancestorsโ
#include <bits/stdc++.h>
#define int long long
#define endl "\n"
using namespace std;
void gogo(){
int n,x,y;
cin>>n>>x>>y;
int a[n+1];
for(int i=1;i<=n;i++){
cin>>a[i];
}
int dp[n+1]={};
dp[0]=0;
for(int i=1;i<=n;i++){
dp[i]=a[i];
for(int j=1;j<i;j++){
dp[i]=min(dp[i],a[j]+dp[i-j]+x);
}
}
cout<<min(dp[n]+y,a[n])<<endl;
}
main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--){
gogo();
}
}
Woodsโ
#define int long long
#define endl "\n"
using namespace std;
void gogo(){
int n,x,y;
cin>>n>>x>>y;
int a[n+1];
for(int i=1;i<=n;i++){
cin>>a[i];
}
int dp[n+1]={};
dp[0]=0;
for(int i=1;i<=n;i++){
dp[i]=a[i];
for(int j=1;j<i;j++){
dp[i]=min(dp[i],a[j]+dp[i-j]+x);
}
}
cout<<min(dp[n]+y,a[n])<<endl;
}
main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--){
gogo();
}
}
Woodsโ
#include <bits/stdc++.h>
#define int long long
#define endl "\n"
using namespace std;
void gogo(){
int n,q;
cin>>n>>q;
int a[n+1];
for(int i=1;i<=n;i++){
cin>>a[i];
}
int ans[n+1]={};
map<int,int>cnt;
int sum=0;
for(int i=1;i<=n;i++){
cnt[sum-(i-1)]++;
sum+=a[i];
ans[i]=ans[i-1]+cnt[sum-i];
}
int b[q+1];
for(int i=1;i<=q;i++){
cin>>b[i];
cout<<ans[b[i]]<<endl;
}
}
main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--){
gogo();
}
}
Balanced oneโ
#define int long long
#define endl "\n"
using namespace std;
void gogo(){
int n,q;
cin>>n>>q;
int a[n+1];
for(int i=1;i<=n;i++){
cin>>a[i];
}
int ans[n+1]={};
map<int,int>cnt;
int sum=0;
for(int i=1;i<=n;i++){
cnt[sum-(i-1)]++;
sum+=a[i];
ans[i]=ans[i-1]+cnt[sum-i];
}
int b[q+1];
for(int i=1;i<=q;i++){
cin>>b[i];
cout<<ans[b[i]]<<endl;
}
}
main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--){
gogo();
}
}
Balanced oneโ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
#freshersjob | Swati S. | 19 comments
#freshersjob
We at Godrej Infotech are looking to onboard Freshers (B.E /B.Tech) 2023 passout
Office Location - Bangalore
Eligibility Criteria
70% & above throughout 10th, 12th, Diploma & Graduation
(with no Gaps)
Pass out Batch Academic Year 2023
Preferredโฆ
We at Godrej Infotech are looking to onboard Freshers (B.E /B.Tech) 2023 passout
Office Location - Bangalore
Eligibility Criteria
70% & above throughout 10th, 12th, Diploma & Graduation
(with no Gaps)
Pass out Batch Academic Year 2023
Preferredโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Sign Up | LinkedIn
500 million+ members | Manage your professional identity. Build and engage with your professional network. Access knowledge, insights and opportunities.
#include <iostream>
#include <vector>
using namespace std;
int countBalancedSubarrays(const vector<int>& arr, int x) {
int n = arr.size();
vector<int> prefixSum(n + 1, 0);
int count = 0;
for (int i = 0; i < n; ++i) {
prefixSum[i + 1] = prefixSum[i] + arr[i];
}
for (int i = 0; i < x; ++i) {
for (int j = i; j < x; ++j) {
int subarraySum = prefixSum[j + 1] - prefixSum[i];
int subarrayLength = j - i + 1;
if (subarraySum == subarrayLength) {
count++;
}
}
}
return count;
}
int main() {
int t;
cin >> t;
for (int i = 0; i < t; ++i) {
int n, q;
cin >> n >> q;
vector<int> arr(n);
for (int j = 0; j < n; ++j) {
cin >> arr[j];
}
for (int j = 0; j < q; ++j) {
int x;
cin >> x;
int result = countBalancedSubarrays(arr, x);
cout << result << endl;
}
}
return 0;
}
ICPC Balance Subarray โ
#include <vector>
using namespace std;
int countBalancedSubarrays(const vector<int>& arr, int x) {
int n = arr.size();
vector<int> prefixSum(n + 1, 0);
int count = 0;
for (int i = 0; i < n; ++i) {
prefixSum[i + 1] = prefixSum[i] + arr[i];
}
for (int i = 0; i < x; ++i) {
for (int j = i; j < x; ++j) {
int subarraySum = prefixSum[j + 1] - prefixSum[i];
int subarrayLength = j - i + 1;
if (subarraySum == subarrayLength) {
count++;
}
}
}
return count;
}
int main() {
int t;
cin >> t;
for (int i = 0; i < t; ++i) {
int n, q;
cin >> n >> q;
vector<int> arr(n);
for (int j = 0; j < n; ++j) {
cin >> arr[j];
}
for (int j = 0; j < q; ++j) {
int x;
cin >> x;
int result = countBalancedSubarrays(arr, x);
cout << result << endl;
}
}
return 0;
}
ICPC Balance Subarray โ
from collections import deque
def bfs(graph, source, dest):
queue = deque([(source, 0)])
while queue:
node, dist = queue.popleft()
if node == dest:
return dist
for neighbor in graph[node]:
if neighbor != node:
queue.append((neighbor, dist + 1))
return -1
def solve():
t = int(input())
for _ in range(t):
n = int(input())
a, b, c = map(int, input().split())
graph = {}
for _ in range(n - 1):
x, y = map(int, input().split())
if x not in graph:
graph[x] = []
if y not in graph:
graph[y] = []
graph[x].append(y)
graph[y].append(x)
atoc = bfs(graph, a, c)
btoc = bfs(graph, b, c)
atob = bfs(graph, a, b)
if atoc < btoc:
print("A")
elif atob < atoc:
print("B")
elif btoc < atoc:
print("C")
else:
print("DRAW")
if name == "main":
solve()
Three Person โ ICPC
def bfs(graph, source, dest):
queue = deque([(source, 0)])
while queue:
node, dist = queue.popleft()
if node == dest:
return dist
for neighbor in graph[node]:
if neighbor != node:
queue.append((neighbor, dist + 1))
return -1
def solve():
t = int(input())
for _ in range(t):
n = int(input())
a, b, c = map(int, input().split())
graph = {}
for _ in range(n - 1):
x, y = map(int, input().split())
if x not in graph:
graph[x] = []
if y not in graph:
graph[y] = []
graph[x].append(y)
graph[y].append(x)
atoc = bfs(graph, a, c)
btoc = bfs(graph, b, c)
atob = bfs(graph, a, b)
if atoc < btoc:
print("A")
elif atob < atoc:
print("B")
elif btoc < atoc:
print("C")
else:
print("DRAW")
if name == "main":
solve()
Three Person โ ICPC
#include<bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> cust;
for(int i = 0; i < n; i++) {
int q, p;
cin >> q >> p;
cust.push_back({p, q});
}
vector<vector<int>> rice;
for(int i = 0; i < m; i++) {
int q, p;
cin >> q >> p;
rice.push_back({p, q});
}
sort(cust.begin(), cust.end());
sort(rice.begin(), rice.end());
vector<int> x(m, 0);
int ans = 0;
for(int i = 0; i < n; i++) {
int quantity = -1;
int index = -1;
for(int j = 0; j < m; j++) {
if (!x[j]) {
if (rice[j][0] > cust[i][0]) break;
if (rice[j][1] > cust[i][1]) {
if (quantity == -1) {
quantity = rice[j][1];
index = j;
} else {
if (quantity > rice[j][1]) {
index = j;
quantity = rice[j][1];
}
}
}
}
}
if (index != -1) {
x[index] = 1;
ans++;
}
}
cout << ans;
}
Super market Codevita โ
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> cust;
for(int i = 0; i < n; i++) {
int q, p;
cin >> q >> p;
cust.push_back({p, q});
}
vector<vector<int>> rice;
for(int i = 0; i < m; i++) {
int q, p;
cin >> q >> p;
rice.push_back({p, q});
}
sort(cust.begin(), cust.end());
sort(rice.begin(), rice.end());
vector<int> x(m, 0);
int ans = 0;
for(int i = 0; i < n; i++) {
int quantity = -1;
int index = -1;
for(int j = 0; j < m; j++) {
if (!x[j]) {
if (rice[j][0] > cust[i][0]) break;
if (rice[j][1] > cust[i][1]) {
if (quantity == -1) {
quantity = rice[j][1];
index = j;
} else {
if (quantity > rice[j][1]) {
index = j;
quantity = rice[j][1];
}
}
}
}
}
if (index != -1) {
x[index] = 1;
ans++;
}
}
cout << ans;
}
Super market Codevita โ
#include <stdio.h>
int cd=0,ca=0;
void bd(int array[], int n) {
for (int step = 0; step < n - 1; ++step) {
for (int i = 0; i < n - step - 1; ++i) {
if (array[i] < array[i + 1]) {
int temp = array[i];
array[i] = array[i + 1];
array[i + 1] = temp;
cd++;
}
}
}
}
void ba(int array[], int n) {
for (int step = 0; step < n - 1; ++step) {
for (int i = 0; i < n - step - 1; ++i) {
if (array[i] > array[i + 1]) {
int temp = array[i];
array[i] = array[i + 1];
array[i + 1] = temp;
ca++;
}
}
}
}
int main() {
int n;
scanf("%d",&n);
int da[n],dd[n];
for(int i=0;i<n;i++){
scanf("%d",&da[i]);
dd[i]=da[i];
}
ba(dd, n);
bd(da, n);
if(cd>ca)
printf("%d",ca);
else
printf("%d",cd);
}
Best Bubble Codevita โ
int cd=0,ca=0;
void bd(int array[], int n) {
for (int step = 0; step < n - 1; ++step) {
for (int i = 0; i < n - step - 1; ++i) {
if (array[i] < array[i + 1]) {
int temp = array[i];
array[i] = array[i + 1];
array[i + 1] = temp;
cd++;
}
}
}
}
void ba(int array[], int n) {
for (int step = 0; step < n - 1; ++step) {
for (int i = 0; i < n - step - 1; ++i) {
if (array[i] > array[i + 1]) {
int temp = array[i];
array[i] = array[i + 1];
array[i + 1] = temp;
ca++;
}
}
}
}
int main() {
int n;
scanf("%d",&n);
int da[n],dd[n];
for(int i=0;i<n;i++){
scanf("%d",&da[i]);
dd[i]=da[i];
}
ba(dd, n);
bd(da, n);
if(cd>ca)
printf("%d",ca);
else
printf("%d",cd);
}
Best Bubble Codevita โ
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
BNY Mellon Code Divas Diversity Challenge
Role: Software Developer
Batch eligible: 2024, 2025 and 2026 passouts
Apply: https://assessment.hackerearth.com/challenges/new/hiring/bny-mellon-women-challenge-2023/
Role: Software Developer
Batch eligible: 2024, 2025 and 2026 passouts
Apply: https://assessment.hackerearth.com/challenges/new/hiring/bny-mellon-women-challenge-2023/
HackerEarth
BNY Mellon Code Divas Diversity Challenge
Update - The test has been concluded early after a great participation volumn by candidates. An official email has been sent to you by HackerEarth informing the same.
BNY Mellon invites you to participate in the transformative challenge - Code Divas. Ourโฆ
BNY Mellon invites you to participate in the transformative challenge - Code Divas. Ourโฆ
๐1