infoarena informatica de performanta
info
arena
b
log
f
orum
calendar
autentificare
inregistrare
infoarena
>
infoarena - concursuri, probleme, evaluator, articole
>
Probleme externe
> Subiect:
Movie Seating-top coder
Pagini: [
1
]
În jos
« mesajul precedent
următorul mesaj »
Imprimă
Ajutor
Subiect: Movie Seating-top coder (Citit de 2698 ori)
0 Utilizatori şi 1 Vizitator pe acest subiect.
•
S7012MY
Nu mai tace
Karma: 26
Deconectat
Mesaje: 648
Movie Seating-top coder
«
:
Septembrie 25, 2010, 19:43:40 »
Problem Statement
Elly and some of her friends (possibly none) are going to the movies. Their company consists of numFriends people, including Elly. Since they don't want to be spread across the entire hall, they decided to sit either in the same row or in the same column (though not necessarily next to one another). Your are given a vector <string> hall representing the layout of seats in the theater that are already taken. The j-th character of the i-th element of hall will be '#' if the seat at row i, column j is already taken and '.' if it is empty. Return the number of different ways for Elly and her friends to choose numFriends different empty seats so that their seating requirement is fulfilled. Two ways are considered different if there exists a person in their company that will sit in different seats in these two ways.
Examples
0)
2
{ ".#..",
".##.",
"...." }
Returns: 34
Here the movie hall has 3 rows and 4 columns. The second seat in the first row is taken, as well as the seats in the middle of the second row.
De ce e 34? Eu m-am gandit ca ar trebui sa fie o suma din aranjamente(nrloclibere,nrprieteni) de pe fiecare linie si coloana
«
Ultima modificare: Septembrie 25, 2010, 20:24:34 de către Trimbitas Petru
»
Memorat
•
klamathix
Echipa infoarena
Nu mai tace
Karma: 733
Deconectat
Mesaje: 1.216
Răspuns: Movie Seating-top coder
«
Răspunde #1 :
Septembrie 25, 2010, 21:22:56 »
Asa si este. Si suma iti da 34 pe exemplu.
Memorat
•
S7012MY
Nu mai tace
Karma: 26
Deconectat
Mesaje: 648
Răspuns: Movie Seating-top coder
«
Răspunde #2 :
Septembrie 26, 2010, 11:42:36 »
Dupa ce formula calculezi aranjamentele? Nu dupa n(n-1)(n-2)...(n-k+1). Daca calculezi asa nu da 34
Memorat
•
klamathix
Echipa infoarena
Nu mai tace
Karma: 733
Deconectat
Mesaje: 1.216
Răspuns: Movie Seating-top coder
«
Răspunde #3 :
Septembrie 26, 2010, 13:10:16 »
3 * A(3,2) ( coloana 1 si 4 , linia 1) + 2 * A (2,2) ( linia 2 si coloana 3) + 1 * A(4,2) ( linia 3) =
3 * 6 + 2 * 2 + 1 * 12=
34.
Memorat
Pagini: [
1
]
În sus
Imprimă
infoarena
>
infoarena - concursuri, probleme, evaluator, articole
>
Probleme externe
> Subiect:
Movie Seating-top coder
« mesajul precedent
următorul mesaj »
Schimbă forumul:
Selectează o destinaţie:
-----------------------------
infoarena - concursuri, probleme, evaluator, articole
-----------------------------
=> Concursuri
===> Junior Challange 2023
===> Algoritmiada 2022
=====> Runda 1
=====> Runda 2
=====> Runda 3
=====> Runda 4
===> Summer Challenge 2021
===> Junior Challenge 2021
===> FMI No Stress 10
===> Winter Challenge 2020
===> Autumn WarmUp 2020
===> Summer Challenge 2020
===> Junior Challenge 2020
===> Concurs de incalzire 2020
===> FMI No Stress 9
===> Autumn WarmUp 2019
===> Summer Challenge 2019
===> Junior Challange 2019
===> Algoritmiada 2019
===> Info Oltenia 2019
===> Arhiva concursuri
=====> Info Oltenia 2018
=====> Junior Challenge 2018
=====> Algoritmiada 2018
=====> AGM 2018
=====> Grigore Moisil 2018
=====> RCPC 2018
=====> Fmi No Stress 8
=====> Urmasii lui Moisil 2017
=====> Grigore Moisil 2017
=====> Prosoft @ NT
=====> Algoritmiada 2017
=====> PreOJI 2017
=====> FMI No Stress 2017
=====> AGM 2017
=====> Lot 2017
=====> ACM ICPC Faza Nationala 2017
=====> PreOJI 2016
=====> ONIS 2016
=====> Grigore Moisil 2016
=====> Urmasii lui Moisil 2016
=====> AGM 2016
=====> Algoritmiada 2016
=====> FMI No Stress 6
=====> Urmasii lui Moisil 2015
=====> FMI No Stress 5
=====> ONIS 2015
=====> Concursul National de Soft Grigore Moisil Lugoj
=====> ACM-ICPC Faza Nationala 2014-2015
=====> Infoarena Monthly 2014
=====> Concurs Mihai Patrascu 2013
=====> Algoritmiada 2015
=====> AGM 2015
=====> Junior Challenge 2015
=====> ONIS 2014
=====> Algoritmiada 2014
=====> FMI No Stress 4
=====> preONI 2006
=====> .com 2012
=====> Infoarena Monthly 2012
=====> Code Pandas
=====> Algoritmiada 2013
=====> FMI No Stress 3
=====> FMI No Stress 2012
=====> Junior Challenge 2012
=====> Algoritmiada 2012
=====> .com 2011
=====> Girls Programming Camp 2011
=====> Algoritmiada 2011
=====> F11 Competition 2011
=====> Tiberiu Popoviciu 2011
=====> Grigore Moisil 2011
=====> RMMS 2011
=====> FMI No Stress 2010
=====> Grigore Moisil 2010
=====> .com 2009
=====> Stelele Informaticii 2009
=====> Stelele Informaticii 2010
=====> Algoritmiada 2009
=====> Algoritmiada 2010
=====> Grigore Moisil 2009
=====> CCEX 2009
=====> Summer Challenge 2009
=====> All You Can Code 2008
=====> Selectie echipe ACM ICPC, UPB 2008
=====> Junior Challenge 2008
=====> Happy Coding 2008
=====> preONI 2008
=====> Grigore Moisil 2008
=====> Winter Challenge 2008
=====> Happy Coding 2007
=====> Autumn Warmup 2007
=====> preONI 2007
=====> Summer Challenge 2007
=====> Junior Challenge
=====> Winter Challenge 1
=====> Unirea 2007
=====> Happy Coding 2006
=====> Autumn WarmUp 2006
=====> Summer Challenge Doi
=====> Summer Challenge
=====> Happy coding
=====> Grigore Moisil
=====> Happy Birthday Infoarena
===> RCPC 2019
===> Summer Challenge Trei
=> Arhiva de probleme
===> Probleme pentru bacalaureat
=> Arhiva Infoarena Monthly
=> Arhiva ACM
=> Arhiva educationala
=> Concursuri virtuale
=> Informatica
===> Teme
=> Articole
===> Downloads
=> Probleme externe
===> .CAMPION
===> SGU
===> TIMUS
===> UVA
===> SPOJ
===> PKU
===> TJU
-----------------------------
Comunitate - feedback, proiecte si distractie
-----------------------------
=> Implica-te!
===> Arhiva educationala
===> Imbunatatire teste
===> Development
===> Scrie articole
===> Extinde arhiva
=> Blog
=> Feedback infoarena
===> Sondaje
===> Arhiva
===> IAP (Infoarena Proposal)
=> Off topic
Se încarcă ...