2 051
Obunachilar
Ma'lumot yo'q24 soatlar
Ma'lumot yo'q7 kun
Ma'lumot yo'q30 kun
Postlar arxiv
import numpy as np
n = int(input())
k = int(input())
mat = [[int(input()) for x in range (n)] for y in range(n)]
s=0
for i in range(n):
#p = mat[i]i]
for j in range(n):
q= mat[i][j]
if j<(n-1):
r=mat[i][j+1]
elif i < (n-1):
p = mat[i+1][j]
if abs(q-r) <= k :
continue
elif abs(q-r)>k:
if q>r:
s=s+abs(np.subtract(k,abs(q-r)))
mat[i][j+1]=mat[i][j+1]+s
else:
s=s+abs(np.subtract(k,abs(q-r)))
mat[i][j]=mat[i][j]+s
else:
if abs(q-p) <= k :
continue
if q>p:
s=s+abs(np.subtract(k,abs(q-p)))
mat[i+1][j]=mat[i+1][j]+s
else:
s=s+abs(np.subtract(k,abs(q-p)))
mat[i][j]=mat[i][j]+s
print(s)
2D matrix
If anyone want help in
💯 Guarantee of clearance 🥳🥳🥳🥳🥳💯💯💯
Tcs
Accenture
LTI
IBM
Wiley edge mThree
Digital
Wipro
Infosys
Capgemini
Cognizant
Epam
Tech Mahindra
Zoho
Ibm
Hexaware
HCL
Amcat
Revature
Virtusa
Only genuine help dont trust the FAKE😡😡
💯 Guarantee of clearance 🥳🥳🥳🥳🥳💯💯💯
Hi @unknown Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@offcampusjobs_0
@offcampusjobs_0
*Important and Urgent Guidelines to students regarding InfyTQ examination*
1. In case you have not attempted a question, you do not get the opportunity to revisit that question again. For e.g if you did not attempt question no.3 and moved on to question no.4, question No.3 will be recorded as unattempted and this action cannot be reversed.
2. The time allotted to the three sections is fixed and there is no flexibility in that. Please note that the time fixed for 3 sections is as follows:
Python-35 minutes
Aptitude-10 minutes
DBMS-15 minutes
*Good luck*
JOIN STUDY FEVER FAMILY ❤️
Discord :
https://discord.gg/WEnsS7BMnB
Google Group : https://groups.google.com/u/1/g/jai-mahakaal--study-fever-/