imi bag pula
This commit is contained in:
parent
6b3ecf7138
commit
31bc65ca8e
2 changed files with 26 additions and 0 deletions
5
3751/input
Normal file
5
3751/input
Normal file
|
@ -0,0 +1,5 @@
|
|||
3 21
|
||||
10 5 2025
|
||||
Rares 20 4 2000
|
||||
Ion 6 3 1997
|
||||
Rares 14 7 2001
|
21
3751/solution.py
Normal file
21
3751/solution.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from datetime import datetime
|
||||
l1 = input().split(" ")
|
||||
n = int(l1[0])
|
||||
k = int(l1[1])
|
||||
data = input()
|
||||
date = datetime.strptime(data, "%d %m %Y")
|
||||
oameni = []
|
||||
for i in range(n):
|
||||
data = input().split(" ")
|
||||
nume = data[0]
|
||||
nastere = datetime.strptime(f"{data[1]} {data[2]} {data[3]}", "%d %m %Y")
|
||||
for om in oameni:
|
||||
if om[0] == nume:
|
||||
nastere = date
|
||||
oameni.append([nume, nastere])
|
||||
for om in oameni:
|
||||
diferenta = date - om[1]
|
||||
if (diferenta.days)/365.25 >= k:
|
||||
print(1)
|
||||
else:
|
||||
print(0)
|
Loading…
Add table
Add a link
Reference in a new issue