În cadrul Turneului Internațional de Tenis ATP Cup, fiecare stat participant are un lot de jucători. Acest lot urmează să-și reprezinte țara într-o succesiune de meciuri jucate contra membrilor celorlalte loturi. Se dorește realizarea unei soluții software care să automatizeze desfășurarea turneului.
Prima linie a fișierului date.in va conține un număr natural, reprezentând numărul țărilor participante. În continuare, pentru fiecare țară participantă se vor găsi următoarele date:
1 1 1 1 1
Haas Tommy 56 Federer Roger 87
- Se vor rezolva toate cerințele, iar datele de intrare pentru cerința 5 sunt “Haas Tommy 56” și “Federer Roger 87”.
<note important>Scorul local reprezintă scorul acumulat de fiecare țară pe parcursul meciurilor dintre jucători (până când coada meciurilor se golește).</note>
Tema are un total de 150 puncte. Verificarea temei se face prin 15 teste. Fiecărei cerințe îi corespund 3 teste. Punctajele cerințelor sunt împărțite, în funcție de complexitate, în modul următor:
Total: 135 puncte Restul de 15 puncte corespund fișierului README în care va fi descrisă soluția, Coding Style-ului și comentariilor din cod, după cum urmează:
//Structura pentru jucator: typedef struct Player { char *last_name; char *first_name; int score; } Player; //Structura pentru tara: typedef struct Country { char *name; int nr_players; int global_score; Player *players; } Country;
Afișarea se va face în fișierul date.out:
(Exemplu: “Romania”)
(Exemplu: “=== Etapa 4 ===”)
(Exemplu: “Brazilia 12 —– Franta 22”)
(Exemplu: “Haas Tommy 36 vs Tecau Horia 35”)
(Exemplu: “Spania — 21”)
(Exemplu: “Hanescu Victor nu poate fi identificat!\n”)
Fișierele folosite de checker arată astfel:
1 1 1 1 1 Cecchinato Marco 82 Federer Roger 98
34 // numarul de echipe din fisier 3 // numarul de jucatori Elvetia //numele echipei Rosset Marc 23 //numele prenumele si punctajul jucatorului 1 Federer Roger 38 Chiudinelli Marco 28 3 Lituania Berankis Ricardas 20 Babelis Tadas 24 Julius Tverijonas 18 3 China Xin Gao 25 Zhe Li 20 Ze Zhang 18 3 Franta Serra Florent 21 Monfils Gael 25 Pouille Lucas 34 3 Spania Ferrer David 29 Nadal Rafael 36 Montanes Albert 22 3 Georgia Metreveli Aleksandre 28 Basilashvili Nikoloz 20 Tsidavze George 29 3 Letonia Gulbis Ernests 28 Lejnieks Karlis 30 Pavlovs Deniss 25 3 Romania Hanescu Victor 31 Tecau Horia 33 Cruciat Adrian 23 3 Estonia Zopp Jurgen 28 Tamm Kristjan 31 Ivanov Vladimir 21 3 Germania Haas Tommy 31 Kiefer Nicolas 26 Becker Boris 28 3 Rusia Andreev Igor 24 Davidenko Nikolai 30 Safin Marat 28 3 Croatia Ancic Mario 19 Ljubicic Ivan 22 Cilic Marin 22 3 Suedia Borg Bjorn 21 Edberg Stefan 24 Lindstedt Robert 18 3 Australia Perry Todd 21 Rafter Patrick 26 Hanley Paul 21 3 Brazilia Kuerten Gustavo 24 Melo Marcelo 19 Bellucci Thomaz 25 3 Serbia Dokovic Novak 31 Zimonjic Nenad 29 Troicki Victor 23 3 Belgia Malisse Xavier 23 Bemelmans Ruben 20 Darcis Steve 27 3 Argentina Coria Guillermo 22 Acasuso Jose 29 Mayer Leonardo 27 3 Japonia Taro Daniel 25 Nishikori Kei 30 Tatsuma Ito 22 3 Chile Gonzalez Fernando 26 Rios Marcelo 30 Massu Nicolas 19 3 Polonia Kubot Lukasz 24 Fibak Wojtek 23 Tloczynski Ignacy 34 3 Canada Pospisil Vasek 23 Raonic Milos 22 Nestor Daniel 17 3 Uruguai Cuevas Martin 19 Cuevas Pablo 27 Behar Ariel 25 3 Pakistan Khan Aqeel 17 Meer Saeed 25 Rahim Haroon 22 3 Danemarca Nielsen Kurt 27 Carlsen Kenneth 20 Ulrich Lars 30 3 Norvegia Durasovic Viktor 22 Ruud Casper 26 Langaard Conrad 20 3 Irlanda McGee James 25 Sorensen Louk 28 Cluskey James 23 3 Turcia Ilhan Marsel 27 Celikbilek Altug 20 Ilkel Cem 28 3 Cipru Baghdatis Marcos 19 Chrysochos Petros 30 Pervolarakis Michail 28 3 Italia Fognini Fabio 29 Cecchinato Marco 25 Berrettini Matteo 30 3 Grecia Tsitsipas Stefanos 20 Jakupovic Alexandros 19 Economidis Konstantinos 25 3 India Paes Leander 23 Bhambri Yuki 26 Nagal Sumit 22 3 Slovacia Klizan Martin 30 Beck Karol 25 Mecir Miloslav 22 3 Bulgaria Dimitrov Grigor 19 Kuzmanov Dimitar 30 Lazarov Alexander 27
Elvetia China Franta Spania Georgia Letonia Romania Estonia Germania Rusia Croatia Suedia Australia Brazilia Serbia Belgia Argentina Japonia Chile Polonia Uruguai Pakistan Danemarca Norvegia Irlanda Turcia Cipru Italia Grecia India Slovacia Bulgaria ====== ETAPA 1 ====== Bulgaria 0 ----- Slovacia 0 Dimitrov Grigor 19 vs Klizan Martin 30 Dimitrov Grigor 19 vs Beck Karol 25 Dimitrov Grigor 19 vs Mecir Miloslav 22 Kuzmanov Dimitar 30 vs Klizan Martin 35 Kuzmanov Dimitar 30 vs Beck Karol 30 Kuzmanov Dimitar 32 vs Mecir Miloslav 27 Lazarov Alexander 27 vs Klizan Martin 40 Lazarov Alexander 27 vs Beck Karol 32 Lazarov Alexander 27 vs Mecir Miloslav 27 India 0 ----- Grecia 0 Paes Leander 23 vs Tsitsipas Stefanos 20 Paes Leander 28 vs Jakupovic Alexandros 19 Paes Leander 33 vs Economidis Konstantinos 25 Bhambri Yuki 26 vs Tsitsipas Stefanos 20 Bhambri Yuki 31 vs Jakupovic Alexandros 19 Bhambri Yuki 36 vs Economidis Konstantinos 25 Nagal Sumit 22 vs Tsitsipas Stefanos 20 Nagal Sumit 27 vs Jakupovic Alexandros 19 Nagal Sumit 32 vs Economidis Konstantinos 25 Italia 0 ----- Cipru 0 Fognini Fabio 29 vs Baghdatis Marcos 19 Fognini Fabio 34 vs Chrysochos Petros 30 Fognini Fabio 39 vs Pervolarakis Michail 28 Cecchinato Marco 25 vs Baghdatis Marcos 19 Cecchinato Marco 30 vs Chrysochos Petros 30 Cecchinato Marco 32 vs Pervolarakis Michail 28 Berrettini Matteo 30 vs Baghdatis Marcos 19 Berrettini Matteo 35 vs Chrysochos Petros 32 Berrettini Matteo 40 vs Pervolarakis Michail 28 Turcia 0 ----- Irlanda 0 Ilhan Marsel 27 vs McGee James 25 Ilhan Marsel 32 vs Sorensen Louk 28 Ilhan Marsel 37 vs Cluskey James 23 Celikbilek Altug 20 vs McGee James 25 Celikbilek Altug 20 vs Sorensen Louk 28 Celikbilek Altug 20 vs Cluskey James 23 Ilkel Cem 28 vs McGee James 30 Ilkel Cem 28 vs Sorensen Louk 33 Ilkel Cem 28 vs Cluskey James 28 Norvegia 0 ----- Danemarca 0 Durasovic Viktor 22 vs Nielsen Kurt 27 Durasovic Viktor 22 vs Carlsen Kenneth 20 Durasovic Viktor 27 vs Ulrich Lars 30 Ruud Casper 26 vs Nielsen Kurt 32 Ruud Casper 26 vs Carlsen Kenneth 20 Ruud Casper 31 vs Ulrich Lars 35 Langaard Conrad 20 vs Nielsen Kurt 37 Langaard Conrad 20 vs Carlsen Kenneth 20 Langaard Conrad 22 vs Ulrich Lars 40 Pakistan 0 ----- Uruguai 0 Khan Aqeel 17 vs Cuevas Martin 19 Khan Aqeel 17 vs Cuevas Pablo 27 Khan Aqeel 17 vs Behar Ariel 25 Meer Saeed 25 vs Cuevas Martin 24 Meer Saeed 30 vs Cuevas Pablo 32 Meer Saeed 30 vs Behar Ariel 30 Rahim Haroon 22 vs Cuevas Martin 24 Rahim Haroon 22 vs Cuevas Pablo 37 Rahim Haroon 22 vs Behar Ariel 32 Polonia 0 ----- Chile 0 Kubot Lukasz 24 vs Gonzalez Fernando 26 Kubot Lukasz 24 vs Rios Marcelo 30 Kubot Lukasz 24 vs Massu Nicolas 19 Fibak Wojtek 23 vs Gonzalez Fernando 31 Fibak Wojtek 23 vs Rios Marcelo 35 Fibak Wojtek 23 vs Massu Nicolas 19 Tloczynski Ignacy 34 vs Gonzalez Fernando 36 Tloczynski Ignacy 34 vs Rios Marcelo 40 Tloczynski Ignacy 34 vs Massu Nicolas 19 Japonia 0 ----- Argentina 0 Taro Daniel 25 vs Coria Guillermo 22 Taro Daniel 30 vs Acasuso Jose 29 Taro Daniel 35 vs Mayer Leonardo 27 Nishikori Kei 30 vs Coria Guillermo 22 Nishikori Kei 35 vs Acasuso Jose 29 Nishikori Kei 40 vs Mayer Leonardo 27 Tatsuma Ito 22 vs Coria Guillermo 22 Tatsuma Ito 24 vs Acasuso Jose 29 Tatsuma Ito 24 vs Mayer Leonardo 27 Belgia 0 ----- Serbia 0 Malisse Xavier 23 vs Dokovic Novak 31 Malisse Xavier 23 vs Zimonjic Nenad 29 Malisse Xavier 23 vs Troicki Victor 23 Bemelmans Ruben 20 vs Dokovic Novak 36 Bemelmans Ruben 20 vs Zimonjic Nenad 34 Bemelmans Ruben 20 vs Troicki Victor 25 Darcis Steve 27 vs Dokovic Novak 41 Darcis Steve 27 vs Zimonjic Nenad 39 Darcis Steve 27 vs Troicki Victor 30 Brazilia 0 ----- Australia 0 Kuerten Gustavo 24 vs Perry Todd 21 Kuerten Gustavo 29 vs Rafter Patrick 26 Kuerten Gustavo 34 vs Hanley Paul 21 Melo Marcelo 19 vs Perry Todd 21 Melo Marcelo 19 vs Rafter Patrick 26 Melo Marcelo 19 vs Hanley Paul 21 Bellucci Thomaz 25 vs Perry Todd 26 Bellucci Thomaz 25 vs Rafter Patrick 31 Bellucci Thomaz 25 vs Hanley Paul 26 Suedia 0 ----- Croatia 0 Borg Bjorn 21 vs Ancic Mario 19 Borg Bjorn 26 vs Ljubicic Ivan 22 Borg Bjorn 31 vs Cilic Marin 22 Edberg Stefan 24 vs Ancic Mario 19 Edberg Stefan 29 vs Ljubicic Ivan 22 Edberg Stefan 34 vs Cilic Marin 22 Lindstedt Robert 18 vs Ancic Mario 19 Lindstedt Robert 18 vs Ljubicic Ivan 22 Lindstedt Robert 18 vs Cilic Marin 22 Rusia 0 ----- Germania 0 Andreev Igor 24 vs Haas Tommy 31 Andreev Igor 24 vs Kiefer Nicolas 26 Andreev Igor 24 vs Becker Boris 28 Davidenko Nikolai 30 vs Haas Tommy 36 Davidenko Nikolai 30 vs Kiefer Nicolas 31 Davidenko Nikolai 30 vs Becker Boris 33 Safin Marat 28 vs Haas Tommy 41 Safin Marat 28 vs Kiefer Nicolas 36 Safin Marat 28 vs Becker Boris 38 Estonia 0 ----- Romania 0 Zopp Jurgen 28 vs Hanescu Victor 31 Zopp Jurgen 28 vs Tecau Horia 33 Zopp Jurgen 28 vs Cruciat Adrian 23 Tamm Kristjan 31 vs Hanescu Victor 36 Tamm Kristjan 31 vs Tecau Horia 38 Tamm Kristjan 31 vs Cruciat Adrian 23 Ivanov Vladimir 21 vs Hanescu Victor 41 Ivanov Vladimir 21 vs Tecau Horia 43 Ivanov Vladimir 21 vs Cruciat Adrian 23 Letonia 0 ----- Georgia 0 Gulbis Ernests 28 vs Metreveli Aleksandre 28 Gulbis Ernests 30 vs Basilashvili Nikoloz 20 Gulbis Ernests 35 vs Tsidavze George 29 Lejnieks Karlis 30 vs Metreveli Aleksandre 30 Lejnieks Karlis 32 vs Basilashvili Nikoloz 20 Lejnieks Karlis 37 vs Tsidavze George 29 Pavlovs Deniss 25 vs Metreveli Aleksandre 32 Pavlovs Deniss 25 vs Basilashvili Nikoloz 20 Pavlovs Deniss 30 vs Tsidavze George 29 Spania 0 ----- Franta 0 Ferrer David 29 vs Serra Florent 21 Ferrer David 34 vs Monfils Gael 25 Ferrer David 39 vs Pouille Lucas 34 Nadal Rafael 36 vs Serra Florent 21 Nadal Rafael 41 vs Monfils Gael 25 Nadal Rafael 46 vs Pouille Lucas 34 Montanes Albert 22 vs Serra Florent 21 Montanes Albert 27 vs Monfils Gael 25 Montanes Albert 32 vs Pouille Lucas 34 China 0 ----- Elvetia 0 Xin Gao 25 vs Rosset Marc 23 Xin Gao 30 vs Federer Roger 38 Xin Gao 30 vs Chiudinelli Marco 28 Zhe Li 20 vs Rosset Marc 23 Zhe Li 20 vs Federer Roger 43 Zhe Li 20 vs Chiudinelli Marco 28 Ze Zhang 18 vs Rosset Marc 28 Ze Zhang 18 vs Federer Roger 48 Ze Zhang 18 vs Chiudinelli Marco 33 === WINNER === Elvetia --- 21 Spania --- 24 Letonia --- 20 Romania --- 21 Germania --- 27 Suedia --- 18 Australia --- 18 Serbia --- 25 Japonia --- 19 Chile --- 18 Uruguai --- 22 Danemarca --- 19 Irlanda --- 16 Italia --- 25 India --- 27 Slovacia --- 20 ====== ETAPA 2 ====== Slovacia 20 ----- India 27 Klizan Martin 45 vs Paes Leander 38 Klizan Martin 50 vs Bhambri Yuki 41 Klizan Martin 55 vs Nagal Sumit 37 Beck Karol 37 vs Paes Leander 38 Beck Karol 37 vs Bhambri Yuki 41 Beck Karol 37 vs Nagal Sumit 37 Mecir Miloslav 29 vs Paes Leander 43 Mecir Miloslav 29 vs Bhambri Yuki 46 Mecir Miloslav 29 vs Nagal Sumit 39 Italia 25 ----- Irlanda 16 Fognini Fabio 44 vs McGee James 35 Fognini Fabio 49 vs Sorensen Louk 38 Fognini Fabio 54 vs Cluskey James 30 Cecchinato Marco 37 vs McGee James 35 Cecchinato Marco 42 vs Sorensen Louk 38 Cecchinato Marco 47 vs Cluskey James 30 Berrettini Matteo 45 vs McGee James 35 Berrettini Matteo 50 vs Sorensen Louk 38 Berrettini Matteo 55 vs Cluskey James 30 Danemarca 19 ----- Uruguai 22 Nielsen Kurt 42 vs Cuevas Martin 29 Nielsen Kurt 47 vs Cuevas Pablo 42 Nielsen Kurt 52 vs Behar Ariel 37 Carlsen Kenneth 22 vs Cuevas Martin 29 Carlsen Kenneth 22 vs Cuevas Pablo 42 Carlsen Kenneth 22 vs Behar Ariel 37 Ulrich Lars 45 vs Cuevas Martin 34 Ulrich Lars 50 vs Cuevas Pablo 47 Ulrich Lars 55 vs Behar Ariel 42 Chile 18 ----- Japonia 19 Gonzalez Fernando 41 vs Taro Daniel 40 Gonzalez Fernando 46 vs Nishikori Kei 45 Gonzalez Fernando 51 vs Tatsuma Ito 24 Rios Marcelo 45 vs Taro Daniel 40 Rios Marcelo 50 vs Nishikori Kei 45 Rios Marcelo 55 vs Tatsuma Ito 24 Massu Nicolas 19 vs Taro Daniel 40 Massu Nicolas 19 vs Nishikori Kei 45 Massu Nicolas 19 vs Tatsuma Ito 24 Serbia 25 ----- Australia 18 Dokovic Novak 46 vs Perry Todd 31 Dokovic Novak 51 vs Rafter Patrick 36 Dokovic Novak 56 vs Hanley Paul 31 Zimonjic Nenad 44 vs Perry Todd 31 Zimonjic Nenad 49 vs Rafter Patrick 36 Zimonjic Nenad 54 vs Hanley Paul 31 Troicki Victor 35 vs Perry Todd 31 Troicki Victor 40 vs Rafter Patrick 36 Troicki Victor 45 vs Hanley Paul 31 Suedia 18 ----- Germania 27 Borg Bjorn 36 vs Haas Tommy 46 Borg Bjorn 36 vs Kiefer Nicolas 41 Borg Bjorn 36 vs Becker Boris 43 Edberg Stefan 39 vs Haas Tommy 51 Edberg Stefan 39 vs Kiefer Nicolas 46 Edberg Stefan 39 vs Becker Boris 48 Lindstedt Robert 18 vs Haas Tommy 56 Lindstedt Robert 18 vs Kiefer Nicolas 51 Lindstedt Robert 18 vs Becker Boris 53 Romania 21 ----- Letonia 20 Hanescu Victor 46 vs Gulbis Ernests 40 Hanescu Victor 51 vs Lejnieks Karlis 42 Hanescu Victor 56 vs Pavlovs Deniss 35 Tecau Horia 48 vs Gulbis Ernests 40 Tecau Horia 53 vs Lejnieks Karlis 42 Tecau Horia 58 vs Pavlovs Deniss 35 Cruciat Adrian 28 vs Gulbis Ernests 40 Cruciat Adrian 28 vs Lejnieks Karlis 42 Cruciat Adrian 28 vs Pavlovs Deniss 35 Spania 24 ----- Elvetia 21 Ferrer David 44 vs Rosset Marc 33 Ferrer David 49 vs Federer Roger 53 Ferrer David 49 vs Chiudinelli Marco 38 Nadal Rafael 51 vs Rosset Marc 33 Nadal Rafael 56 vs Federer Roger 58 Nadal Rafael 56 vs Chiudinelli Marco 38 Montanes Albert 32 vs Rosset Marc 33 Montanes Albert 32 vs Federer Roger 63 Montanes Albert 32 vs Chiudinelli Marco 38 === WINNER === Elvetia --- 36 Romania --- 39 Germania --- 54 Serbia --- 52 Chile --- 36 Danemarca --- 37 Italia --- 52 India --- 43 ====== ETAPA 3 ====== India 43 ----- Italia 52 Paes Leander 48 vs Fognini Fabio 59 Paes Leander 48 vs Cecchinato Marco 52 Paes Leander 48 vs Berrettini Matteo 60 Bhambri Yuki 51 vs Fognini Fabio 64 Bhambri Yuki 51 vs Cecchinato Marco 57 Bhambri Yuki 51 vs Berrettini Matteo 65 Nagal Sumit 44 vs Fognini Fabio 69 Nagal Sumit 44 vs Cecchinato Marco 62 Nagal Sumit 44 vs Berrettini Matteo 70 Danemarca 37 ----- Chile 36 Nielsen Kurt 57 vs Gonzalez Fernando 56 Nielsen Kurt 62 vs Rios Marcelo 60 Nielsen Kurt 67 vs Massu Nicolas 19 Carlsen Kenneth 22 vs Gonzalez Fernando 56 Carlsen Kenneth 22 vs Rios Marcelo 60 Carlsen Kenneth 22 vs Massu Nicolas 19 Ulrich Lars 60 vs Gonzalez Fernando 61 Ulrich Lars 60 vs Rios Marcelo 65 Ulrich Lars 60 vs Massu Nicolas 19 Serbia 52 ----- Germania 54 Dokovic Novak 61 vs Haas Tommy 61 Dokovic Novak 63 vs Kiefer Nicolas 56 Dokovic Novak 68 vs Becker Boris 58 Zimonjic Nenad 59 vs Haas Tommy 63 Zimonjic Nenad 59 vs Kiefer Nicolas 56 Zimonjic Nenad 64 vs Becker Boris 58 Troicki Victor 50 vs Haas Tommy 68 Troicki Victor 50 vs Kiefer Nicolas 56 Troicki Victor 50 vs Becker Boris 58 Romania 39 ----- Elvetia 36 Hanescu Victor 61 vs Rosset Marc 38 Hanescu Victor 66 vs Federer Roger 68 Hanescu Victor 66 vs Chiudinelli Marco 43 Tecau Horia 63 vs Rosset Marc 38 Tecau Horia 68 vs Federer Roger 73 Tecau Horia 68 vs Chiudinelli Marco 43 Cruciat Adrian 28 vs Rosset Marc 38 Cruciat Adrian 28 vs Federer Roger 78 Cruciat Adrian 28 vs Chiudinelli Marco 43 === WINNER === Elvetia --- 51 Serbia --- 65 Danemarca --- 52 Italia --- 79 ====== ETAPA 4 ====== Italia 79 ----- Danemarca 52 Fognini Fabio 74 vs Nielsen Kurt 72 Fognini Fabio 79 vs Carlsen Kenneth 27 Fognini Fabio 84 vs Ulrich Lars 65 Cecchinato Marco 67 vs Nielsen Kurt 72 Cecchinato Marco 67 vs Carlsen Kenneth 27 Cecchinato Marco 72 vs Ulrich Lars 65 Berrettini Matteo 75 vs Nielsen Kurt 77 Berrettini Matteo 75 vs Carlsen Kenneth 27 Berrettini Matteo 80 vs Ulrich Lars 65 Serbia 65 ----- Elvetia 51 Dokovic Novak 73 vs Rosset Marc 43 Dokovic Novak 78 vs Federer Roger 83 Dokovic Novak 78 vs Chiudinelli Marco 48 Zimonjic Nenad 69 vs Rosset Marc 43 Zimonjic Nenad 74 vs Federer Roger 88 Zimonjic Nenad 74 vs Chiudinelli Marco 48 Troicki Victor 50 vs Rosset Marc 43 Troicki Victor 55 vs Federer Roger 93 Troicki Victor 55 vs Chiudinelli Marco 48 === WINNER === Serbia --- 83 Italia --- 100 ====== ETAPA 5 ====== Italia 100 ----- Serbia 83 Fognini Fabio 89 vs Dokovic Novak 83 Fognini Fabio 94 vs Zimonjic Nenad 79 Fognini Fabio 99 vs Troicki Victor 60 Cecchinato Marco 77 vs Dokovic Novak 83 Cecchinato Marco 77 vs Zimonjic Nenad 79 Cecchinato Marco 77 vs Troicki Victor 60 Berrettini Matteo 85 vs Dokovic Novak 88 Berrettini Matteo 85 vs Zimonjic Nenad 84 Berrettini Matteo 90 vs Troicki Victor 60 === WINNER === Italia --- 118 ====== CLASAMENT JUCATORI ====== Fognini Fabio 104 Federer Roger 98 Berrettini Matteo 95 Dokovic Novak 93 Zimonjic Nenad 84 Cecchinato Marco 82 Ulrich Lars 65 Troicki Victor 60 Chiudinelli Marco 48 Rosset Marc 43 Carlsen Kenneth 27 3
Executabilul obținut în urma compilării va avea numele tenis, iar regula de rulare va fi: