-
Notifications
You must be signed in to change notification settings - Fork 0
/
linear depedence
33 lines (31 loc) · 942 Bytes
/
linear depedence
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
n=int(input())
ilosc=0
wektory=[]
for i in range(n):
linia=input().split()
wektory.append(linia)
for i in range(n):
kolumna=[]
for j in range(n):
kolumna.append(wektory[j][i])
wektory.append(kolumna)
for i in range(0,2*n-1):
for j in range(i+1,2*n):
flaga=True
wektor1=[int(x) for x in wektory[i]]
wektor2=[int(x) for x in wektory[j]]
if(sum(wektor1)==0 or sum(wektor2)==0):
if(sum(wektor1)==0 and sum(wektor2)==0): flaga=True
else: flaga=False
else:
for h in range(n):
if(wektor2[h]!=0):
wartosc=h
break
if(wektor1[wartosc]==0): flaga=False
else:
for h in range(n):
if((wektor2[h]*wektor1[wartosc])/wektor2[wartosc]!=wektor1[h]): flaga=False
if(flaga==True):
ilosc=ilosc+1
print(ilosc)