![eichlingkera3](/avatars/16673.jpg)
eichlingkera3
13.02.2021 •
Computers and Technology
Egy téglalap alakú rácsháló minden pontjáról ismerjük, hogy ott tenger van-e (0 érték) vagy valamely sziget (1 és K közötti érték, ahol K sziget van). Két pont távolsága az indexeik különbségének
abszolút értékének összege (Manhattan távolság, pl. (3,2) és (5,1) távolsága abs(3-5)+abs(2-1)=3).
Írj programot, amely megadja a két legközelebbi szigetet!
Bemenet
A standard bemenet első sorában a rácsháló sorai és oszlopai száma (1≤N,M≤100), valamint a szigetek száma (2≤K≤100) van. A következő N sor mindegyikében M szám szerepel a
rácsháló pontjai (0≤Ri,j≤K).
Kimenet
A standard kimenet első sorába két legközelebbi sziget sorszámát kell írni! Több megoldás
esetén közülük tetszőleges írható.
Példa
Bemenet Kimenet
6 5 3
0 1 1 0 0
0 1 1 0 0
0 0 0 0 2
0 0 0 0 2
0 0 0 3 0
3 3 3 3 0
2 3
Solved
Show answers
More tips
- A Art and Culture The History and Characteristics of Jazz Bands: A Deep Dive...
- W Work and Career Can Skill Alone Make You a Professional?...
- F Family and Home Daughter says: If you don t want to do it, don t do it. Should we persuade her?...
- S Science and Technology How to Secure Exam Sessions: Silence Mobile Phones in the Classroom...
- C Computers and Internet Which Phone is Best for Internet Surfing?...
- P Philosophy Is Everything We Strive for Eventually Achieved and Destroyed?...
- S Society and Politics Understanding Politics and Its Role in the Development of Civilization...
- P Philosophy Why Did God Create Man and Place Him in Obscurity?...
- S Society and Politics Skoptsy: Who They Are and How They Perform Castration?...
- O Other Childhood Fears: What Many of Us Experienced...
Answers on questions: Computers and Technology
- C Computers and Technology Select the statements that are true regarding the future of technology. Select 3 options. Quantum computers are currently being built by Google and IBM, and will...
- C Computers and Technology Retype and run, note incorrect behavior. Then fix errors in the code, which should print num_stars asterisks. while num_printed != num_stars: print( * ) Sample output...
- C Computers and Technology Describe a psychological challenge of space travel that astronauts can face....
- C Computers and Technology Critical Thinking Questions Jared is campaigning to become president of the United States. Along his career path, Jared served as the governor of California and,...
- H History The English Civil War was a brutal conflict that uprooted the strongest country in Europe. 1. Who fought in the war? 2. Who were the leaders of each side? 3. What...
- L Law Because bike lanes give a sense of a narrowed driving area, vehicles ... A. tend to drive faster. B. tend to drive a consistent speed. C. tend to drive slower. Yeah...
- B Biology During the fourth generation, 27% of the dark moths werecaptured from clean forest B. What percentage of moths wererecaptured from polluted forest A during the fourth...
- M Mathematics Write a simplified expression the 3 children in a family each paid $5 to enter a country fair , and then each child plays games at $1.50 per game. what expression...
- M Mathematics 2 ? Previous Question 8 of 10 Next 00:11:23 a Submit Work Click to go to nect question or use Right arrow key Roger ran 2.5 miles the first day of the fundraiser,...
- M Mathematics What’s the rate of change of the table above? A) -1/3 B) 1/2 C) -1/4 D) 1/5...
Ответ:
Ответ:
4) design tab, Page layout group
Explanation: