t = int(input())
for _ in range(t):
n = int(input())
if n == 3:
print("1 2 3")
elif n % 2 == 0:
for i in range(1, n // 2 + 1):
print(f"{i} {n + 1 - i}", end=" ")
print()
else:
for i in range(1, n // 2 + 1):
print(f"{i} {n - i}", end=" ")
print(n)
Split permutation โ
import sys
input = sys.stdin.read
data = input().split()
index = 0
t = int(data[index])
index += 1
results = []
for _ in range(t):
n = int(data[index])
m = int(data[index + 1])
index += 2
a = list(map(int, data[index:index + n]))
index += n
b = list(map(int, data[index:index + n]))
index += n
cnt = {}
for x in a:
rem = x % m
if rem in cnt:
cnt[rem] += 1
else:
cnt[rem] = 1
tot = 0
for x in b:
rem = (m - (x % m)) % m
if rem in cnt:
tot += cnt[rem]
results.append(tot)
for result in results:
print(result)
if __name__ == "__main__":
main()
Trick or treat โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
FresherOpportunityAlert
Yash Technologies is hiring Fresher - Trainee Consultant -SAP - ABAP for Hyderabad
Experience: 0-1 Years
Job Description
Perform as an individual contributor with fair degree of accountability with minimum assistance.
Execute unit testing to ensure the accuracy of his/her developments.
Link to apply: https://careers.yash.com/job/Hyderabad-Trainee-Consultant-SAP-ABAP-Job/1052844966/?
Yash Technologies is hiring Fresher - Trainee Consultant -SAP - ABAP for Hyderabad
Experience: 0-1 Years
Job Description
Perform as an individual contributor with fair degree of accountability with minimum assistance.
Execute unit testing to ensure the accuracy of his/her developments.
Link to apply: https://careers.yash.com/job/Hyderabad-Trainee-Consultant-SAP-ABAP-Job/1052844966/?
#include <iostream>
#include <vector>
#include <string>
using namespace std;
const long long PRIME = 53;
const long long MOD = 1e9 + 7;
void solve() {
string s;
cin >> s;
long long n = s.size();
vector<long long> pow(n);
vector<long long> dp(n + 1);
pow[0] = 1;
for (long long i = 1; i < n; i++) {
pow[i] = (pow[i - 1] * PRIME) % MOD;
}
dp[0] = 0;
for (long long i = 0; i < n; i++) {
dp[i + 1] = (dp[i] + (s[i] - 'a' + 1) * pow[i]) % MOD;
}
auto calc = [&](int l, int r) -> long long {
long long hash_value = (dp[r] - dp[l] + MOD) % MOD;
hash_value = (hash_value * pow[n - 1 - l]) % MOD;
return hash_value;
};
long long count = 0;
for (long long i = 0; i < n; i++) {
long long remaining_length = n - 2 * i;
if (remaining_length % 2 == 1) continue;
if (calc(0, i) == calc(i, 2 * i)) {
long long half_remaining_length = remaining_length / 2;
if (calc(2 * i, 2 * i + half_remaining_length) == calc(2 * i + half_remaining_length, n)) {
count++;
}
}
}
cout << count << endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while(t--) solve();
return 0;
}
Break the string โ
#include <vector>
#include <string>
using namespace std;
const long long PRIME = 53;
const long long MOD = 1e9 + 7;
void solve() {
string s;
cin >> s;
long long n = s.size();
vector<long long> pow(n);
vector<long long> dp(n + 1);
pow[0] = 1;
for (long long i = 1; i < n; i++) {
pow[i] = (pow[i - 1] * PRIME) % MOD;
}
dp[0] = 0;
for (long long i = 0; i < n; i++) {
dp[i + 1] = (dp[i] + (s[i] - 'a' + 1) * pow[i]) % MOD;
}
auto calc = [&](int l, int r) -> long long {
long long hash_value = (dp[r] - dp[l] + MOD) % MOD;
hash_value = (hash_value * pow[n - 1 - l]) % MOD;
return hash_value;
};
long long count = 0;
for (long long i = 0; i < n; i++) {
long long remaining_length = n - 2 * i;
if (remaining_length % 2 == 1) continue;
if (calc(0, i) == calc(i, 2 * i)) {
long long half_remaining_length = remaining_length / 2;
if (calc(2 * i, 2 * i + half_remaining_length) == calc(2 * i + half_remaining_length, n)) {
count++;
}
}
}
cout << count << endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while(t--) solve();
return 0;
}
Break the string โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Falistro is hiring for Software Engineer (SDE-1 - Fresher/New-Grads)
Salary: 5-7 LPA
https://wellfound.com/jobs/2758340-software-engineer-sde-1-fresher-new-grads
Salary: 5-7 LPA
https://wellfound.com/jobs/2758340-software-engineer-sde-1-fresher-new-grads
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
import collections
def bioHazard(n, allergic, poisonous):
d = collections.defaultdict(lambda: -1)
for a, b in zip(allergic, poisonous):
a, b = sorted([a, b])
d[b] = max(d[b], a)
for i in range(1, n + 1):
d[i] = max(d[i], d[i - 1])
res = 0
for i in range(1, n + 1):
if d[i] == -1:
res += i
else:
res += i - d[i]
return res
Biological Hazards โ
MSCI
def bioHazard(n, allergic, poisonous):
d = collections.defaultdict(lambda: -1)
for a, b in zip(allergic, poisonous):
a, b = sorted([a, b])
d[b] = max(d[b], a)
for i in range(1, n + 1):
d[i] = max(d[i], d[i - 1])
res = 0
for i in range(1, n + 1):
if d[i] == -1:
res += i
else:
res += i - d[i]
return res
Biological Hazards โ
MSCI
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
https://www.linkedin.com/posts/shraddha-jhamb-3a900a146_internship-businessanalyst-hospitalityinnovation-activity-7211659132485947392-MU8g?utm_source=share&utm_medium=member_android
Interested Folks fill this form :
https://docs.google.com/forms/d/e/1FAIpQLSfB5ac9PFvg6wHByFqiF5tR3Zu1BPR90LmtS7f1iVm5MfIwOA/viewform
Interested Folks fill this form :
https://docs.google.com/forms/d/e/1FAIpQLSfB5ac9PFvg6wHByFqiF5tR3Zu1BPR90LmtS7f1iVm5MfIwOA/viewform
Linkedin
๐ Exciting Internship Opportunity at OYO! | Shraddha Jhamb
๐ Exciting Internship Opportunity at OYO! ๐
Are you ready to kickstart your career with one of the world's leading hospitality brands? OYO is offering a fantastic Business Analyst Internship opportunity that you don't want to miss!
๐ Location: Gurgaonโฆ
Are you ready to kickstart your career with one of the world's leading hospitality brands? OYO is offering a fantastic Business Analyst Internship opportunity that you don't want to miss!
๐ Location: Gurgaonโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Ganesh Bajaj on LinkedIn: #hiring #careeropportunity #freshers #softwaredevelopment #datascienceโฆ | 57 comments
๐ Join Our Team at Sigmoid! ๐
At Sigmoid, we are continuously seeking to expand our team with talented individuals who can contribute to our growth andโฆ | 57 comments on LinkedIn
At Sigmoid, we are continuously seeking to expand our team with talented individuals who can contribute to our growth andโฆ | 57 comments on LinkedIn
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
HARMAN Hiring Associate Software Engineer
- Freshers eligible ๐
Link to apply ๐
https://jobs.harman.com/en_US/careers/JobDetail/Associate-Engineer-AI-Data-and-Analytics/22891
- Freshers eligible ๐
Link to apply ๐
https://jobs.harman.com/en_US/careers/JobDetail/Associate-Engineer-AI-Data-and-Analytics/22891
Harman
Careers Site
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Semtech is hiring SDE Intern
For 2024, 2025, 2026 grads
https://in.linkedin.com/jobs/view/intern-software-at-semtech-3960087488?position=8&pageNum=0&refId=UVYaiskU7pxUjd3OkweZFA%3D%3D&trackingId=DzNYkdyvX%2BFHP%2Fk9bTUbSA%3D%3D&trk=public_jobs_jserp-result_search-card
For 2024, 2025, 2026 grads
https://in.linkedin.com/jobs/view/intern-software-at-semtech-3960087488?position=8&pageNum=0&refId=UVYaiskU7pxUjd3OkweZFA%3D%3D&trackingId=DzNYkdyvX%2BFHP%2Fk9bTUbSA%3D%3D&trk=public_jobs_jserp-result_search-card
Linkedin
Semtech hiring Intern - Software in Pune, Maharashtra, India | LinkedIn
Posted 8:47:20 AM. Job SummaryIoTSP team is building leading cellular routers and gateways that make a difference toโฆ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)
nference is hiring SDE Intern
For 2023, 2024, 2025 grads
Stipend - 30K pm
https://in.linkedin.com/jobs/view/software-development-internship-in-bangalore-at-nference-3959057170?position=1&pageNum=0&refId=r7Q6jQnzNBdKjtXhOMqQXA%3D%3D&trackingId=6vuc5JcE6EeOy8Jhna2hpA%3D%3D&trk=public_jobs_jserp-result_search-card
For 2023, 2024, 2025 grads
Stipend - 30K pm
https://in.linkedin.com/jobs/view/software-development-internship-in-bangalore-at-nference-3959057170?position=1&pageNum=0&refId=r7Q6jQnzNBdKjtXhOMqQXA%3D%3D&trackingId=6vuc5JcE6EeOy8Jhna2hpA%3D%3D&trk=public_jobs_jserp-result_search-card
Linkedin
nference hiring Software Development Internship in Bangalore in Bengaluru, Karnataka, India | LinkedIn
Posted 7:52:50 PM. Selected Intern's Day-to-day Responsibilities Include Develop and maintain web applications usingโฆSee this and similar jobs on LinkedIn.
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
import java.util.ArrayList;
import java.util.List;
public class Main {
static class TreeNode {
int value;
List<TreeNode> children;
TreeNode(int value) {
this.value = value;
this.children = new ArrayList<>();
}
}
public static int calculateMax(int networkNodes, int[] networkFrom, int[] networkTo, int[] frequency) {
List<List<Integer>> con = new ArrayList<>();
for (int i = 0; i < networkNodes; i++) {
con.add(new ArrayList<>());
}
for (int i = 0; i + 1 < networkNodes; ++i) {
con.get(networkFrom[i] - 1).add(networkTo[i] - 1);
con.get(networkTo[i] - 1).add(networkFrom[i] - 1);
}
int[] result = {0};
dfs(0, -1, con, frequency, result);
return result[0];
}
private static int dfs(int x, int f, List<List<Integer>> con, int[] v, int[] r) {
int m1 = 0, m2 = 0;
for (int y : con.get(x)) {
if (y != f) {
int m = dfs(y, x, con, v, r) + 1;
if (Math.abs(v[y] - v[x]) <= 1) {
if (m >= m1) {
m2 = m1;
m1 = m;
} else if (m > m2) {
m2 = m;
}
}
}
}
r[0] = Math.max(r[0], m1 + m2);
return m1;
}
Radio Waves โ
import java.util.List;
public class Main {
static class TreeNode {
int value;
List<TreeNode> children;
TreeNode(int value) {
this.value = value;
this.children = new ArrayList<>();
}
}
public static int calculateMax(int networkNodes, int[] networkFrom, int[] networkTo, int[] frequency) {
List<List<Integer>> con = new ArrayList<>();
for (int i = 0; i < networkNodes; i++) {
con.add(new ArrayList<>());
}
for (int i = 0; i + 1 < networkNodes; ++i) {
con.get(networkFrom[i] - 1).add(networkTo[i] - 1);
con.get(networkTo[i] - 1).add(networkFrom[i] - 1);
}
int[] result = {0};
dfs(0, -1, con, frequency, result);
return result[0];
}
private static int dfs(int x, int f, List<List<Integer>> con, int[] v, int[] r) {
int m1 = 0, m2 = 0;
for (int y : con.get(x)) {
if (y != f) {
int m = dfs(y, x, con, v, r) + 1;
if (Math.abs(v[y] - v[x]) <= 1) {
if (m >= m1) {
m2 = m1;
m1 = m;
} else if (m > m2) {
m2 = m;
}
}
}
}
r[0] = Math.max(r[0], m1 + m2);
return m1;
}
Radio Waves โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
eClerx is hiring for a Financial Markets-Analyst-Finance
Analyst at eClerx...
Location - Chandigarh
Eligibility - Freshers as well as Experienced.
Candidates should be comfortable working in all
shifts i.e APAC/EMEA/Night shift.
Interested candidates
Share your CV on
Chinmay.Rode.C@eclerx.com
Analyst at eClerx...
Location - Chandigarh
Eligibility - Freshers as well as Experienced.
Candidates should be comfortable working in all
shifts i.e APAC/EMEA/Night shift.
Interested candidates
Share your CV on
Chinmay.Rode.C@eclerx.com