#include <bits/stdc++.h>
using namespace std;
int findPairs(vector<pair<int, int>>& array, int size) {
set<pair<int, int>> pairsSet;
for (int i = 0; i < size; i++) {
for (int j = 0; j < size; j++) {
if (i != j && pairsSet.find({i, j}) == pairsSet.end() && pairsSet.find({j, i}) == pairsSet.end()) {
if ((array[i].second * (array[j].first - array[i].first)) == (array[i].first * (array[j].second - array[i].second))) {
pairsSet.insert({i, j});
}
}
}
}
return pairsSet.size();
}
int main() {
int t;
cin >> t;
for (int testCase = 1; testCase <= t; testCase++) {
int size;
cin >> size;
vector<pair<int, int>> array(size);
for (int i = 0; i < size; i++) {
cin >> array[i].first >> array[i].second;
}
int result = findPairs(array, size);
cout << result << endl;
}
return 0;
}
Pair of points โ
using namespace std;
int findPairs(vector<pair<int, int>>& array, int size) {
set<pair<int, int>> pairsSet;
for (int i = 0; i < size; i++) {
for (int j = 0; j < size; j++) {
if (i != j && pairsSet.find({i, j}) == pairsSet.end() && pairsSet.find({j, i}) == pairsSet.end()) {
if ((array[i].second * (array[j].first - array[i].first)) == (array[i].first * (array[j].second - array[i].second))) {
pairsSet.insert({i, j});
}
}
}
}
return pairsSet.size();
}
int main() {
int t;
cin >> t;
for (int testCase = 1; testCase <= t; testCase++) {
int size;
cin >> size;
vector<pair<int, int>> array(size);
for (int i = 0; i < size; i++) {
cin >> array[i].first >> array[i].second;
}
int result = findPairs(array, size);
cout << result << endl;
}
return 0;
}
Pair of points โ
Forwarded from ๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ (Dushyant)
After many messages like above, I have created new channel where will update job opportunities only for experienced candidates. (It will be difficult to manage 2 channel but will try my best).
Here is the link:
https://t.me/codingsamurai
#KeepSharingwithseniors
Here is the link:
https://t.me/codingsamurai
#KeepSharingwithseniors
Telegram
Experience Jobs & Materials
300+ Placement & Competitive Exam Materials
75+ Companies Materials
10+ Weekly Udemy Course Coupons
Daily Off Campus Jobs Updates
India's Biggest Placement Channel!!
โ๐ดโ๐ดโ๐ฉโ๐ปโ๐โ
๐ Share and Support
Buy ads: https://telega.io/c/codingsamurai
75+ Companies Materials
10+ Weekly Udemy Course Coupons
Daily Off Campus Jobs Updates
India's Biggest Placement Channel!!
โ๐ดโ๐ดโ๐ฉโ๐ปโ๐โ
๐ Share and Support
Buy ads: https://telega.io/c/codingsamurai
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ pinned ยซAfter many messages like above, I have created new channel where will update job opportunities only for experienced candidates. (It will be difficult to manage 2 channel but will try my best). Here is the link: https://t.me/codingsamurai #KeepSharingwithseniorsยป
#include <iostream>
using namespace std;
int gcd(int a, int b) {
return (b == 0) ? a : gcd(b, a % b);
}
int numberOfSquares(int L, int B) {
int side = gcd(L, B);
return (L * B) / (side * side);
}
int main() {
int L, B;
cin >> L >> B;
cout << numberOfSquares(L, B) << endl;
return 0;
}
using namespace std;
int gcd(int a, int b) {
return (b == 0) ? a : gcd(b, a % b);
}
int numberOfSquares(int L, int B) {
int side = gcd(L, B);
return (L * B) / (side * side);
}
int main() {
int L, B;
cin >> L >> B;
cout << numberOfSquares(L, B) << endl;
return 0;
}
#include<iostream>
#include<vector>
#include<thread>
#include<mutex>
std::mutex mtx;
void computeSum(const std::vector<int>& nums, int start, int end, int& result) {
int sum = 0;
for(int i = start; i < end; i++) {
sum += nums[i];
}
mtx.lock();
result += sum;
mtx.unlock();
}
int parallelSum(std::vector<int> nums, int num_threads) {
int result = 0;
std::vector<std::thread> threads;
int n = nums.size();
int chunk_size = n / num_threads;
for(int i = 0; i < num_threads; i++) {
int start = i * chunk_size;
int end = (i == num_threads - 1) ? n : start + chunk_size;
threads.push_back(std::thread(computeSum, std::ref(nums), start, end, std::ref(result)));
}
for(auto& th : threads) {
th.join();
}
return result;
}
int main() {
std::vector<int> nums = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int num_threads = 4;
std::cout << "Sum: " << parallelSum(nums, num_threads) << std::endl;
return 0;
}
#include<vector>
#include<thread>
#include<mutex>
std::mutex mtx;
void computeSum(const std::vector<int>& nums, int start, int end, int& result) {
int sum = 0;
for(int i = start; i < end; i++) {
sum += nums[i];
}
mtx.lock();
result += sum;
mtx.unlock();
}
int parallelSum(std::vector<int> nums, int num_threads) {
int result = 0;
std::vector<std::thread> threads;
int n = nums.size();
int chunk_size = n / num_threads;
for(int i = 0; i < num_threads; i++) {
int start = i * chunk_size;
int end = (i == num_threads - 1) ? n : start + chunk_size;
threads.push_back(std::thread(computeSum, std::ref(nums), start, end, std::ref(result)));
}
for(auto& th : threads) {
th.join();
}
return result;
}
int main() {
std::vector<int> nums = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int num_threads = 4;
std::cout << "Sum: " << parallelSum(nums, num_threads) << std::endl;
return 0;
}
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
TIAA Hiring Analyst - Software Developer
No experience required, freshers eligible
https://tiaa.wd1.myworkdayjobs.com/en-US/Search/job/Pune-IND/Analyst---Software-Developer_R230800335-8
No experience required, freshers eligible
https://tiaa.wd1.myworkdayjobs.com/en-US/Search/job/Pune-IND/Analyst---Software-Developer_R230800335-8
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐๐จ๐ฆ๐ฉ๐๐ง๐ฒ ๐๐๐ฆ๐: Goldman Sachs
๐๐จ๐ฅ๐: Summer Analyst Intern
๐๐๐ญ๐๐ก ๐๐ฅ๐ข๐ ๐ข๐๐ฅ๐: 2025 and 2026 grads
๐๐ฉ๐ฉ๐ฅ๐ฒ: https://goldmansachs.tal.net/vx/lang-en-GB/mobile-0/brand-2/candidate/so/pm/1/pl/1/opp/2-Summer-Analyst-Summer-Associate-Internship-programs/en-GB
๐๐จ๐ฅ๐: Summer Analyst Intern
๐๐๐ญ๐๐ก ๐๐ฅ๐ข๐ ๐ข๐๐ฅ๐: 2025 and 2026 grads
๐๐ฉ๐ฉ๐ฅ๐ฒ: https://goldmansachs.tal.net/vx/lang-en-GB/mobile-0/brand-2/candidate/so/pm/1/pl/1/opp/2-Summer-Analyst-Summer-Associate-Internship-programs/en-GB
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Discite Analytics & AI
Data Science Intern - Discite Analytics & AI
Job Opportunity This internship would provide you the opportunity to develop innovative concepts and prototypes applying latest technologies in data analytics and data science What are we looking for Fresher with a little or no previous experience in industryโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Motorola Hiring Internship Trainee
https://motorolasolutions.wd5.myworkdayjobs.com/en-US/Careers/job/Bangalore-India/Internship-Trainee_R40377
https://motorolasolutions.wd5.myworkdayjobs.com/en-US/Careers/job/Bangalore-India/Internship-Trainee_R40377
Myworkdayjobs
MOTOROLA SOLUTIONS OVERVIEW At Motorola Solutions, we believe our people are our greatest strength. More than 21,000 strong, weโre a global close-knit community, united by the relentless pursuit to help keep people safer everywhere. As we have for nearlyโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
#Fresher Openings
#Safron group is hiring #Freshers at #Hyderabad location.
Who is willing to make career on ERP side.
Hiring Process will include:
- Aptitude Test (Hyderabad office)
- Technical Interview
- HR Interview
Apply At: Rahul.kamble@safrangroup.com
#Safron group is hiring #Freshers at #Hyderabad location.
Who is willing to make career on ERP side.
Hiring Process will include:
- Aptitude Test (Hyderabad office)
- Technical Interview
- HR Interview
Apply At: Rahul.kamble@safrangroup.com
IBMโ
5/7 test case pass
5/7 test case pass
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Thiran Technologies
Role: Software Engineer Trainee
Batch eligible: 2022 and 2023 grads
Apply: https://www.linkedin.com/jobs/view/3698490453
Only go if you donโt have any other offer in hand.
Role: Software Engineer Trainee
Batch eligible: 2022 and 2023 grads
Apply: https://www.linkedin.com/jobs/view/3698490453
Only go if you donโt have any other offer in hand.
Linkedin
Thiran Technologies hiring Software Engineer Trainee in Chennai, Tamil Nadu, India | LinkedIn
Posted 10:14:42 AM. Here is what we are looking at:ยท Less than 6 months of experience. ยท Basic programmingโฆSee this and similar jobs on LinkedIn.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: MRI Software
Role: Software Engineer 1
Batch eligible: 2023 grads only
Apply: https://bit.ly/45sYbkP
Role: Software Engineer 1
Batch eligible: 2023 grads only
Apply: https://bit.ly/45sYbkP
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
โ๏ธZycus Walkin Drive 2023
Job Role: Product Technical Analyst
Qualification: BE / B.Tech/ MBA
Experience: Fresher
Batch: 2022/ 2023
Salary: โน 4 - 5 LPA
Walkin Date: 2nd September 23
Apply Now:
https://zycus.skillate.com/jobs/54683
Job Role: Product Technical Analyst
Qualification: BE / B.Tech/ MBA
Experience: Fresher
Batch: 2022/ 2023
Salary: โน 4 - 5 LPA
Walkin Date: 2nd September 23
Apply Now:
https://zycus.skillate.com/jobs/54683
Icecream Distribution
Python 3โ
Python 3โ