๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
public static void main (String[] args) throws java.lang.Exception
{
int tes=1;
StringBuilder sb=new StringBuilder();
lable:for(int fuck=1;fuck<=tes;fuck++)
{
int n=sc.nextInt(),m=sc.nextInt(),k=sc.nextInt(),i,j,l,ans=-1;
int a[][]=new int[n][m];
for(i=0;i<n;i++)
for(j=0;j<m;j++)
a[i][j]=sc.nextInt();
for(i=0;i<n;i++){
int b[][]=new int[n][m];
for(j=0;j<i;j++)
for(l=0;l<m;l++) b[j][l]=a[j][l];
for(j=i;j<Math.min(n,i+k);j++){
for(l=0;l<m;l++){
if(a[j][l]==2) b[j][l]=0;
else b[j][l]=a[j][l];
}
}
for(j=i+k;j<n;j++)
for(l=0;l<m;l++) b[j][l]=a[j][l];
for(j=0;j<m;j++){
int tmp=bfs(b,j,n,m);
ans=Math.max(ans,tmp);
}
}
System.out.println(ans);
}
System.out.println(sb);
}
public static int bfs(int b[][],int j,int n,int m){
int dis[][]=new int[3][2];
dis[0][0]=1; dis[0][1]=-1;
dis[1][0]=1; dis[1][1]=0;
dis[2][0]=1; dis[2][1]=1;
Queue<Pair> que=new LinkedList<>();
int dp[][]=new int[n][m];
for(int it[]:dp) Arrays.fill(it,-1);
if(b[0][j]==2) return -1;
dp[0][j]=b[0][j];
que.add(new Pair(0,j));
while(que.size()>0){
int size=que.size();
for(int i=0;i<size;i++){
Pair top=que.poll();
for(int it[]:dis){
int x=top.f+it[0];
int y=top.s+it[1];
if(x>=0 && x<n && y>=0 && y<m && dp[top.f][top.s]+((b[x][y]==2)?-1:b[x][y])>=0){
dp[x][y]=Math.max(dp[x][y],dp[top.f][top.s]+((b[x][y]==2)?-1:b[x][y]));
que.add(new Pair(x,y));
}
}
}
}
int max=-1;
for(int i=0;i<m;i++) max=Math.max(max,dp[n-1][i]);
return max;
}
Pseudorandom Number generatorโ
{
int tes=1;
StringBuilder sb=new StringBuilder();
lable:for(int fuck=1;fuck<=tes;fuck++)
{
int n=sc.nextInt(),m=sc.nextInt(),k=sc.nextInt(),i,j,l,ans=-1;
int a[][]=new int[n][m];
for(i=0;i<n;i++)
for(j=0;j<m;j++)
a[i][j]=sc.nextInt();
for(i=0;i<n;i++){
int b[][]=new int[n][m];
for(j=0;j<i;j++)
for(l=0;l<m;l++) b[j][l]=a[j][l];
for(j=i;j<Math.min(n,i+k);j++){
for(l=0;l<m;l++){
if(a[j][l]==2) b[j][l]=0;
else b[j][l]=a[j][l];
}
}
for(j=i+k;j<n;j++)
for(l=0;l<m;l++) b[j][l]=a[j][l];
for(j=0;j<m;j++){
int tmp=bfs(b,j,n,m);
ans=Math.max(ans,tmp);
}
}
System.out.println(ans);
}
System.out.println(sb);
}
public static int bfs(int b[][],int j,int n,int m){
int dis[][]=new int[3][2];
dis[0][0]=1; dis[0][1]=-1;
dis[1][0]=1; dis[1][1]=0;
dis[2][0]=1; dis[2][1]=1;
Queue<Pair> que=new LinkedList<>();
int dp[][]=new int[n][m];
for(int it[]:dp) Arrays.fill(it,-1);
if(b[0][j]==2) return -1;
dp[0][j]=b[0][j];
que.add(new Pair(0,j));
while(que.size()>0){
int size=que.size();
for(int i=0;i<size;i++){
Pair top=que.poll();
for(int it[]:dis){
int x=top.f+it[0];
int y=top.s+it[1];
if(x>=0 && x<n && y>=0 && y<m && dp[top.f][top.s]+((b[x][y]==2)?-1:b[x][y])>=0){
dp[x][y]=Math.max(dp[x][y],dp[top.f][top.s]+((b[x][y]==2)?-1:b[x][y]));
que.add(new Pair(x,y));
}
}
}
}
int max=-1;
for(int i=0;i<m;i++) max=Math.max(max,dp[n-1][i]);
return max;
}
Pseudorandom Number generatorโ
#include <iostream>
#include <string>
#include <algorithm>
#include <climits>
using namespace std;
int getMinMoves(string s) {
int n = s.length();
int moves = 0;
for (int i = 1; i < n; ++i) {
if (s[i] != s[i - 1]) {
int costPrev = abs(s[i] - s[i - 1]);
int costNext = (i < n - 1) ? abs(s[i] - s[i + 1]) : INT_MAX;
if (costPrev <= costNext) {
s[i] = s[i - 1];
moves += costPrev;
} else {
s[i + 1] = s[i];
moves += costNext;
}
}
}
return moves;
}
String modification โ
#include <string>
#include <algorithm>
#include <climits>
using namespace std;
int getMinMoves(string s) {
int n = s.length();
int moves = 0;
for (int i = 1; i < n; ++i) {
if (s[i] != s[i - 1]) {
int costPrev = abs(s[i] - s[i - 1]);
int costNext = (i < n - 1) ? abs(s[i] - s[i + 1]) : INT_MAX;
if (costPrev <= costNext) {
s[i] = s[i - 1];
moves += costPrev;
} else {
s[i + 1] = s[i];
moves += costNext;
}
}
}
return moves;
}
String modification โ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Deloitte Hiring Analyst Trainee
Link ๐
https://www.instahyre.com/job-309989-analyst-trainee-at-deloitte-work-from-home/
Link ๐
https://www.instahyre.com/job-309989-analyst-trainee-at-deloitte-work-from-home/
Instahyre
Analyst Trainee job at Deloitte - Instahyre
Deloitte is looking for a Analyst Trainee in Work From Home with 0-2 years of experience in Data Analysis / Business Intelligence, Presentations, Microsoft Excel, Data Analysis, Corporate Communication, Technical Consulting, etc. Apply today and get yourโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Menlo is hiring Computer Science Interns
For 2023, 2024 Grads
https://www.linkedin.com/posts/onkar-sawarna-569615187_menlo-is-looking-for-hiring-interns-for-the-activity-7214586445003390976-BRWG?utm_source=share&utm_medium=member_android
For 2023, 2024 Grads
https://www.linkedin.com/posts/onkar-sawarna-569615187_menlo-is-looking-for-hiring-interns-for-the-activity-7214586445003390976-BRWG?utm_source=share&utm_medium=member_android
Linkedin
Sign Up | LinkedIn
500 million+ members | Manage your professional identity. Build and engage with your professional network. Access knowledge, insights and opportunities.
๐1
urgent hiring for 7+ posts like Web developers both front end and backend, logo designers, and many more
Batch :2022/2023
https://forms.gle/YEfnw3avT3fDUUvCA
Batch :2022/2023
https://forms.gle/YEfnw3avT3fDUUvCA
One advice to all the freshers out there!! For a single job openings 1000s of candidates are applying and getting your resume shortlisted for further process are quite tough.
Instead, check with your friends and collegemate, when they get placed they will received an offer letter from HR, ask them to share the HR mail id and try to reach out directly.
In this way chances of getting replied back will be more.
Instead, check with your friends and collegemate, when they get placed they will received an offer letter from HR, ask them to share the HR mail id and try to reach out directly.
In this way chances of getting replied back will be more.
๐6
#include <bits/stdc++.h>
using namespace std;
int main() {
int mod = 1000000007;
string s;
cin>>s;
long long n = s.size();
long long i=0;
long long ans = 1;
for(i=0;i<n;i++){
long long c = 1;
while(i<n-1 && s[i]==s[i+1]){
c++;
i++;
}
ans = (ans*c)%mod;
}
cout<<ans%mod;
return 0;
}
Alex Keyboard โ
using namespace std;
int main() {
int mod = 1000000007;
string s;
cin>>s;
long long n = s.size();
long long i=0;
long long ans = 1;
for(i=0;i<n;i++){
long long c = 1;
while(i<n-1 && s[i]==s[i+1]){
c++;
i++;
}
ans = (ans*c)%mod;
}
cout<<ans%mod;
return 0;
}
Alex Keyboard โ
return sum(1 for i in input1 if i<0)
Financial Dataset โ
Financial Dataset โ
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> candies(N);
for (int i = 0; i < N; ++i) {
cin >> candies[i];
}
int min_value = candies[0];
int max_tastiness_index = -1;
for (int i = 1; i < N; ++i) {
int current_difference = candies[i] - min_value;
if (current_difference > max_tastiness_index) {
max_tastiness_index = current_difference;
}
if (candies[i] < min_value) {
min_value = candies[i];
}
}
cout << max_tastiness_index << endl;
return 0;
}
Tastiness index โ
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> candies(N);
for (int i = 0; i < N; ++i) {
cin >> candies[i];
}
int min_value = candies[0];
int max_tastiness_index = -1;
for (int i = 1; i < N; ++i) {
int current_difference = candies[i] - min_value;
if (current_difference > max_tastiness_index) {
max_tastiness_index = current_difference;
}
if (candies[i] < min_value) {
min_value = candies[i];
}
}
cout << max_tastiness_index << endl;
return 0;
}
Tastiness index โ
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Tech Mahindra - Ahmedabad, Fresher Hiring - Manual Testing - July 2024
openings for Manual Testing requirement and are looking for fresher graduates 2023 or 24 pass outs, who can join us at our Ahmedabad office on immediate basis.
Deadline : Before 4 PM, 8th July
https://docs.google.com/forms/d/e/1FAIpQLSfSOlLbgyoYo877t3JtuX8CzTeEM3Fv9WybG86Xb6WVn8qWGQ/viewform
openings for Manual Testing requirement and are looking for fresher graduates 2023 or 24 pass outs, who can join us at our Ahmedabad office on immediate basis.
Deadline : Before 4 PM, 8th July
https://docs.google.com/forms/d/e/1FAIpQLSfSOlLbgyoYo877t3JtuX8CzTeEM3Fv9WybG86Xb6WVn8qWGQ/viewform
Who have Google exams guys??
Send questions here solutions will be provide What the time of exam
Send questions here solutions will be provide What the time of exam
๐คฎ4
#include<bits/stdc++.h>
using namespace std;
int maxi = 0;
int F(int col , vector<vector<int>> &a , vector<int> &dp){
if(col == a[0].size()){
return maxi = max(maxi , (int) dp.size());
}
for(int row = 0 ; row < a.size() ; row++){
if(dp.size() == 0 || dp.back() < a[row][col]){
dp.push_back(a[row][col]);
F(col + 1 , a , dp);
dp.pop_back();
}
else{
int id = lower_bound(dp.begin() , dp.end() , a[row][col]) - dp.begin();
int old = dp[id];
dp[id] = a[row][col];
F(col + 1 , a , dp);
dp[id] = old;
}
}
}
int longestSequence(vector<vector<int>> &matrix){
maxi = 0;
vector<int> dp;
F(0 , matrix , dp);
return maxi;
}
DE Shaw โ
using namespace std;
int maxi = 0;
int F(int col , vector<vector<int>> &a , vector<int> &dp){
if(col == a[0].size()){
return maxi = max(maxi , (int) dp.size());
}
for(int row = 0 ; row < a.size() ; row++){
if(dp.size() == 0 || dp.back() < a[row][col]){
dp.push_back(a[row][col]);
F(col + 1 , a , dp);
dp.pop_back();
}
else{
int id = lower_bound(dp.begin() , dp.end() , a[row][col]) - dp.begin();
int old = dp[id];
dp[id] = a[row][col];
F(col + 1 , a , dp);
dp[id] = old;
}
}
}
int longestSequence(vector<vector<int>> &matrix){
maxi = 0;
vector<int> dp;
F(0 , matrix , dp);
return maxi;
}
DE Shaw โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐ElasticDevs is hiring for Software Engineer (Walkin on July 06, 2024)
Apply here:
https://linkedin.com/jobs/view/3963981202/
Apply here:
https://linkedin.com/jobs/view/3963981202/
Linkedin
ElasticDevs hiring Software Engineer (Walkin on July 06, 2024) in Bengaluru, Karnataka, India | LinkedIn
Posted 5:00:17 PM. Job Title : Software Engineer [ Walkin ]Walk-in Date: July 06, 2024Reporting Time: 12:00 PM 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)
My friend Ashwin Kulkarniโs (Senior Software Engineer at IBM Cloud) is taking a FREE group session on Career in Cloud this weekend!
โก๏ธ Available career options and growth strategies.
โก๏ธ Expert roadmap for ideal preparation.
โก๏ธ AMA with Ashwin directly!
Date: July 7 (12: 30 PM)
Register your spot - https://explore.preplaced.in/B47EP7
โก๏ธ Available career options and growth strategies.
โก๏ธ Expert roadmap for ideal preparation.
โก๏ธ AMA with Ashwin directly!
Date: July 7 (12: 30 PM)
Register your spot - https://explore.preplaced.in/B47EP7
www.preplaced.in
Cloud Careers: Growth and Opportunities in 2024 | Preplaced
Group Session by Ashwin Kulkarni | Staff Software Engineer @IBM | Backend Developer Mentor @Preplaced | GoLang , CI/CD Specialist
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Groww
๐ Job Title: SDE Intern (Frontend)
โ๐ป YOE: 2024, 2025 and 2026 grads
โก๏ธ Apply: https://docs.google.com/forms/d/e/1FAIpQLScoBAT-JXiyzJ-ey9Jikaw86W5DwwNCeMfkpa70duRUPK5C7A/viewform?pli=1
Please do share in your college grps and in case you are applying please react on this post:) ๐โค๏ธ
๐ Job Title: SDE Intern (Frontend)
โ๐ป YOE: 2024, 2025 and 2026 grads
โก๏ธ Apply: https://docs.google.com/forms/d/e/1FAIpQLScoBAT-JXiyzJ-ey9Jikaw86W5DwwNCeMfkpa70duRUPK5C7A/viewform?pli=1
Please do share in your college grps and in case you are applying please react on this post:) ๐โค๏ธ