#1237
Numereiajb
Numerele iajb
sunt numerele care pot fi scrise sub forma i * a + j * b
. Cunoscând a
și b
și un număr n
, să se determine valorile i
și j
pentru care se vor forma primele n
numere iajb
in ordine crescătoare.
Problema | Numereiajb | Operații I/O |
numereiajb.in /numereiajb.out
|
---|---|---|---|
Limita timp | 1.6 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53075522 | Utilizator | |
Fișier | numereiajb.cpp | Dimensiune | 755 B |
Data încărcării | 17 Octombrie 2024, 00:46 | Scor / rezultat | Eroare de compilare |
numereiajb.cpp: In function 'int main()': numereiajb.cpp:11:61: error: wrong number of template arguments (0, should be 1) priority_queue<vector<int>, vector<vector<int>>, greater<>> P; ^ In file included from /usr/include/c++/4.8/string:48:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from numereiajb.cpp:1: /usr/include/c++/4.8/bits/stl_function.h:222:12: error: provided for 'template<class _Tp> struct std::greater' struct greater : public binary_function<_Tp, _Tp, bool> ^ numereiajb.cpp:11:62: error: template argument 3 is invalid priority_queue<vector<int>, vector<vector<int>>, greater<>> P; ^ numereiajb.cpp:11:66: error: invalid type in declaration before ';' token priority_queue<vector<int>, vector<vector<int>>, greater<>> P; ^ numereiajb.cpp:12:7: error: request for member 'push' in 'P', which is of non-class type 'int' P.push({a, 1, 0}); ^ numereiajb.cpp:13:7: error: request for member 'push' in 'P', which is of non-class type 'int' P.push({b, 0, 1}); ^ numereiajb.cpp:17:20: error: request for member 'top' in 'P', which is of non-class type 'int' auto v = P.top(); ^ numereiajb.cpp:21:11: error: request for member 'pop' in 'P', which is of non-class type 'int' P.pop(); ^ numereiajb.cpp:26:11: error: request for member 'push' in 'P', which is of non-class type 'int' P.push({val+a, x+1, y}); ^ numereiajb.cpp:27:11: error: request for member 'push' in 'P', which is of non-class type 'int' P.push({val+b, x, y+1}); ^ numereiajb.cpp:7:41: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("numereiajb.in", "r", stdin); ^ numereiajb.cpp:8:43: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("numereiajb.out", "w", stdout); ^ numereiajb.cpp:9:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d%d", &a, &b, &n); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Numereiajb 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ă.