DN09 - Naloga 5

This commit is contained in:
Gašper Dobrovoljc 2024-05-19 18:43:28 +02:00
parent 1f8feb3971
commit 84a6f51bd1
No known key found for this signature in database
GPG Key ID: 0E7E037018CFA5A5
3 changed files with 1290 additions and 5 deletions

View File

@ -417,12 +417,10 @@ class ZgodovinaTekmovanj {
} }
public void izpisiPobrateneDrzave(int topN) { public void izpisiPobrateneDrzave(int topN) {
System.out.println("Drzave z najvec medsebojnih glasov:"); Map<String, Integer> tocke = new HashMap<>();
Map<String, Integer> tocke = new LinkedHashMap<>();
for (Tekmovanje tekmovanje : seznamTekmovanj) { for (Tekmovanje tekmovanje : seznamTekmovanj) {
for (Glas glas : tekmovanje.getSeznamGlasov()) { for (Glas glas : tekmovanje.getSeznamGlasov()) {
String key = Stream.of(glas.getOdDrzave(), glas.getZaDrzavo()).sorted().collect(Collectors.joining(":")); String key = Stream.of(glas.getOdDrzave(), glas.getZaDrzavo()).sorted().collect(Collectors.joining("@"));
tocke.put(key, tocke.getOrDefault(key, 0) + glas.getStTock()); tocke.put(key, tocke.getOrDefault(key, 0) + glas.getStTock());
} }
} }
@ -432,10 +430,11 @@ class ZgodovinaTekmovanj {
.limit(Math.min(topN, tocke.size())) .limit(Math.min(topN, tocke.size()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (v1, v2) -> v1, LinkedHashMap::new)); .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (v1, v2) -> v1, LinkedHashMap::new));
System.out.println("Drzave z najvec medsebojnih glasov:");
int n = 1; int n = 1;
for (String key : sortirane.keySet()) { for (String key : sortirane.keySet()) {
int t = sortirane.get(key); int t = sortirane.get(key);
String[] drzave = key.split(":"); String[] drzave = key.split("@");
System.out.printf("%d. %s <-(%dt)-> %s\n", n, drzave[0], t, drzave[1]); System.out.printf("%d. %s <-(%dt)-> %s\n", n, drzave[0], t, drzave[1]);
n++; n++;
} }

1185
viri/glasovi_sample_cl.csv Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,101 @@
leto;drzava;tekmovalec;pesem
1999;Svedska;Charlotte Nilsson;Take Me To Your Heaven
1999;Islandija;Selma Bjornsdottir;All Out Of Luck
1999;Nemcija;Surpriz;Reise Nach Jerusalem - Kudus'e Seyahat
1999;Hrvaska;Doris Dragovic;Marija Magdalena
1999;Izrael;Eden;Yom Huledeth
1999;Estonija;Evelin Samuel and Camille;Diamond Of Night
1999;Bosna in Hercegovina;Dino and Beatrice;Putnici
1999;Danska;Trine Jepsen & Michael Teschl;This Time (i Mean It)
1999;Nizozemska;Marlayne;One Good Reason
1999;Avstrija;Bobbie Singer;Reflection
1999;Slovenija;Darja Svajger;For A Thousand Years
1999;Belgija;Venessa Chinitor;Like The Wind
1999;Velika Britanija;Precious;Say It Again
1999;Norveska;Stig Andre Van Eijk;Living My Life Without You
1999;Malta;Times 3;Believe 'n Peace
1999;Turcija;Tuba Onal & Grup Mystik;Don Artik
1999;Irska;The Mullan's;When You Need Me
1999;Poljska;Mietek Szczesniak;Przytul Mnie Mocno
1999;Francija;Nayah;Je Veux Donner Ma Voix
1999;Litva;Aiste Smilgeviciute;Strazdas
1999;Portugalska;Rui Bandeira;Como Tudo Comecou
1999;Ciper;Marlain Angelidou;Tha'nai Erotas
1999;Spanija;Lydia;No Quiero Escuchar
2015;Svedska;Mans Zelmerlow;Heroes
2015;Rusija;Polina Gagarina;A Million Voices
2015;Italija;Il Volo;Grande Amore
2015;Belgija;Loic Nottet;Rhythm Inside
2015;Avstralija;Guy Sebastian;Tonight Again
2015;Latvija;Aminata Savadogo;Love Injected
2015;Estonija;Elina Born & Stig Rasta;Goodbye to Yesterday
2015;Norveska;Mørland & Debrah Scarlett;A Monster Like Me
2015;Izrael;Nadav Guedj;Golden Boy
2015;Srbija;Bojana Stamenov;Beauty Never Lies
2015;Gruzija;Nina Sublatti;Warrior
2015;Azerbajdzan;Elnur Huseynov;Hour Of The Wolf
2015;Crna gora;Knez;Adio
2015;Slovenija;Maraaya;Here for You
2015;Romunija;Voltaj;De La Capat / All Over Again
2015;Armenija;Genealogy;Face The Shadow
2015;Albanija;Elhaida Dani;I'm Alive
2015;Litva;Monika & Vaidas;This Time
2015;Grcija;Maria Elena Kyriakou;One Last Breath
2015;Madzarska;Boggie;Wars For Nothing
2015;Spanija;Edurne;Amanecer
2015;Ciper;John Karayiannis;One Thing I Should Have Done
2015;Poljska;Monika Kuszynska;In The Name Of Love
2015;Velika Britanija;Electro Velvet;Still in Love with You
2015;Francija;Lisa Angell;Noubliez pas
2015;Avstrija;The Makemakes;I Am Yours
2015;Nemcija;Ann Sophie;Black Smoke
2015;Moldavija;Eduard Romanyuta;I Want Your Love
2015;Malta;Amber;Warrior
2015;Belorusija;Uzari & Maimuna;Time
2015;Irska;Molly Sterling;Playing With Numbers
2015;Danska;Anti Social Media;The Way You Are
2015;Nizozemska;Trijntje Oosterhuis;Walk Along
2015;Ceska;Marta Jandova & Vaclav Noid Barta;Hope Never Dies
2015;Severna Makedonija;Daniel Kajmakoski;Autumn Leaves
2015;Portugalska;Leonor Andrade;Ha um mar que nos Separa
2015;Islandija;Maria Olafsdottir;Unbroken
2015;Finska;Pertti Kurikan Nimipaivat;Aina Mun Pitaa
2015;San Marino;Michele Perniola & Anita Simoncini;Chain Of Lights
2015;Svica;Melanie Rene;Time To Shine
2023;Svedska;Loreen;Tattoo
2023;Finska;Kaarija;Cha Cha Cha
2023;Izrael;Noa Kirel;Unicorn
2023;Italija;Marco Mengoni;Due vite
2023;Norveska;Alessandra;Queen of Kings
2023;Ukrajina;Tvorchi;Heart of Steel
2023;Belgija;Gustaph;Because of You
2023;Estonija;Alika;Bridges
2023;Avstralija;Voyager;Promise
2023;Ceska;Vesna;My Sister's Crown
2023;Litva;Monika Linkyte;Stay
2023;Ciper;Andrew Lambrou;Break a Broken Heart
2023;Hrvaska;Let 3;Mama SC!
2023;Armenija;Brunette;Future Lover
2023;Avstrija;Teya & Salena;Who The Hell Is Edgar?
2023;Francija;La Zarra;Evidemment
2023;Spanija;Blanca Paloma;Eaea
2023;Moldavija;Pasha Parfeni;Soarele si Luna
2023;Poljska;Blanka;Solo
2023;Svica;Remo Forrer;Watergun
2023;Slovenija;Joker Out;Carpe Diem
2023;Albanija;Albina & Familja Kelmendi;Duje
2023;Portugalska;Mimicat;Ai Coracao
2023;Srbija;Luke Black;Samo mi se spava
2023;Velika Britanija;Mae Muller;I Wrote A Song
2023;Nemcija;Lord Of The Lost;Blood & Glitter
2023;Islandija;Dilja;Power
2023;Latvija;Sudden Lights;Aija
2023;Gruzija;Iru;Echo
2023;Grcija;Victor Vernicos;What They Say
2023;Irska;Wild Youth;We Are One
2023;Nizozemska;Mia Nicolai & Dion Cooper;Burning Daylight
2023;Danska;Reiley;Breaking My Heart
2023;Azerbajdzan;TuralTuranX;Tell Me More
2023;Malta;The Busker;Dance (Our Own Party)
2023;Romunija;Theodor Andrei;D.G.T. (Off and On)
2023;San Marino;Piqued Jacks;Like An Animal
1 leto drzava tekmovalec pesem
2 1999 Svedska Charlotte Nilsson Take Me To Your Heaven
3 1999 Islandija Selma Bjornsdottir All Out Of Luck
4 1999 Nemcija Surpriz Reise Nach Jerusalem - Kudus'e Seyahat
5 1999 Hrvaska Doris Dragovic Marija Magdalena
6 1999 Izrael Eden Yom Huledeth
7 1999 Estonija Evelin Samuel and Camille Diamond Of Night
8 1999 Bosna in Hercegovina Dino and Beatrice Putnici
9 1999 Danska Trine Jepsen & Michael Teschl This Time (i Mean It)
10 1999 Nizozemska Marlayne One Good Reason
11 1999 Avstrija Bobbie Singer Reflection
12 1999 Slovenija Darja Svajger For A Thousand Years
13 1999 Belgija Venessa Chinitor Like The Wind
14 1999 Velika Britanija Precious Say It Again
15 1999 Norveska Stig Andre Van Eijk Living My Life Without You
16 1999 Malta Times 3 Believe 'n Peace
17 1999 Turcija Tuba Onal & Grup Mystik Don Artik
18 1999 Irska The Mullan's When You Need Me
19 1999 Poljska Mietek Szczesniak Przytul Mnie Mocno
20 1999 Francija Nayah Je Veux Donner Ma Voix
21 1999 Litva Aiste Smilgeviciute Strazdas
22 1999 Portugalska Rui Bandeira Como Tudo Comecou
23 1999 Ciper Marlain Angelidou Tha'nai Erotas
24 1999 Spanija Lydia No Quiero Escuchar
25 2015 Svedska Mans Zelmerlow Heroes
26 2015 Rusija Polina Gagarina A Million Voices
27 2015 Italija Il Volo Grande Amore
28 2015 Belgija Loic Nottet Rhythm Inside
29 2015 Avstralija Guy Sebastian Tonight Again
30 2015 Latvija Aminata Savadogo Love Injected
31 2015 Estonija Elina Born & Stig Rasta Goodbye to Yesterday
32 2015 Norveska Mørland & Debrah Scarlett A Monster Like Me
33 2015 Izrael Nadav Guedj Golden Boy
34 2015 Srbija Bojana Stamenov Beauty Never Lies
35 2015 Gruzija Nina Sublatti Warrior
36 2015 Azerbajdzan Elnur Huseynov Hour Of The Wolf
37 2015 Crna gora Knez Adio
38 2015 Slovenija Maraaya Here for You
39 2015 Romunija Voltaj De La Capat / All Over Again
40 2015 Armenija Genealogy Face The Shadow
41 2015 Albanija Elhaida Dani I'm Alive
42 2015 Litva Monika & Vaidas This Time
43 2015 Grcija Maria Elena Kyriakou One Last Breath
44 2015 Madzarska Boggie Wars For Nothing
45 2015 Spanija Edurne Amanecer
46 2015 Ciper John Karayiannis One Thing I Should Have Done
47 2015 Poljska Monika Kuszynska In The Name Of Love
48 2015 Velika Britanija Electro Velvet Still in Love with You
49 2015 Francija Lisa Angell N’oubliez pas
50 2015 Avstrija The Makemakes I Am Yours
51 2015 Nemcija Ann Sophie Black Smoke
52 2015 Moldavija Eduard Romanyuta I Want Your Love
53 2015 Malta Amber Warrior
54 2015 Belorusija Uzari & Maimuna Time
55 2015 Irska Molly Sterling Playing With Numbers
56 2015 Danska Anti Social Media The Way You Are
57 2015 Nizozemska Trijntje Oosterhuis Walk Along
58 2015 Ceska Marta Jandova & Vaclav Noid Barta Hope Never Dies
59 2015 Severna Makedonija Daniel Kajmakoski Autumn Leaves
60 2015 Portugalska Leonor Andrade Ha um mar que nos Separa
61 2015 Islandija Maria Olafsdottir Unbroken
62 2015 Finska Pertti Kurikan Nimipaivat Aina Mun Pitaa
63 2015 San Marino Michele Perniola & Anita Simoncini Chain Of Lights
64 2015 Svica Melanie Rene Time To Shine
65 2023 Svedska Loreen Tattoo
66 2023 Finska Kaarija Cha Cha Cha
67 2023 Izrael Noa Kirel Unicorn
68 2023 Italija Marco Mengoni Due vite
69 2023 Norveska Alessandra Queen of Kings
70 2023 Ukrajina Tvorchi Heart of Steel
71 2023 Belgija Gustaph Because of You
72 2023 Estonija Alika Bridges
73 2023 Avstralija Voyager Promise
74 2023 Ceska Vesna My Sister's Crown
75 2023 Litva Monika Linkyte Stay
76 2023 Ciper Andrew Lambrou Break a Broken Heart
77 2023 Hrvaska Let 3 Mama SC!
78 2023 Armenija Brunette Future Lover
79 2023 Avstrija Teya & Salena Who The Hell Is Edgar?
80 2023 Francija La Zarra Evidemment
81 2023 Spanija Blanca Paloma Eaea
82 2023 Moldavija Pasha Parfeni Soarele si Luna
83 2023 Poljska Blanka Solo
84 2023 Svica Remo Forrer Watergun
85 2023 Slovenija Joker Out Carpe Diem
86 2023 Albanija Albina & Familja Kelmendi Duje
87 2023 Portugalska Mimicat Ai Coracao
88 2023 Srbija Luke Black Samo mi se spava
89 2023 Velika Britanija Mae Muller I Wrote A Song
90 2023 Nemcija Lord Of The Lost Blood & Glitter
91 2023 Islandija Dilja Power
92 2023 Latvija Sudden Lights Aija
93 2023 Gruzija Iru Echo
94 2023 Grcija Victor Vernicos What They Say
95 2023 Irska Wild Youth We Are One
96 2023 Nizozemska Mia Nicolai & Dion Cooper Burning Daylight
97 2023 Danska Reiley Breaking My Heart
98 2023 Azerbajdzan TuralTuranX Tell Me More
99 2023 Malta The Busker Dance (Our Own Party)
100 2023 Romunija Theodor Andrei D.G.T. (Off and On)
101 2023 San Marino Piqued Jacks Like An Animal