Menu
Texas Holdem Poker 3 Java Game, download to your mobile for free. Welcome to the card club, indeed. Easily download Poker: Free and safe download.With a hand, lower than a Straight, the Flop, Turn and River bets are paid 1:1, whilst the Ante pushes. Challenge your friends Texas Holdem Poker 3 Java Game, download to your mobile for free.
![Dedomil Dedomil](http://i17.servimg.com/u/f17/12/67/40/48/01010020.jpg)
| ||||
Centuries: | ||||
---|---|---|---|---|
Decades: | ||||
See also: | List of years in Indonesia |
- 2Predicted and scheduled events
- 3Events
- 4Deaths
Incumbents[edit]
- President: Joko Widodo
- Vice President: Jusuf Kalla
Predicted and scheduled events[edit]
April[edit]
- April 17 – Indonesia will hold its 12th general election. For the first time, eligible voters will choose their representatives in all levels—governors and president, simultaneously.[1]
Events[edit]
January[edit]
Indonesian Women single in Badminton, Fitriani won the 2019 Thailand Masters (badminton) Super 300
Marcus Fernaldi Gideon won the men's double pair in 2019 Indonesia Masters (badminton) Super 500
Kevin Sanjaya Sukamuljo won the men's double pair in 2019 Indonesia Masters (badminton) Super 500
January 6, 2019. A magnitude 6.6 earthquake struck Molucca Sea.
- January 4 - A magnitude 5.6 earthquake struck Banda Sea, 189 km north-northwest of Saumlaki, Maluku at a depth of 117.7 km.[2] There were no immediate reports of casualties or damage.
- January 5 - Two Indonesian celebrities were arrested for their suspected involvement in online prostitution. The duo were arrested in separate rooms at a Surabaya hotel.[3]
- January 6 - A magnitude 6.6 earthquake struck Molucca Sea, 151 km west-northwest of Tobelo, North Maluku at a depth of 60.0 km.[4] There were no immediate reports of casualties or damage.
- January 9 - Corruption Eradication Commission (KPK) leaders Agus Raharjo and Laode M. Syarif faced terror threats with unknown assailants placing what appeared to be bombs at their houses. It was suspected that a Molotov cocktail exploded at Laode's house.[5]
- January 11 - Hundreds of houses were damaged by tornado in Rancaekek, Bandung, West Java. Two people were seriously injured and around 100 people suffered minor injuries.[6]
- January 13 - Indonesian Women single in Badminton, Fitriani won the 2019 Thailand Masters (badminton) Super 300. The 2019 Thailand Masters, officially Princess Sirivannavari Thailand Masters 2019 was a badminton tournament which took place at Indoor Stadium Huamark in Thailand from 8 to 13 January 2019 and had a total purse of $150,000. The 2019 Thailand Masters was the first tournament of the 2019 BWF World Tour and also part of the Thailand Masters championships which had been held since 2016. This tournament was organized by the Badminton Association of Thailand with sanction from the BWF.[7]
- January 14
- Indonesian Navy divers have found the cockpit voice recorder (CVR) from Lion Air Flight 610 in Java Sea.[8]
- Two Indonesian fighter jets forced an Ethiopian Airlines cargo plane to land over airspace breach. The plane was forced to land at an airport at Batam Island. The cargo plane ETH 3728 was flying from Addis Ababa to Hong Kong.[9]
- January 17
- A plastic-waste mill worker was found dead inside a milling machine at his workplace in Bantargebang, Bekasi.[10]
- First Indonesian Presidential debate between Joko Widodo and Prabowo Subianto. The topics covered were on the hot-button issues of corruption, terrorism, human rights and the law.[11]
- January 18 - Mosaic art surrounding a statue on a major road in Surakarta, Central Java, has drawn ire from conservative Muslim groups, which have said that an aerial view of the art showed that the design resembled a Christian cross.
- January 19 - A boat carrying 24 people sank in Kapuas River, West Kalimantan. At least 13 people were killed and 11 people survived.
- January 21 - A tornado struck Tuban, East Java. One person was killed and 42 houses were damaged.
- January 22
- South Sulawesi floods and Landslides - Floods and landslides in several regions in South Sulawesi killed 78 people and left dozens missing.[12]
- Sumba Island Earthquake - an earthquake magnitude 6.0 struck Sumba Island and a few hours later a second earthquake magnitude 6.4 struck the same place. There were no immediate reports of damage or casualties.
- January 24
- Basuki Tjahaja Purnama was released from jail after two years imprisonment on blasphemy charges.[13]
- Sukoharjo Tornado - Dozens of houses were damaged by a tornado in Sukoharjo, Central Java. Several people were injured.
- January 25 - Russian climber was found injured on the slopes of Mount Agung in Bali, 10 hours after he was declared missing.
- January 26 - Three houses and one hospital were damaged after a magnitude 5.8 earthquake struck Aru Islands, Maluku. One girl was injured.
- January 27
- Batang and Pekalongan Floods - Floods swept through houses in Batang and Pekalongan, Central Java. Thousands of people were evacuated in two districts.
- Bali Landslide - two people were killed and 12 injured from a landslide in Karangasem, Bali.
- Indonesian Men Doubles pair in Badminton, Marcus Fernaldi Gideon and Kevin Sanjaya Sukamuljo won The 2019 Indonesia Masters, officially the DAIHATSU Indonesia Masters 2019, was a badminton tournament that took place at the Istora Gelora Bung Karno in Indonesia from 22 to 27 January 2019 and had a total purse of $350,000. The 2019 Indonesia Masters was the third tournament of the 2019 BWF World Tour and also part of the Indonesian Masters championships which had been held since 2010. This tournament was organized by the Badminton Association of Indonesia with sanction from the BWF.[14]This international tournament was held at the Istora Gelora Bung Karno in Jakarta, Indonesia.
- Bali Landslide - two people were killed and 12 injured from a landslide in Karangasem, Bali.
- January 28
- Ahmad Dhani was sentenced to 18 months in jail for spreading hatred on social media.
- Seven people were killed and 26 injured when a bus crashed on Cipularang highway.
- January 29
- Bali Landslide - Four people were killed when a landslide buried a house in Buleleng, Bali.
- West Halmahera Landslide - dozens of houses were damaged after landslide hit West Halmahera, North Maluku.
- January 31 - the flood hit dozens of houses in Surabaya. One person killed.
February[edit]
- February 1 - Manado Floods and landslides - floods and landslides in several regions in Manado, North Sulawesi killed four people.[15]
- February 2 - A Mw 6.1 earthquake struck Mentawai Islands - West Sumatra. Eleven houses were destroyed, a church and a health center were damaged.[16]
- February 3 - KPK investigators attacked while on duty by unknown assailants in Hotel Borobudur, Central Jakarta.[17]
- February 4 - Aldama Putra Pongkala, a student in an aviation academy in Makassar, was tortured and beaten to death by a senior.[18]
- February 5 - The Samudera Bhakti Temple in Bandung caught on fire during Chinese New Year celebrations. No casualties in the incident.[19]
- February 6 - At least two people died and 12 others were injured after a bus plunged from a cliff in Cicalengka, Bandung.[20]
- February 8 - Two people died and two others hospitalized after eating pufferfish in Probolinggo.[21]
- February 10 - Three people were killed and several houses were damaged after the dam on the Cinambo River, Bandung burst.[22]
- February 14 - Two boys were killed and others injured following an apparent grenade explosion in Cibungbulang village, Bogor.[23]
- February 15
- Princess Mikhaelia Audrey Megonondo of Jambi won the Miss Indonesia 2019 competition, she will represent Indonesia in Miss World 2019 in Thailand this year. The Finale coronation night of Miss Indonesia 2019 was attended by the reigning Miss World 2018, Silvia Vanessa Ponce De León Sánchez of Mexico.[24]
- Four people were killed while four others were injured after a landslide struck Ciomas district in Bogor.[25]
- February 16 - A Lion Air passenger plane with 189 people on board skidded off a runway in Supadio International Airport, Pontianak as the pilot tried to land it during in heavy rain.[26]
- February 17 - Second Indonesian presidential debate between Joko Widodo and Prabowo Subianto, covering infrastructure, energy, agriculture, food, and environment.[27]
- February 26 - At least 29 people were killed in Bolaang Mongondow when an illegal gold mine collapsed.[28]
- February 27 - Indonesia won 2019 AFF U-22 Youth Championship the tournament, after beating Thailand 2–1 in the final.[29]The 2019 AFF U-22 Youth Championship (also known as the 2019 AFF U-22 Youth Championship for sponsorship reasons) was the 2nd edition of the AFF U-22 Youth Championship, organised by ASEAN Football Federation (AFF). The tournament was sponsored by Korean LG Corporation.[30] The tournament was held from 17 to 26 February in Phnom Penh, Cambodia. This was its first as an under-22 tournament, with the previous edition an under-23 tournament. 2005 AFF U-23 Youth Championship winners Thailand were the defending champions, as there was no competition from 2006 to 2018, as the 2011 edition has been cancelled.
March[edit]
Jakarta Mass Rapid Transit officially opened for public by the current president of Indonesia, Joko Widodo.
- March 7 - Nyepi day Hari Raya Nyepi Tahun Baru Saka 1941 a Balinese 'Day of Silence' that is commemorated every Isakawarsa (Saka new year) according to the Balinese calendar (in 2019, it falls on March 7). It is a Hindu celebration mainly celebrated in Bali, Indonesia. Nyepi, a public holiday in Indonesia, is a day of silence, fasting and meditation for the Balinese. The day following Nyepi is also celebrated as New Year's Day.[citation needed] On this day, the youth of Bali in the village of Sesetan in South Bali practice the ceremony of Omed-omedan or 'The Kissing Ritual' to celebrate the new year. The same day celebrated in India as Ugadi. Observed from 6 a.m. until 6 a.m. the next morning, Nyepi is a day reserved for self-reflection, and as such, anything that might interfere with that purpose is restricted. The main restrictions are no lighting fires (and lights must be kept low); no working; no entertainment or pleasure; no traveling; and, for some, no talking or eating at all. The effect of these prohibitions is that Bali's usually bustling streets and roads are empty, there is little or no noise from TVs and radios, and few signs of activity are seen even inside homes. The only people to be seen outdoors are the Pecalang, traditional security men who patrol the streets to ensure the prohibitions are being followed.
- March 8 - The 23rd Puteri Indonesia was held at Jakarta Convention Center, Jakarta. At the end of the pageant, Frederika Alexis Cull of Jakarta SCR 1 was crowned as Puteri Indonesia 2019[31], Jolene Marie Cholock-Rotinsulu of North Sulawesi was crowned as Puteri Indonesia Lingkungan 2019[32] and also Jesica Fitriana Martasari of West Java was crowned as Puteri Indonesia Pariwisata 2019[33]. Each of them will represent Indonesia respectively in the International Major Beauty Pageants; Miss Universe, Miss International and Miss Supranational. The finale coronation night was graced by Miss Universe 2018, Catriona Gray of the Philippines; Miss International 2018, Mariem Velazco of Venezuela; and Miss Supranational 2018, Valeria Vázquez of Puerto Rico.[34]
- March 10 - Indonesian Men Doubles pair in Badminton, Hendra Setiawan and Mohammad Ahsan won their second gold medal trophy of 2019 All England Open SUPER 1000 held in Arena Birmingham, Birmingham, England - United Kingdom. The win repeated Hendra and Ahsan's success at the 2014 All England Super Series Premier. Two of the competition's oldest players - defeated Malaysian rivals Aaron Chia and Soh Wooi Yik on Sunday, March 10. The final rubbers ended with a score of 11-21, 21-14, 21-12 for the Indonesians. They received total prize money US$1,000,000 for winning this year title.[35] Hendra and Ahsan's win continues Indonesia's unbroken run at consecutive All England doubles titles since 2016. In 2016, mixed doubles pair Praveen Jordan and Debby Susanto won, followed by men's doubles pair Kevin Sanjaya Sukamuljo and Marcus Fernaldi Gideon in 2017 and 2018. Mixed doubles pair Tontowi Ahmad and Liliyana Natsir, who just retired early this year, made history by scoring a hattrick of wins in 2012, 2013 and 2014. The tournament was recorded on the BWF points system for the BWF World Tour Super 1000 event.[36]
- March 16 - At least 70 people were killed by a flash flood and a landslide in Jayapura Regency and Jayapura.[37]
- March 17 - Indonesian Men Doubles pair in Badminton, Fajar Alfian and Muhammad Rian Ardianto won the 2019 Swiss Open (badminton) SUPER 300. The 2019 Swiss Open, officially the YONEX Swiss Open 2019, was a badminton tournament which took place at St. Jakobshalle in Basel, Switzerland from 12 to 17 March 2019 and had a total purse of $150,000. The 2019 Swiss Open was the seventh tournament of the 2019 BWF World Tour and also part of the Swiss Open championships which had been held since 1955. This tournament was organized by the Swiss Badminton and sanctioned by the BWF.[38] This international tournament was held at St. Jakobshalle in Basel, Switzerland.
- March 18 - Jakarta Mass Rapid Transit Officially opened for public by the current president of Indonesia, Joko Widodo, The Jakarta Mass Rapid Transit (Jakarta MRT) is a rapid transit system in Jakarta, the capital city of Indonesia. The trainset named as Ratangga which means war chariot in the ancient Javanese language.[39], Jakarta MRT will be the first rapid transit system in Indonesia. Phase 1 of the project (Lebak Bulus to Hotel Indonesia crossing) is expected be opened to the public by March 2019.[40] First trial run from Lebak Bulus Station to the Hotel Indonesia Traffic Circle has been completed successfully in August 2018.[41] The system is operated by municipally owned corporation of Jakarta, PT MRT Jakarta.
Deaths[edit]
January[edit]
- January 4 - Torro Margens, actor and director (b. 1950).
- January 12 - Nukman Luthfie, businessman (b. 1964).
- January 14 - Robby Tumewu, actor and designer (b. 1953).
- January 15 - Gebi Ramadhan, comedian (b. 1994).
- January 25 - Erik Dwi Ermawansyah, footballer (b. 1996).
- January 26 - Eka Tjipta Widjaja, founder of the Sinar Mas Group (b. 1921).
- January 29 - Rahman Tolleng, activist and politician (b. 1937).
- January 30 - Saphira Indah, actress (b. 1986).
- January 31 - Awaluddin Djamin, Chief of Police (1978–1982) (b. 1927).
February[edit]
- February 1 - Parhan Ali, politician, Regent of west Bangka, Bangka Belitung (b. 1947).
- February 15 - Mohamed Purnomo, Olympic sprinter (1984) (b. 1962).
June[edit]
- June 1 - Ani Yudhoyono, First Lady of Indonesia (2004-2014) (b. 1952).[42]
References[edit]
- ^Retaduari, Elza Astari (25 April 2017). '(In Indonesian) Pileg dan Pilpres Serentak Digelar 17 April 2019, Ini Tahapannya'. news.detik.com. Retrieved 11 November 2017.
- ^'M 5.6 - 189km NNW of Saumlaki, Indonesia'. United States Geological Survey. January 4, 2019. Retrieved January 4, 2019.
- ^'Two Indonesian celebrities nabbed for alleged online prostitution'. Channel NewsAsia. 6 January 2019. Retrieved 2 March 2019.
- ^'M 6.6 - 151km WNW of Tobelo, Indonesia'. United States Geological Survey. January 6, 2019. Retrieved January 8, 2019.
- ^'BREAKING: Suspected bombs found at KPK leaders' houses'. The Jakarta Post. 9 January 2019. Retrieved 2 March 2019.
- ^'Tornado hits Bandung, damaging houses'. The Jakarta Post. 11 January 2019. Retrieved 2 March 2019.
- ^'Prospectus Thailand Masters 2019'. Badminton World Federation. Retrieved 7 December 2018.
- ^Hashim, Firdaus (14 January 2019). 'Indonesian navy retrieves CVR from crashed Lion Air Max: reports'. Flightglobal.com. Retrieved 2 March 2019.
- ^'Indonesian jets force Ethiopian cargo plane to land over airspace...'Reuters. 14 January 2019. Retrieved 2 March 2019.
- ^Bhwana, Petir Garda (21 January 2019). 'Fatigue Suspected Behind Worker's Milling Machine Death in Bekasi'. Tempo. Retrieved 2 March 2019.
- ^'Indonesia presidential candidates to face off in first TV debate'. Al Jazeera. 17 January 2019. Retrieved 2 March 2019.
- ^'Death toll from Indonesia floods, landslides jumps to 59'. Al Jazeera. 25 January 2019. Retrieved 25 January 2019.
- ^'Ex-governor freed after blasphemy jail term'. BBC. 24 January 2019. Retrieved 25 January 2019.
- ^'Prospectus Indonesia Masters 2019'(PDF). Badminton World Federation. Retrieved 16 December 2018.
- ^Ikanubun, Yoseph (3 February 2019). 'BPBD Sebut 4 Korban Meninggal Terseret Banjir dan Longsor di Manado'. liputan6.com (in Indonesian). Retrieved 2 March 2019.
- ^'Belasan Rumah Warga Mentawai Rusak Akibat Gempa 6,1 SR'. VIVA (in Indonesian). 4 February 2019. Retrieved 2 March 2019.
- ^'Police still looking into motive behind assault of KPK officials'. The Jakarta Post. 4 February 2019. Retrieved 2 March 2019.
- ^'Aldama Putra Taruna ATKP Makassar Tewas usai Dianiaya Senior, Banyak Luka du=i Tubuhnya'. Tribunnews.com (in Indonesian). 6 February 2019. Retrieved 2 March 2019.
- ^'Kebakaran Vihara Samudra Bhakti Bandung Berhasil Dipadamkan'. Okezone (in Indonesian). 5 February 2019. Retrieved 2 March 2019.
- ^'Two killed in bus accident in West Java'. Antara News. 6 February 2019. Retrieved 2 March 2019.
- ^'Two dead in East Java after eating pufferfish they caught'. The Straits Times. 11 February 2019. Retrieved 2 March 2019.
- ^'Tanggul Sungai Cinambo di Bandung Jebol Menewaskan 3 Orang'. Berita Satu (in Indonesian). 10 February 2019. Retrieved 2 March 2019.
- ^'Second child dies in Bogor grenade explosion'. The Jakarta Post. 15 February 2019. Retrieved 2 March 2019.
- ^'Princess Mikaela Audry Megonondo Dinobatkan Menjadi Miss Indonesia 2019'. Okezone (in Indonesian). 16 February 2019. Retrieved 2 March 2019.
- ^'Landslide kills four people in Bogor'. The Jakarta Post. 16 February 2019. Retrieved 2 March 2019.
- ^'Lion Air plane skids off runway at Indonesian airport'. ABS-CBN News. 17 February 2019. Retrieved 2 March 2019.
- ^Renaldi, Erwin; Shelton, Tracey (18 February 2019). 'Unicorns become an unexpected symbol of Indonesia's second presidential debate'. ABC News. Retrieved 2 March 2019.
- ^'Tim SAR Gabungan Kembali Temukan 4 Jasad Korban Longsor Tambang Emas di Sulut'. KOMPAS.com (in Indonesian). 6 March 2019. Retrieved 17 March 2019.
- ^Yan (26 February 2019). 'Indonesia beat Thailand 2-1 to win AFF U-22 Championship'. Xinhua News Agency. Retrieved 27 February 2019.
- ^'LG sponsors football tourney'. Yonhap News Agency. 18 February 2019. Retrieved 19 February 2019.
- ^'Frederika Alexis Cull - Miss Universe Indonesia 2019'. thegreatpageantcommunity.com.
- ^'Jolene Marie Cholock-Rotinsulu verkozen tot Miss International Indonesia 2019'. missitems.be. 9 February 2019.
- ^'Sosok Jesica Fitriana Martasari, Runner Up 2 Puteri Indonesia 2019'. awardgoesto.
- ^'PUTERI INDONESIA 2019 HADIRKAN 3 RATU KECANTIKAN DUNIA'. www.indonesianpageants.com. 8 February 2019.
- ^'Ini Target Hendra/Ahsan Setelah Juara All England 2019'. sport.detik.com (in Indonesian). 17 March 2019. Retrieved 17 March 2019.
- ^'World Ranking System'(PDF). Badminton World Federation. Retrieved 16 February 2018.
- ^'Polisi: 70 Orang Meninggal Dunia Akibat Banjir Bandang di Sentani'. detiknews (in Indonesian). 17 March 2019. Retrieved 17 March 2019.
- ^'Prospectus Swiss Open 2019'(PDF). Badminton World Federation. Retrieved 8 February 2019.
- ^'Anies aims to make local language 'great again''. The Jakarta Post. Retrieved 22 February 2019.
- ^'Jokowi leads MRT ground-breaking ceremony'. October 10, 2013.
- ^'Jakarta MRT has second successful trial run'. The Jakarta Post. Retrieved 23 August 2018.
- ^'Former Indonesian first lady Ani Yudhoyono dies in Singapore at age 66'. The Straits Times.
Retrieved from 'https://en.wikipedia.org/w/index.php?title=2019_in_Indonesia&oldid=899797882'
PermalinkJoin GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up Find file Copy path
Cannot retrieve contributors at this time
packageam.lsoft.dev; |
importjava.util.*; |
/** |
* Created by Davit on 30/05/16. |
*/ |
publicclassTournament { |
staticbooleanparkingSpot(int[] carDimensions, int[][] parkingLot, |
int[] luckySpot) { |
intL= carDimensions[0], W= carDimensions[1]; |
int x1 = luckySpot[0], y1 = luckySpot[1]; |
int x2 = luckySpot[2], y2 = luckySpot[3]; |
boolean ok; |
if (x2 - x1 +1W) { |
ok =true; |
for (int i = x1; i <= x2; i++) { |
for (int j =0; j <= y2; j++) { |
if (parkingLot[i][j] 1) { |
ok =false; |
} |
} |
} |
if (ok) { |
returntrue; |
} |
ok =true; |
for (int i = x1; i <= x2; i++) { |
for (int j = y1; j < parkingLot[0].length; j++) { |
if (parkingLot[i][j] 1) { |
ok =false; |
} |
} |
} |
if (ok) { |
returntrue; |
} |
} else { |
ok =true; |
for (int i =0; i <= x2; i++) { |
for (int j = y1; j <= y2; j++) { |
if (parkingLot[i][j] 1) { |
ok =false; |
} |
} |
} |
if (ok) { |
returntrue; |
} |
ok =true; |
for (int i = x1; i < parkingLot.length; i++) { |
for (int j = y1; j <= y2; j++) { |
if (parkingLot[i][j] 1) { |
ok =false; |
} |
} |
} |
if (ok) { |
returntrue; |
} |
} |
returnfalse; |
} |
staticintboxPiles(int[] a) { |
Arrays.sort(a); |
boolean[] used =newboolean[a.length]; |
int usedNum =0; |
int answer =0; |
while (usedNum < used.length) { |
int height =0; |
for (int i =0; i < a.length; i++) { |
if (a[i] >= height &&!used[i]) { |
height++; |
used[i] =true; |
usedNum++; |
} |
} |
answer++; |
} |
return answer; |
} |
staticString[] isDivisibleBy6(StringinputString) { |
if (inputString.equals('*')) { |
returnnewString[]{'0', '6'}; |
} |
ArrayList<Integer> nums =newArrayList<>(inputString.length()); |
int sum =0; |
int asteriskPos; |
for (int i =0; i < inputString.length(); i++) { |
if ((inputString.charAt(i) '*')) { |
asteriskPos = i; |
} else { |
nums.add(((int) inputString.charAt(i) -48)); |
sum += ((int) inputString.charAt(i) -48); |
} |
} |
ArrayList<Integer> needed =newArrayList<>(); |
for (int i =0; i <10; i++) { |
if ((sum + i) %30) { |
needed.add(i); |
} |
} |
ArrayList<String> res =newArrayList<>(); |
String tmp =''; |
for (Integer i : needed) { |
tmp = inputString.replace('*', String.valueOf(i)); |
if (Double.parseDouble(tmp) %20) { |
res.add(tmp); |
} |
} |
String[] stockArr =newString[res.size()]; |
stockArr = res.toArray(stockArr); |
return stockArr; |
//return (String[]) res.toArray(); |
} |
staticbooleanisMonotonous(int[] sequence) { |
if (sequence.length 1) { |
returntrue; |
} |
int direction = sequence[1] - sequence[0]; |
for (int i =0; i < sequence.length -1; i++) { |
if (direction * (sequence[i +1] - sequence[i]) <=0) { |
returnfalse; |
} |
} |
returntrue; |
} |
staticintfactorizedGCD(int[] a, int[] b) { |
int j =0, |
result =1; |
for (int i =0; i < a.length; i++) { |
while (j < b.length && a[i] > b[j]) { |
j++; |
} |
if (j < b.length && a[i] b[j]) { |
result *= a[i]; |
j++; |
} |
} |
return result; |
} |
staticint[] videoPart(Stringpart, Stringtotal) { |
classHelper { |
intgetSeconds(Stringtime) { |
int h =Integer.parseInt(time.substring(0, 2)), |
m =Integer.parseInt(time.substring(3, 5)), |
s =Integer.parseInt(time.substring(6, 8)); |
return h *60*60+ m *60+ s; |
} |
intgcd(inta, intb) { |
while (a >0) { |
int tmp = a; |
a = b % a; |
b = tmp; |
} |
return b; |
} |
} |
Helper h =newHelper(); |
int partTime = h.getSeconds(part); |
int totalTime = h.getSeconds(total); |
int divisor = h.gcd(partTime, totalTime); |
returnnewint[]{partTime / divisor, totalTime / divisor}; |
} |
privatestaticint[] convertIntegers(List<Integer>integers) { |
int[] ret =newint[integers.size()]; |
Iterator<Integer> iterator = integers.iterator(); |
for (int i =0; i < ret.length; i++) { |
ret[i] = iterator.next().intValue(); |
} |
return ret; |
} |
staticint[][] blackAndWhiteBoard(inth, intw, String[] queries) { |
int[][] board =newint[h][w]; |
for (int i =0; i < h; i++) { |
for (int j =0; j < w; j++) { |
board[i][j] =0; |
} |
} |
ArrayList<ArrayList<Integer>> res =newArrayList<>(); |
ArrayList<Integer> defValues =newArrayList<>(); |
defValues.add(-1); |
defValues.add(-1); |
String cmd; |
int x, y; |
for (int k =0; k < queries.length; k++) { |
cmd = queries[k].substring(0, 1); |
x =Integer.parseInt(queries[k].substring(2, 3)); |
y =Integer.parseInt(queries[k].substring(4, 5)); |
if (cmd.equals('x')) { |
board[x][y] =1; |
} elseif (cmd.equals('>')) { |
boolean found =false; |
outerloop: |
for (int j = y +1; j < w; j++) { |
if (0 board[x][j]) { |
ArrayList<Integer> tmp =newArrayList<>(); |
tmp.add(x); |
tmp.add(j); |
res.add(tmp); |
found =true; |
break outerloop; |
} |
} |
if (!found) { |
res.add(defValues); |
} |
} elseif (cmd.equals('<')) { |
boolean found =false; |
outerloop: |
for (int j = y -1; j >=0; j--) { |
if (0 board[x][j]) { |
ArrayList<Integer> tmp =newArrayList<>(); |
tmp.add(x); |
tmp.add(j); |
res.add(tmp); |
found =true; |
break outerloop; |
} |
} |
if (!found) { |
res.add(defValues); |
} |
} elseif (cmd.equals('v')) { |
boolean found =false; |
outerloop: |
for (int i = x +1; i < h; i++) { |
if (0 board[i][y]) { |
ArrayList<Integer> tmp =newArrayList<>(); |
tmp.add(i); |
tmp.add(y); |
res.add(tmp); |
found =true; |
break outerloop; |
} |
} |
if (!found) { |
res.add(defValues); |
} |
} elseif (cmd.equals('^')) { |
boolean found =false; |
outerloop: |
for (int i = x -1; i >=0; i--) { |
if (0 board[i][y]) { |
ArrayList<Integer> tmp =newArrayList<>(); |
tmp.add(i); |
tmp.add(y); |
res.add(tmp); |
found =true; |
break outerloop; |
} |
} |
if (!found) { |
res.add(defValues); |
} |
} |
} |
int[][] result =newint[res.size()][]; |
for (int i =0; i < res.size(); i++) { |
result[i] = convertIntegers(res.get(i)); |
} |
return result; |
} |
publicstaticvoidmain(String[] args) { |
// System.out.println(blackAndWhiteBoard(3, 5, new String[]{'v 1 2', 'x 2 2', 'v 1 2', '> 2 1', 'x 2 3', '> 2 1', '< 2 0'})); |
System.out.println(blackAndWhiteBoard(3, 3, newString[]{'> 1 0', |
'v 0 1', |
'< 1 2', |
'^ 2 1', |
'x 1 1', |
'> 1 0', |
'v 0 1', |
'< 1 2', |
'^ 2 1'})); |
// Uber parking |
/*int[] carDimensions = {2, 1}; |
int[][] parkingLot = {{1,0,1}, |
{1,0,1}, |
{1,1,1}}; |
int[] luckySpot = {0, 1, 1, 1}; |
boolean res = parkingSpot(carDimensions, parkingLot, luckySpot); |
System.out.println(res);*/ |
/*int[] boxes = {4, 3, 1, 1, 0, 0}; |
System.out.println(boxPiles(boxes));*/ |
//System.out.println(isMonotonous(new int[]{1, 4, 5, 7, 9})); |
//System.out.println(isMonotonous(new int[]{3, 3})); |
//System.out.println(factorizedGCD(new int[]{2, 3, 3, 3, 5}, new int[]{2, 2, 2, 2, 3, 3})); |
//System.out.println(videoPart('02:20:00', '07:00:00')); |
//System.out.println(videoPart('00:02:20', '00:10:00')); |
} |
} |
Copy lines Copy permalink