#2892
camioane1
Cătălin lucrează la o firmă de transport de marfă. El se ocupă de planificarea traseelor pe care circulă camioanele. Există N
trasee pe care pot merge camioanele, pe fiecare traseu poate circula cel mult un camion, iar acest camion nu poate depăși o limită de greutate a
i
. Firma deţine M
camioane, fiecare camion poate circula pe maxim un traseu şi are o greutate b
i
. Ajutați-l pe Cătălin să planifice camioanele pe trasee în așa fel încât să poată circula cât mai multe camioane. Determinați numărul maxim de camioane care pot circula în același timp pe trasee și afișați o modalitate de a distribui camioanele pe trasee pentru a obține acest maxim.
Olimpiada Municipală Iași, clasele XI-XII
Problema | camioane1 | Operații I/O |
camioane.in /camioane.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 10 MB
/
Stivă 1 MB
|
Id soluție | #14290842 | Utilizator | |
Fișier | camioane1.cpp | Dimensiune | 1.16 KB |
Data încărcării | 27 Februarie 2019, 17:00 | Scor / rezultat | Eroare de compilare |
camioane1.cpp:9:13: error: '__int128_t' was not declared in this scope vector<pair<__int128_t,int> >a,b; ^ camioane1.cpp:9:27: error: template argument 1 is invalid vector<pair<__int128_t,int> >a,b; ^ camioane1.cpp:9:29: error: template argument 1 is invalid vector<pair<__int128_t,int> >a,b; ^ camioane1.cpp:9:29: error: template argument 2 is invalid camioane1.cpp:9:31: error: invalid type in declaration before ',' token vector<pair<__int128_t,int> >a,b; ^ camioane1.cpp:13:1: error: '__int128_t' does not name a type __int128_t stringify(string &s) ^ camioane1.cpp: In function 'int main()': camioane1.cpp:31:11: error: request for member 'push_back' in 'a', which is of non-class type 'int' a.push_back(pair<__int128_t,int>(0,i)); ^ camioane1.cpp:31:26: error: '__int128_t' was not declared in this scope a.push_back(pair<__int128_t,int>(0,i)); ^ camioane1.cpp:31:40: error: template argument 1 is invalid a.push_back(pair<__int128_t,int>(0,i)); ^ camioane1.cpp:33:12: error: invalid types 'int[int]' for array subscript a[i].F=stringify(tmp); ^ camioane1.cpp:33:29: error: 'stringify' was not declared in this scope a[i].F=stringify(tmp); ^ camioane1.cpp:37:11: error: request for member 'push_back' in 'b', which is of non-class type 'int' b.push_back(pair<__int128_t,int>(0,i)); ^ camioane1.cpp:37:26: error: '__int128_t' was not declared in this scope b.push_back(pair<__int128_t,int>(0,i)); ^ camioane1.cpp:37:40: error: template argument 1 is invalid b.push_back(pair<__int128_t,int>(0,i)); ^ camioane1.cpp:39:12: error: invalid types 'int[int]' for array subscript b[i].F=stringify(tmp); ^ camioane1.cpp:39:29: error: 'stringify' was not declared in this scope b[i].F=stringify(tmp); ^ camioane1.cpp:41:12: error: request for member 'begin' in 'a', which is of non-class type 'int' sort(a.begin(),a.end(),greater<pair<__int128_t,int> >()); ^ camioane1.cpp:41:22: error: request for member 'end' in 'a', which is of non-class type 'int' sort(a.begin(),a.end(),greater<pair<__int128_t,int> >()); ^ camioane1.cpp:41:41: error: '__int128_t' was not declared in this scope sort(a.begin(),a.end(),greater<pair<__int128_t,int> >()); ^ camioane1.cpp:41:55: error: template argument 1 is invalid sort(a.begin(),a.end(),greater<pair<__int128_t,int> >()); ^ camioane1.cpp:41:57: error: template argument 1 is invalid sort(a.begin(),a.end(),greater<pair<__int128_t,int> >()); ^ camioane1.cpp:42:12: error: request for member 'begin' in 'b', which is of non-class type 'int' sort(b.begin(),b.end(),greater<pair<__int128_t,int> >()); ^ camioane1.cpp:42:22: error: request for member 'end' in 'b', which is of non-class type 'int' sort(b.begin(),b.end(),greater<pair<__int128_t,int> >()); ^ camioane1.cpp:42:41: error: the value of '__int128_t' is not usable in a constant expression sort(b.begin(),b.end(),greater<pair<__int128_t,int> >()); ^ camioane1.cpp:41:41: note: '__int128_t' was not declared 'constexpr' sort(a.begin(),a.end(),greater<pair<__int128_t,int> >()); ^ camioane1.cpp:42:55: error: type/value mismatch at argument 1 in template parameter list for 'template<class _T1, class _T2> struct std::pair' sort(b.begin(),b.end(),greater<pair<__int128_t,int> >()); ^ camioane1.cpp:42:55: error: expected a type, got '__int128_t' camioane1.cpp:42:57: error: template argument 1 is invalid sort(b.begin(),b.end(),greater<pair<__int128_t,int> >()); ^ camioane1.cpp:47:16: error: invalid types 'int[int]' for array subscript if(a[ia].F>=b[ib].F) ^ camioane1.cpp:47:25: error: invalid types 'int[int]' for array subscript if(a[ia].F>=b[ib].F) ^ camioane1.cpp:49:21: error: invalid types 'int[int]' for array subscript ans[a[ia].S]=b[ib].S+1; ^ camioane1.cpp:49:30: error: invalid types 'int[int]' for array subscript ans[a[ia].S]=b[ib].S+1; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema camioane1 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ă.