#2178
Furnica
Pe o tablă de şah cu n
linii şi n
coloane se află firimituri de pâine şi o furnică. Pentru fiecare pătrăţel, inclusiv cel în care se găseşte furnica, aflat pe linia i
şi coloana j
, cantitatea de firimituri de pâine este egală cu restul împărţirii lui i+j la 6
.
OJI 2007, Clasa a VI-a
Problema | Furnica | Operații I/O |
![]() furnica.in /furnica.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #50565932 | Utilizator | |
Fișier | furnica.cpp | Dimensiune | 1.08 KB |
Data încărcării | 15 Aprilie 2024, 14:34 | Scor / rezultat | Eroare de compilare |
furnica.cpp: In function 'int main()': furnica.cpp:11:5: error: reference to 'cin' is ambiguous cin >> n; ^ furnica.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin ("furnica.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from furnica.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ furnica.cpp:19:5: error: reference to 'cin' is ambiguous cin >> k; ^ furnica.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin ("furnica.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from furnica.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ furnica.cpp:23:9: error: reference to 'cin' is ambiguous cin >> val; ^ furnica.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin ("furnica.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from furnica.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ furnica.cpp:30:5: error: reference to 'cout' is ambiguous cout << s << " "; ^ furnica.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout ("furnica.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from furnica.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ furnica.cpp:42:5: error: reference to 'cout' is ambiguous cout << sol; ^ furnica.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout ("furnica.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from furnica.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 Furnica 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ă.