101 332
订阅者
-7924 小时
-3327 天
-1 28630 天
帖子存档
Ashok IT
AWS
Devops
Azure Devops
30 rupees
Contact:- @meterials_available
Taimur and Shadiur Code : ALL PASSED ✅
MOD = 10**9+7
def get_ans(N, Tpos, Shpos):
a0 = min(Tpos, Shpos) - 1
b0 = N - max(Tpos, Shpos)
dp = [[0]*(b0+1) for _ in range(a0+1)]
dp2 = [[0]*(b0+1) for _ in range(a0+1)]
dp[a0][b0] = 1
for _ in range(N):
for b in range(b0+1):
run = 0
for a in range(a0, -1, -1):
run = (run + dp[a][b]) % MOD
dp2[a][b] = run
for a in range(a0+1):
run = 0
for b in range(b0, -1, -1):
run = (run + dp[a][b]) % MOD
dp2[a][b] = (dp2[a][b] + run) % MOD
for a in range(a0+1):
for b in range(b0+1):
dp2[a][b] = (dp2[a][b] - dp[a][b]) % MOD
dp, dp2 = dp2, [[0]*(b0+1) for _ in range(a0+1)]
return sum(sum(row) for row in dp) % MOD
N = int(input())
Tpos = int(input())
Shpos = int(input())
print(get_ans(N, Tpos, Shpos))
#include <iostream>
#include <vector>
#include <cmath>
int stepsNeeded(int n, int x, int y, int a[]) {
if (n <= 1) {
return 0;
}
int currentIndex = 0;
int jumpCount = 0;
bool movingRight = true;
while (true) {
if (currentIndex == n - 1) {
break;
}
if (currentIndex == 0 && jumpCount > 0) {
break;
}
int lastIndexBeforeJump = currentIndex;
if (movingRight) {
int nextIndex = -1;
for (int i = n - 1; i > currentIndex; --i) {
if (std::abs(a[i] - a[currentIndex]) <= x) {
nextIndex = i;
break;
}
}
if (nextIndex != -1) {
currentIndex = nextIndex;
jumpCount++;
} else {
movingRight = false;
}
}
if (!movingRight && lastIndexBeforeJump == currentIndex) {
int nextIndex = -1;
for (int i = 0; i < currentIndex; ++i) {
if (std::abs(a[i] - a[currentIndex]) <= y) {
nextIndex = i;
break;
}
}
if (nextIndex != -1) {
currentIndex = nextIndex;
jumpCount++;
}
}
if (lastIndexBeforeJump == currentIndex) {
break;
}
}
return jumpCount;
}
int main() {
int n, x, y;
std::cin >> n >> x >> y;
int a[n];
for (int i = 0; i < n; ++i) {
std::cin >> a[i];
}
std::cout << stepsNeeded(n, x, y, a);
return 0;
}
C++
Flipkart Grid 7.0
#include <iostream>
#include <vector>
#include <cmath>
int stepsNeeded(int n, int x, int y, int a[]) {
if (n <= 1) {
return 0;
}
int currentIndex = 0;
int jumpCount = 0;
bool movingRight = true;
while (true) {
if (currentIndex == n - 1) {
break;
}
if (currentIndex == 0 && jumpCount > 0) {
break;
}
int lastIndexBeforeJump = currentIndex;
if (movingRight) {
int nextIndex = -1;
for (int i = n - 1; i > currentIndex; --i) {
if (std::abs(a[i] - a[currentIndex]) <= x) {
nextIndex = i;
break;
}
}
if (nextIndex != -1) {
currentIndex = nextIndex;
jumpCount++;
} else {
movingRight = false;
}
}
if (!movingRight && lastIndexBeforeJump == currentIndex) {
int nextIndex = -1;
for (int i = 0; i < currentIndex; ++i) {
if (std::abs(a[i] - a[currentIndex]) <= y) {
nextIndex = i;
break;
}
}
if (nextIndex != -1) {
currentIndex = nextIndex;
jumpCount++;
}
}
if (lastIndexBeforeJump == currentIndex) {
break;
}
}
return jumpCount;
}
int main() {
int n, x, y;
std::cin >> n >> x >> y;
int a[n];
for (int i = 0; i < n; ++i) {
std::cin >> a[i];
}
std::cout << stepsNeeded(n, x, y, a);
return 0;
}
C++
Flipkart Grid 7.0
Guys be careful he is Scammer.
🚫🚫🚫🚫❗️❗️❗️❗️
@Arjunkumar145
This I'd report
Superset Varsity Graduate Virtual Career Fair - Multiple-Roles (Phase 6)
Eligible Batches : 2023,2024 & 2025
Eligible Graduation : Any 3 year Graduates
13 July 2025 11:00 AM
https://app.joinsuperset.com/join/#/signup/student/jobprofiles/b157575c-64fa-44e3-a6d6-de6b3a6d68d1
❤ 2
Deloitte off Campus Drive
Job Profile : Junior Associate
Eligibility : B.Com / BBA / BMS
Batch - 2023 2024 2025
Apply Link
https://southasiacareers.deloitte.com/job/Hyderabad-Junior-Associate-Sourcing-&-procurement-Hyderabad-Supply-Chain-&-Network-Operations/41125344/
❤ 1
Ashok IT
AWS
Devops
Azure Devops
30 rupees
Contact:- @meterials_available
Ashok IT
AWS
Devops
Azure Devops
30 rupees
Contact:- @meterials_available
Amazon Hiring Freshers : Data Center Operations Trainee – BSC/BCA/Diploma
Job Title:Data Center Operations Trainee
Job Location: Mumbai
Experience: Freshers / 0-2 Years
Qualification: BSC/BCA/Diploma in Engineering
Batch : 2025/2024/2023 or Any
Apply now:- http://www.itjobs.services/2025/07/amazon-hiring-freshers-data-center.html
❤ 6
HSBC Hiring
Role:- Full Stack Developer /Consultant Specialist
Job ID :- 0000LHJ5
Location :- Bangalore, India Area of interest
Technology:- Job type
Permanent - Full Time
Work style :- Office Working
Opening date:- 29-Jun-2025
Closing date:- 05-Jul-2025
Apply:- http://www.itjobs.services/2025/07/hsbc-hiring-full-stack-developer.html
❤ 3
SAP – Solution Support Engineer (Bangalore)
Package: 12 LPA
https://jobs.sap.com/job/Bangalore-Solution-Support-Engineer-560066/1218799701/?feedId=384233&utm_campaign=SAP_Linkedin&utm_source=LinkedinJobPostings
👎 1
Ashok IT
AWS
Devops
Azure Devops
30 rupees
Contact:- @meterials_available
Company:- Captial one
Batch:- 2021-2025
Role:- Associate:
Location:- Bangalore
Apply now:-
https://www.capitalonecareers.com/job/-/-/234/82976259264?p_sid=gbahU0b&p_uid=ynP8BL62Bj&source=rd_linkedin_job_posting_tm&ss=paid&utm_campaign=india_25&utm_content=pj_board&utm_medium=jobad&utm_source=linkedin+slotted

