Jump to content

Recommended Posts

Posted

Salut, am matricea urmatoare, si cerinta: "Numim stea stralucitoare o stea care are intensitatea luminoasa mai mare decat a tuturor stelelor invecinate direct cu ea, pe orizontala, verticala sau diagonala."

6 8
1 8 5 7 1 6 3 4
1 2 3 1 1 5 2 1
1 7 1 9 1 1 8 1
6 3 5 1 6 4 3 1
1 9 5 7 1 8 2 1
1 5 6 5 3 1 3 6

O idee cum as putea incepe? Daca nu ati inteles http://varena.ro/problema/patrat, scuzati exprimarea :))

Posted

parcurgi matricea (ai 2 for-uri pentru asta..).

 

Dupaia pentru fiecare element verifici valoarea vecinilor. De exemplu pentru punctul a[j], vecinu din dreapta e a[i-1][j], vecinu din dreapta sus e a[i-1][j-1], vecinu de jps e a[j+1] si tot asa.

  • Upvote 1

love is a verb
Love is a doing word

  • gaby changed the title to Nelamurire matrice stea stralucitoare

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.