Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
3-6.격자판 최대합
n = int(input()) a = [list(map(int, input().split())) for _ in range(n)] largest = -2147000000 for i in range(n): sum1 = sum2 = 0 for j in range(n): sum1 += a[i][j] sum2 += a[j][i] if sum1>largest: largest = sum1 if sum2>largest: largest = sum2 sum1=sum2=0 for i in range(n): sum1+=a[i][i] sum2+=a[i][n-i-1] if sum1>largest: largest = sum1 if sum2>largest: largest = sum2 print(largest)
run
|
edit
|
history
|
help
0
python, Polymorphie, attributes, setter and getter the pythonic way (V3)
PyRegSearch
snake water gun correct
15
crown pattern
Submission.py
max/min fuction
quiz3
(P3) Rok przestępny
repeat string