#3975
Intervale_AB
Dându-se N
intervale [a, b]
, calculați numărul maxim de astfel de intervale care se intersectează în cel puțin un punct.
ad-hoc
Problema | Intervale_AB | Operații I/O |
intervale.in /intervale.out
|
---|---|---|---|
Limita timp | 0.4 secunde | Limita memorie |
Total: 16 MB
/
Stivă 8 MB
|
Id soluție | #48948798 | Utilizator | |
Fișier | intervale_ab.cpp | Dimensiune | 778 B |
Data încărcării | 10 Februarie 2024, 13:41 | Scor / rezultat | Eroare de compilare |
intervale_ab.cpp:8:28: error: 'intervale' does not name a type bool operator < (const intervale &y) const { ^ intervale_ab.cpp:8:39: error: ISO C++ forbids declaration of 'y' with no type [-fpermissive] bool operator < (const intervale &y) const { ^ intervale_ab.cpp:10:2: error: 'v' does not name a type }v[200005]; ^ intervale_ab.cpp:41:1: error: expected '}' at end of input } ^ intervale_ab.cpp: In member function 'bool interval::operator<(const int&) const': intervale_ab.cpp:9:22: error: request for member 'a' in 'y', which is of non-class type 'const int' return a < y.a; ^ intervale_ab.cpp: In member function 'bool interval::comp(interval, interval)': intervale_ab.cpp:13:5: error: named return values are no longer supported return x.a<y.a; ^ intervale_ab.cpp:13:18: error: expected '{' at end of input return x.a<y.a; ^ intervale_ab.cpp:13:18: warning: no return statement in function returning non-void [-Wreturn-type] intervale_ab.cpp: In member function 'int interval::main()': intervale_ab.cpp:19:7: error: 'v' was not declared in this scope v[2*i-1].a=x; ^ intervale_ab.cpp:24:10: error: 'v' was not declared in this scope sort(v+1,v+2*n+1,comp); ^ intervale_ab.cpp:25:10: error: expected initializer before '==' token int i==1; ^ intervale_ab.cpp:26:11: error: 'i' was not declared in this scope while(i<=2*n) ^ intervale_ab.cpp:41:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ intervale_ab.cpp: At global scope: intervale_ab.cpp:41:1: error: expected unqualified-id at end of input
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Intervale_AB 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ă.