#include <bits/stdc++.h>
using namespace std;
unsigned int single_digit_sum(int num) {
while (num >= 10) {
int sum = 0;
while (num > 0) {
sum += num % 10;
num /= 10;
}
num = sum;
}
return num;
}
unsigned int quotient(int** a, int n, int p, int q) {
unsigned int diagonal_sum = 0;
for (int i = 0; i < n; ++i) {
diagonal_sum += a[i][i];
}
unsigned int single_digit = single_digit_sum(a[p][q]);
return diagonal_sum / single_digit;
}
int main() {
int i, j, p, q;
int n;
cin >> n;
int** a = new int*[n];
for (i = 0; i < n; ++i) {
a[i] = new int[n];
}
for (i = 0; i < n; ++i) {
for (j = 0; j < n; ++j) {
cin >> a[i][j];
}
}
cin >> p >> q;
cout << quotient(a, n, p, q);
for (i = 0; i < n; ++i) {
delete[] a[i];
}
delete[] a;
return 0;
}
Principal FTE โ
using namespace std;
unsigned int single_digit_sum(int num) {
while (num >= 10) {
int sum = 0;
while (num > 0) {
sum += num % 10;
num /= 10;
}
num = sum;
}
return num;
}
unsigned int quotient(int** a, int n, int p, int q) {
unsigned int diagonal_sum = 0;
for (int i = 0; i < n; ++i) {
diagonal_sum += a[i][i];
}
unsigned int single_digit = single_digit_sum(a[p][q]);
return diagonal_sum / single_digit;
}
int main() {
int i, j, p, q;
int n;
cin >> n;
int** a = new int*[n];
for (i = 0; i < n; ++i) {
a[i] = new int[n];
}
for (i = 0; i < n; ++i) {
for (j = 0; j < n; ++j) {
cin >> a[i][j];
}
}
cin >> p >> q;
cout << quotient(a, n, p, q);
for (i = 0; i < n; ++i) {
delete[] a[i];
}
delete[] a;
return 0;
}
Principal FTE โ
๐1
int Max (int N, int K, vector<int> arr) {
vector<int> b(N + 1, 0);
vector<int> c;
int cnt = 0;
for (int i = 1; i <= N; ++i) {
if (arr[i - 1] % 2 == 1) {
b[i] = 1;
} else {
b[i] = -1;
}
}
for (int i = 1; i <= N; ++i) {
b[i] += b[i - 1];
}
for (int i = 1; i < N; ++i) {
if (b[i] == 0) {
c.push_back(abs(arr[i] - arr[i - 1]));
}
}
sort(c.begin(), c.end());
int pt = 0, cost = 0;
while (pt < c.size() && cost + c[pt] <= K) {
cost += c[pt];
++pt;
}
return pt;
}
max separations
โ
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1000000;
vector<long long> dp(MAXN + 1, 0);
void precompute() {
dp[1] = 1;
for (int i = 1; i <= MAXN; i++) {
for (int j = 2 * i; j <= MAXN; j += i) {
dp[j] += dp[i];
}
}
}
class Precompute {
public:
Precompute() {
precompute();
}
};
Precompute pre;
long long solve(int N) {
return dp[N];
}
Islands
BT Group โ
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
long long findMaxRequests(int N, vector<int>& A, vector<int>& L, vector<int>& R) {
map<int, long long> events;
for (int i = 0; i < N; i++) {
events[L[i]] += A[i];
events[R[i]] -= A[i];
}
long long c = 0;
long long m = 0;
for (auto& event : events) {
c += event.second;
m = max(m, c);
}
return m;
}
Server Capability โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
https://www.linkedin.com/posts/usha-subba-5598538a_sewaro-is-hiring-new-requirements-activity-7238819095876386816-FK36?utm_source=share&utm_medium=member_desktop
!! Sewaro is Hiring !!
New Requirements Alert ๐จ
Freshers can Apply
job mode - hybrid
location - Pune , Baner
pls fill the below form ๐
https://lnkd.in/dPf5E5hb
!! Sewaro is Hiring !!
New Requirements Alert ๐จ
Freshers can Apply
job mode - hybrid
location - Pune , Baner
pls fill the below form ๐
https://lnkd.in/dPf5E5hb
Linkedin
Usha Subba on LinkedIn: !! Sewaro is Hiring !!
New Requirements Alert ๐จ
Freshers can Apply
jobโฆ | 14 comments
New Requirements Alert ๐จ
Freshers can Apply
jobโฆ | 14 comments
!! Sewaro is Hiring !!
New Requirements Alert ๐จ
Freshers can Apply
job mode - hybrid
location - Pune , Baner
Radhika Subba Sewaro HR Solutions SEWAROโฆ | 14 comments on LinkedIn
New Requirements Alert ๐จ
Freshers can Apply
job mode - hybrid
location - Pune , Baner
Radhika Subba Sewaro HR Solutions SEWAROโฆ | 14 comments on LinkedIn
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
https://www.linkedin.com/posts/bhavana-bhavana-5b024a188_greeting-from-quess-corp-we-are-hiring-for-activity-7238787314640900096-xfph?utm_source=share&utm_medium=member_desktop
Greeting from Quess corp
We are hiring for one of our reputed client for Desktop management
Fresher only 2022, 2023 and 2024 batch
WFO /WFH โ WFO
Work Timings โ 6:30 PM โ 4 AM IST Both the way cab will be provided
Work Location โ Bangalore
CTC - 21900 Monthly
Job Description โ Desktop Support Management.
Summary: As an Application Support Engineer, you will be responsible for identifying and solving issues within multiple components of critical business systems. Your typical day will involve providing support for Microsoft Windows Desktop Management and ensuring smooth functioning of the systems
Greeting from Quess corp
We are hiring for one of our reputed client for Desktop management
Fresher only 2022, 2023 and 2024 batch
WFO /WFH โ WFO
Work Timings โ 6:30 PM โ 4 AM IST Both the way cab will be provided
Work Location โ Bangalore
CTC - 21900 Monthly
Job Description โ Desktop Support Management.
Summary: As an Application Support Engineer, you will be responsible for identifying and solving issues within multiple components of critical business systems. Your typical day will involve providing support for Microsoft Windows Desktop Management and ensuring smooth functioning of the systems
Linkedin
Bhavana Bhavana on LinkedIn: Greeting from Quess corp
We are hiring for one of our reputed client forโฆ | 37 comments
We are hiring for one of our reputed client forโฆ | 37 comments
Greeting from Quess corp
We are hiring for one of our reputed client for Desktop managementโฆ | 37 comments on LinkedIn
We are hiring for one of our reputed client for Desktop managementโฆ | 37 comments on LinkedIn
๐1
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int solution(const vector<int>& A, const vector<int>& B) {
int N = A.size();
vector<vector<int>> dp(2, vector<int>(N));
dp[0][0] = A[0];
dp[1][0] = max(A[0], B[0]);
for (int j = 1; j < N; ++j) {
dp[0][j] = max(dp[0][j - 1], A[j]);
dp[1][j] = min(max(dp[0][j], B[j]), max(dp[1][j - 1], B[j]));
}
return dp[1][N - 1];
}
Amex โ
#include <vector>
#include <algorithm>
using namespace std;
int solution(const vector<int>& A, const vector<int>& B) {
int N = A.size();
vector<vector<int>> dp(2, vector<int>(N));
dp[0][0] = A[0];
dp[1][0] = max(A[0], B[0]);
for (int j = 1; j < N; ++j) {
dp[0][j] = max(dp[0][j - 1], A[j]);
dp[1][j] = min(max(dp[0][j], B[j]), max(dp[1][j - 1], B[j]));
}
return dp[1][N - 1];
}
Amex โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <set>
#include <iomanip>
#include <sstream>
using namespace std;
bool isInteresting(const string& timeStr) {
set<char> uniqueDigits;
for (char ch : timeStr) {
if (ch != ':') {
uniqueDigits.insert(ch);
}
}
return uniqueDigits.size() <= 2;
}
void incrementTime(int& hh, int& mm, int& ss) {
ss++;
if (ss == 60) {
ss = 0;
mm++;
}
if (mm == 60) {
mm = 0;
hh++;
}
if (hh == 24) {
hh = 0;
}
}
string timeToString(int hh, int mm, int ss) {
ostringstream oss;
oss << setw(2) << setfill('0') << hh << ":"
<< setw(2) << setfill('0') << mm << ":"
<< setw(2) << setfill('0') << ss;
return oss.str();
}
int solve(const string& S, const string& T) {
int shh = stoi(S.substr(0, 2));
int smm = stoi(S.substr(3, 2));
int sss = stoi(S.substr(6, 2));
int ehh = stoi(T.substr(0, 2));
int emm = stoi(T.substr(3, 2));
int ess = stoi(T.substr(6, 2));
int interestingCount = 0;
while (true) {
string currentTime = timeToString(shh, smm, sss);
if (isInteresting(currentTime)) {
interestingCount++;
}
if (shh == ehh && smm == emm && sss == ess) {
break;
}
incrementTime(shh, smm, sss);
}
return interestingCount;
}
Amex โ
long long solve(int n, int** A) {
vector<pair<int, int>> vp;
vp.push_back({-1, 0});
for (int i = 0; i < n; i += 1) {
vp.push_back({A[i][1], A[i][2]});
}
sort(vp.begin(), vp.end());
auto check = [&] (int mid) {
long long dishes = 0;
for (int i = 1; i <= n; i += 1) {
dishes += static_cast<long long>(vp[i].first - vp[i - 1].first) * mid;
if (vp[i].second > dishes)
return false;
else
dishes -= vp[i].second;
}
return true;
};
int l = 0, r = 1e9;
while (r - l > 1) {
int mid = (l + r) / 2;
if (!check(mid))
l = mid;
else
r = mid;
}
return r;
}
Chef and ordering โ
vector<pair<int, int>> vp;
vp.push_back({-1, 0});
for (int i = 0; i < n; i += 1) {
vp.push_back({A[i][1], A[i][2]});
}
sort(vp.begin(), vp.end());
auto check = [&] (int mid) {
long long dishes = 0;
for (int i = 1; i <= n; i += 1) {
dishes += static_cast<long long>(vp[i].first - vp[i - 1].first) * mid;
if (vp[i].second > dishes)
return false;
else
dishes -= vp[i].second;
}
return true;
};
int l = 0, r = 1e9;
while (r - l > 1) {
int mid = (l + r) / 2;
if (!check(mid))
l = mid;
else
r = mid;
}
return r;
}
Chef and ordering โ
from math import ceil
def getMinDifference(n, e1, t1, e2, c):
res = float('inf')
energy_list = [e1 * i for i in range(n + 1)]
for i in range(n + 1):
lift = i * t1
energy = energy_list[i]
if energy < (n - i) * e2:
continue
steps = 0
steps_list = [ceil(c / energy) for _ in range(n - i)]
energy -= sum(steps_list) * e2
res = min(res, abs(lift - sum(steps_list)))
return res
Meesho โ
def getMinDifference(n, e1, t1, e2, c):
res = float('inf')
energy_list = [e1 * i for i in range(n + 1)]
for i in range(n + 1):
lift = i * t1
energy = energy_list[i]
if energy < (n - i) * e2:
continue
steps = 0
steps_list = [ceil(c / energy) for _ in range(n - i)]
energy -= sum(steps_list) * e2
res = min(res, abs(lift - sum(steps_list)))
return res
Meesho โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
const int MOD = 1e9 + 7;
int dp[20][200][200][2];
vector<int> getDigits(int x) {
vector<int> digits;
while (x > 0) {
digits.push_back(x % 10);
x /= 10;
}
reverse(digits.begin(), digits.end());
return digits;
}
int digitDP(int pos, int sumEven, int sumOdd, int tight, const vector<int>& digits) {
if (pos == digits.size()) {
return (sumEven % 2 == sumOdd % 2) ? 1 : 0;
}
if (dp[pos][sumEven][sumOdd][tight] != -1) {
return dp[pos][sumEven][sumOdd][tight];
}
int limit = tight ? digits[pos] : 9;
int res = 0;
for (int digit = 0; digit <= limit; ++digit) {
int newTight = (tight && (digit == digits[pos]));
if (pos % 2 == 0) {
res = (res + digitDP(pos + 1, sumEven + digit, sumOdd, newTight, digits)) % MOD;
} else {
res = (res + digitDP(pos + 1, sumEven, sumOdd + digit, newTight, digits)) % MOD;
}
}
return dp[pos][sumEven][sumOdd][tight] = res;
}
int countNumbersWithSameParityOfSums(int x) {
if (x <= 0) return 0;
vector<int> digits = getDigits(x);
memset(dp, -1, sizeof(dp));
return digitDP(0, 0, 0, 1, digits);
}
int findParityCountInRange(int a, int b) {
int result_b = countNumbersWithSameParityOfSums(b);
int result_a = countNumbersWithSameParityOfSums(a);
return (result_b - result_a + MOD) % MOD;
}
Meesho โ
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
const int MOD = 1e9 + 7;
int getExpressionSums(string num) {
int n = num.size();
long long res = 0;
for (int mask = 0; mask < (1 << (n - 1)); ++mask) {
string s = "";
s += num[0];
for (int i = 0; i < n - 1; ++i) {
if (mask & (1 << i)) {
s += '+';
}
s += num[i + 1];
}
long long current_sum = 0;
string temp = "";
for (char c : s) {
if (c == '+') {
current_sum += stoll(temp);
temp = "";
} else {
temp += c;
}
}
current_sum += stoll(temp);
res = (res + current_sum) % MOD;
}
return res;
}
Meesho โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Coupan is hiring for Software Engineer ( Offcampus )
Experience Required: Fresher (0 to 4 years)
Batch Eligible: 2020/ 2021/ 2022/ 2023/ 2024
CTC: 10 LPA to 22 LPA
Job Type: Full Time
Location: Pune/Hyderabad
Apply Here : https://careers.coupa.com/career-description/66f3c112-530f-40dc-b6bf-1d179df2d535
Experience Required: Fresher (0 to 4 years)
Batch Eligible: 2020/ 2021/ 2022/ 2023/ 2024
CTC: 10 LPA to 22 LPA
Job Type: Full Time
Location: Pune/Hyderabad
Apply Here : https://careers.coupa.com/career-description/66f3c112-530f-40dc-b6bf-1d179df2d535
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Email your Resume at: svidyagar@intraedge.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Email: kalpana.wadhwani@scriptshub.net
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Bolt.Earth is hiring IOS Developer Intern
For 2024, 2025, 2026 grads
Location: Bangalore
https://www.linkedin.com/jobs/view/4020997792
For 2024, 2025, 2026 grads
Location: Bangalore
https://www.linkedin.com/jobs/view/4020997792
Linkedin
Bolt.Earth hiring IOS Development Intern in Bengaluru, Karnataka, India | LinkedIn
Posted 7:09:58 AM. Position: iOS Development Intern Location: Bolt.Earth, Bengaluru, India Duration: 6 months Type:โฆSee this and similar jobs on LinkedIn.