Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Bitnami MediaWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
4194 - EchipaFB
(section)
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Rezolvare == <syntaxhighlight lang="python3" line="1"> MODULO = 998244353 def este_input_valid(F, B): return 1 <= F <= 100000 and 1 <= B <= 100000 def calculeaza_moduri(F, B): rezultate = [] total_elevi = F + B for K in range(1, total_elevi + 1): moduri = 0 for numar_fete in range(1, min(K, F) + 1, 2): numar_baieti = K - numar_fete if numar_baieti <= B: moduri += 1 rezultate.append(moduri % MODULO) return rezultate if __name__ == "__main__": # Citire date de intrare F = int(input("Introduceți numărul de fete (F): ")) B = int(input("Introduceți numărul de băieți (B): ")) # Verificare validitate date de intrare if not este_input_valid(F, B): print("Datele introduse nu corespund restricțiilor impuse.") else: # Calcul și afișare rezultate rezultate = calculeaza_moduri(F, B) for K, moduri in enumerate(rezultate, start=1): print(f"Pentru K = {K}, numărul de moduri este: {moduri}") </syntaxhighlight>
Summary:
Please note that all contributions to Bitnami MediaWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Bitnami MediaWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width