๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <bits/stdc++.h>
using namespace std;
#define int long long
int quadruple(vector<int> arr, int n) {
int ans = 0;
vector<int> left(n), right(n);
left[0] = 0;
right[n - 1] = 0;
for (int i = 1; i < n; i++) {
left[i] = 0;
for (int j = 0; j < i; j++) {
if (arr[j] < arr[i]) {
left[i]++;
}
}
}
for (int i = n - 2; i >= 0; i--) {
right[i] = 0;
for (int j = n - 1; j > i; j--) {
if (arr[j] > arr[i]) {
right[i]++;
}
}
}
for (int i = 1; i < n - 1; i++) {
for (int j = i + 1; j < n - 1; j++) {
ans += left[i] * right[j];
}
}
return ans;
}
int32_t main() {
int t;
cin >> t;
while(t--){
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int ans = quadruple(a, n);
cout << ans << endl;
}
}
DB โ
using namespace std;
#define int long long
int quadruple(vector<int> arr, int n) {
int ans = 0;
vector<int> left(n), right(n);
left[0] = 0;
right[n - 1] = 0;
for (int i = 1; i < n; i++) {
left[i] = 0;
for (int j = 0; j < i; j++) {
if (arr[j] < arr[i]) {
left[i]++;
}
}
}
for (int i = n - 2; i >= 0; i--) {
right[i] = 0;
for (int j = n - 1; j > i; j--) {
if (arr[j] > arr[i]) {
right[i]++;
}
}
}
for (int i = 1; i < n - 1; i++) {
for (int j = i + 1; j < n - 1; j++) {
ans += left[i] * right[j];
}
}
return ans;
}
int32_t main() {
int t;
cin >> t;
while(t--){
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int ans = quadruple(a, n);
cout << ans << endl;
}
}
DB โ
ll solve(vector<ll>& ar,bool f) {
ll n=ar.size();
ll s=*min_element(ar.begin(), ar.end());
ll l=*max_element(ar.begin(), ar.end());
vector<ll>dp(l-s+1);
for(ll j=0;j<dp.size();j++)
{
if (f) dp[j]=abs(ar[0]-(s+j));
else dp[j]=abs(ar[0]-(l - j));
}
for (ll i=1;i<n;i++) {
ll m=LONG_MAX;
vector<ll>c(dp.size());
for (ll j=0;j<dp.size();j++)
{
m=min(m,dp[j]);
if(f) c[j]=m+abs(ar[i]-(s+j));
else c[j]=m+abs(ar[i]-(l-j));
}
dp=c;
}
ll a=LONG_MAX;
for (ll j=0;j<dp.size();j++) a=min(a,dp[j]);
return a;
}
ll helper(vector<ll>&a)
{
return min(solve(a,1),solve(a,0));
}
Modify an Array โ
ll n=ar.size();
ll s=*min_element(ar.begin(), ar.end());
ll l=*max_element(ar.begin(), ar.end());
vector<ll>dp(l-s+1);
for(ll j=0;j<dp.size();j++)
{
if (f) dp[j]=abs(ar[0]-(s+j));
else dp[j]=abs(ar[0]-(l - j));
}
for (ll i=1;i<n;i++) {
ll m=LONG_MAX;
vector<ll>c(dp.size());
for (ll j=0;j<dp.size();j++)
{
m=min(m,dp[j]);
if(f) c[j]=m+abs(ar[i]-(s+j));
else c[j]=m+abs(ar[i]-(l-j));
}
dp=c;
}
ll a=LONG_MAX;
for (ll j=0;j<dp.size();j++) a=min(a,dp[j]);
return a;
}
ll helper(vector<ll>&a)
{
return min(solve(a,1),solve(a,0));
}
Modify an Array โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int dfs(int node, int parent, vector<vector<pair<int, int>>>& adj, vector<bool>& visited) {
visited[node] = true;
int total_flow = 0;
for (auto& neighbor : adj[node]) {
int next_node = neighbor.first;
int rate = neighbor.second;
if (!visited[next_node]) {
int flow = dfs(next_node, node, adj, visited);
total_flow += min(flow, rate);
}
}
return total_flow == 0 ? 1e9 : total_flow; // For leaf nodes return a large number
}
int oilTransport(int num, int baseR, vector<vector<int>>& pipesCon) {
vector<vector<pair<int, int>>> adj(num + 1);
for (const auto& pipe : pipesCon) {
adj[pipe[0]].push_back({pipe[1], pipe[2]});
adj[pipe[1]].push_back({pipe[0], pipe[2]});
}
vector<bool> visited(num + 1, false);
return dfs(baseR, -1, adj, visited);
}
int main() {
int num;
cin >> num;
int baseR;
cin >> baseR;
int numCon, charCon;
cin >> numCon >> charCon;
vector<vector<int>> pipesCon(numCon, vector<int>(charCon));
for (int i = 0; i < numCon; i++) {
for (int j = 0; j < charCon; j++) {
cin >> pipesCon[i][j];
}
}
cout << oilTransport(num, baseR, pipesCon) << endl;
return 0;
}
SAP Labs โ
#include <vector>
#include <algorithm>
using namespace std;
int dfs(int node, int parent, vector<vector<pair<int, int>>>& adj, vector<bool>& visited) {
visited[node] = true;
int total_flow = 0;
for (auto& neighbor : adj[node]) {
int next_node = neighbor.first;
int rate = neighbor.second;
if (!visited[next_node]) {
int flow = dfs(next_node, node, adj, visited);
total_flow += min(flow, rate);
}
}
return total_flow == 0 ? 1e9 : total_flow; // For leaf nodes return a large number
}
int oilTransport(int num, int baseR, vector<vector<int>>& pipesCon) {
vector<vector<pair<int, int>>> adj(num + 1);
for (const auto& pipe : pipesCon) {
adj[pipe[0]].push_back({pipe[1], pipe[2]});
adj[pipe[1]].push_back({pipe[0], pipe[2]});
}
vector<bool> visited(num + 1, false);
return dfs(baseR, -1, adj, visited);
}
int main() {
int num;
cin >> num;
int baseR;
cin >> baseR;
int numCon, charCon;
cin >> numCon >> charCon;
vector<vector<int>> pipesCon(numCon, vector<int>(charCon));
for (int i = 0; i < numCon; i++) {
for (int j = 0; j < charCon; j++) {
cin >> pipesCon[i][j];
}
}
cout << oilTransport(num, baseR, pipesCon) << endl;
return 0;
}
SAP Labs โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <queue>
#include <climits>
using namespace std;
const int directions[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
vector<vector<int>> closestDis(const vector<vector<int>>& aerialView) {
int M = aerialView.size();
int N = aerialView[0].size();
vector<vector<int>> distance(M, vector<int>(N, INT_MAX));
queue<pair<int, int>> q;
for (int i = 0; i < M; ++i) {
for (int j = 0; j < N; ++j) {
if (aerialView[i][j] == 1) {
q.push({i, j});
distance[i][j] = 0;
}
}
}
while (!q.empty()) {
auto [x, y] = q.front();
q.pop();
for (const auto& dir : directions) {
int nx = x + dir[0];
int ny = y + dir[1];
if (nx >= 0 && ny >= 0 && nx < M && ny < N) {
if (distance[nx][ny] > distance[x][y] + 1) {
distance[nx][ny] = distance[x][y] + 1;
q.push({nx, ny});
}
}
}
}
return distance;
}
int main() {
int M, N;
cin >> M >> N;
vector<vector<int>> aerialView(M, vector<int>(N));
for (int i = 0; i < M; ++i) {
for (int j = 0; j < N; ++j) {
cin >> aerialView[i][j];
}
}
vector<vector<int>> result = closestDis(aerialView);
for (const auto& row : result) {
for (int cell : row) {
cout << cell << " ";
}
cout << endl;
}
return 0;
}
SAP Labs โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Vensure is hiring for Intern roles
Walkin Drive on 7 th sept 2024 from 11 AM - 2 PM at C- tower ,21 Floor, Noida sec 142, Advant Building.
Send resume to : saumya.srivastava@vensure.com
Walkin Drive on 7 th sept 2024 from 11 AM - 2 PM at C- tower ,21 Floor, Noida sec 142, Advant Building.
Send resume to : saumya.srivastava@vensure.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐URJENT REQUIRMENT
Position: Machine Learning Engineer
Experience: 1 year
Location: Noida, Sector 63 (Onsite)
Salary: โน20-30k/month
We're looking for a passionate ML Engineer with 1 year of experience to join our team. If you're skilled in ML, MLE, NLP, and LLM, weโd love to hear from you!
Please send your resume to binni@juppiterailabs.com
Position: Machine Learning Engineer
Experience: 1 year
Location: Noida, Sector 63 (Onsite)
Salary: โน20-30k/month
We're looking for a passionate ML Engineer with 1 year of experience to join our team. If you're skilled in ML, MLE, NLP, and LLM, weโd love to hear from you!
Please send your resume to binni@juppiterailabs.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Reach out to Cisco Employees for referral
Hiring for 2025 Batch
Hiring for 2025 Batch
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
WE'RE NOW ON DISCORD โค
OUR Coding Community โจ
We've launched our new discord server, you all can join there ASAP
Here's the exclusive link ๐
https://discord.gg/wjehyMA6D8
Join fast. See you all โค
OUR Coding Community โจ
We've launched our new discord server, you all can join there ASAP
Here's the exclusive link ๐
https://discord.gg/wjehyMA6D8
Join fast. See you all โค
Discord
Join the Coding Zone Discord Server!
Check out the Coding Zone community on Discord - hang out with 369 other members and enjoy free voice and text chat.
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ pinned ยซWE'RE NOW ON DISCORD โค OUR Coding Community โจ We've launched our new discord server, you all can join there ASAP Here's the exclusive link ๐ https://discord.gg/wjehyMA6D8 Join fast. See you all โคยป
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Guys Maybe Telegram Will Banned Soon In India
We Have Second Option That Is WhatsApp Channel
So, We Have Created a WhatsApp Channel
โ๏ธ WhatsApp Channel Link : https://whatsapp.com/channel/0029Vam1NUC7tkj7UpHG9w2p
We Have Second Option That Is WhatsApp Channel
So, We Have Created a WhatsApp Channel
โ๏ธ WhatsApp Channel Link : https://whatsapp.com/channel/0029Vam1NUC7tkj7UpHG9w2p
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
https://www.linkedin.com/posts/reenu-s_insuretech-entrylevel-careeropportunity-activity-7231913037518020608-THM1?utm_source=share&utm_medium=member_desktop
#Duck Creek is inviting applications for its first ever hashtag#Talent Acceleration Program (Cohort) for India. Share your CV at *reenu.sura@duckcreek.com* if you meet below eligibility criteria:
- Graduated in 2023/2024
- BTech/B.E. (Computer Science Engineering OR Information Technology) OR MTech/M.E. (Computer Science Engineering)
- CGPA of 7.5 or higher (equivalent to 70% or more)
- Understand object-oriented design and coding in Java or C# or .NET
If you have completed any Industry internship or bootcamp trainings - it will be a plus.
hashtag#Early Careers Job Opportunity hashtag#Freshers Hiring hashtag#Cohort
#Duck Creek is inviting applications for its first ever hashtag#Talent Acceleration Program (Cohort) for India. Share your CV at *reenu.sura@duckcreek.com* if you meet below eligibility criteria:
- Graduated in 2023/2024
- BTech/B.E. (Computer Science Engineering OR Information Technology) OR MTech/M.E. (Computer Science Engineering)
- CGPA of 7.5 or higher (equivalent to 70% or more)
- Understand object-oriented design and coding in Java or C# or .NET
If you have completed any Industry internship or bootcamp trainings - it will be a plus.
hashtag#Early Careers Job Opportunity hashtag#Freshers Hiring hashtag#Cohort
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Referral Alert :
Salesfore Referral
https://docs.google.com/forms/d/e/1FAIpQLSc9J4dez26z7PJy5eInK7WcYoeK0kBVPr6H9nkobUoFB13_MQ/viewform
Salesfore Referral
https://docs.google.com/forms/d/e/1FAIpQLSc9J4dez26z7PJy5eInK7WcYoeK0kBVPr6H9nkobUoFB13_MQ/viewform
OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ
Reach out to Cisco Employees for referral Hiring for 2025 Batch
Linkedin
Shubham T. on LinkedIn: UPDATE: I have referred many from the DMs. Closing it for now!
Cisco isโฆ | 665 comments
Cisco isโฆ | 665 comments
UPDATE: I have referred many from the DMs. Closing it for now!
Cisco is hiring 2025 graduating Engineers.
Please try to take referral from someone else forโฆ | 665 comments on LinkedIn
Cisco is hiring 2025 graduating Engineers.
Please try to take referral from someone else forโฆ | 665 comments on LinkedIn