#1486
Gropi
Gigel a primit de la prietenul său Programatorul o hartă a grădinii acestuia. Grădina are forma dreptunghiulară şi harta pe care a primit-o Gigel conţine informaţii despre starea culturii de pomi fructiferi. Mai precis ea conţine înălţimile fiecărui copac şi zonele în care s-au săpat gropi dar încă nu au fost plantaţi copaci. Harta grădinii poate fi reprezentată sub forma unei table dreptunghiulare cu N
linii, numerotate de la 1
la N
de sus în jos, şi M
coloane, numerotate de la 1
la M
de la stânga la dreapta. În fiecare celulă se află un număr real corespunzător înălţimii copacului sau valoarea 0
corespunzătoare unei gropi.
Cunoscând coordonatele unui punct de pe hartă ajutaţi-l pe Gigel să determine pe care dintre cele 8
direcţii N
, NE
, E
, SE
, S
, SV
, V
, NV
corespunzătoare acestui punct se află cele mai multe gropi.
Olimpiada locală de Informatică, Prahova, 2016
Problema | Gropi | Operații I/O |
gropi.in /gropi.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 4 MB
/
Stivă 1 MB
|
Id soluție | #54252779 | Utilizator | |
Fișier | gropi.cpp | Dimensiune | 1.30 KB |
Data încărcării | 23 Noiembrie 2024, 15:25 | Scor / rezultat | Eroare de compilare |
gropi.cpp: In function 'int main()': gropi.cpp:16:5: error: reference to 'cin' is ambiguous cin >> n >> m >> x >> y; ^ gropi.cpp:3:10: note: candidates are: std::ifstream cin ifstream cin("gropi.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from gropi.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ gropi.cpp:19:13: error: reference to 'cin' is ambiguous cin >> a[i][j]; ^ gropi.cpp:3:10: note: candidates are: std::ifstream cin ifstream cin("gropi.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from gropi.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ gropi.cpp:35:9: error: reference to 'cout' is ambiguous cout << "N " << cnt[poz]; ^ gropi.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("gropi.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from gropi.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ gropi.cpp:37:9: error: reference to 'cout' is ambiguous cout << "NE " << cnt[poz]; ^ gropi.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("gropi.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from gropi.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ gropi.cpp:39:9: error: reference to 'cout' is ambiguous cout << "E " << cnt[poz]; ^ gropi.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("gropi.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from gropi.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ gropi.cpp:41:9: error: reference to 'cout' is ambiguous cout << "SE " << cnt[poz]; ^ gropi.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("gropi.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from gropi.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ gropi.cpp:43:9: error: reference to 'cout' is ambiguous cout << "S " << cnt[poz]; ^ gropi.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("gropi.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from gropi.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ gropi.cpp:45:9: error: reference to 'cout' is ambiguous cout << "SV " << cnt[poz]; ^ gropi.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("gropi.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from gropi.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ gropi.cpp:47:9: error: reference to 'cout' is ambiguous cout << "V " << cnt[poz]; ^ gropi.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("gropi.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from gropi.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ gropi.cpp:49:9: error: reference to 'cout' is ambiguous cout << "NV " << cnt[poz]; ^ gropi.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("gropi.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from gropi.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Gropi face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.