#3359
Se dă un șir de n numere naturale. Determinați o pereche de numere consecutive în șir, cu proprietatea că au exact aceiași factori primi, indiferent de ordine. Dacă sunt mai multe asemenea perechi se va determina aceea cu suma numerelor mai mare. Dacă în continuare sunt mai multe perechi, se va determina prima din șir.
| Problema | Pereche1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64780768 | Utilizator | |
| Fișier | pereche1.cpp | Dimensiune | 884 B |
| Data încărcării | 30 Mai 2026, 12:38 | Scor/rezultat | Eroare de compilare |
pereche1.cpp:5:7: error: ‘a’ was not declared in this scope 5 | int x=a,y=b,d,mx=1,my=1,n,a,b,amax=0,bmax=0,i; | ^ pereche1.cpp: In function ‘int main()’: pereche1.cpp:8:10: error: ‘n’ was not declared in this scope; did you mean ‘yn’? 8 | cin>>n>>a; | ^ | yn pereche1.cpp:8:13: error: ‘a’ was not declared in this scope 8 | cin>>n>>a; | ^ pereche1.cpp:9:9: error: ‘i’ was not declared in this scope 9 | for(i=2;i<=n;i++){ | ^ pereche1.cpp:10:14: error: ‘b’ was not declared in this scope 10 | cin>>b; | ^ pereche1.cpp:12:9: error: ‘d’ was not declared in this scope 12 | d=2; | ^ pereche1.cpp:15:17: error: ‘mx’ was not declared in this scope; did you mean ‘x’? 15 | mx=mx*d; | ^~ | x pereche1.cpp:24:15: error: ‘y’ was not declared in this scope; did you mean ‘yn’? 24 | while(y>1){ | ^ | yn pereche1.cpp:26:17: error: ‘my’ was not declared in this scope 26 | my*=d; | ^~ pereche1.cpp:34:12: error: ‘mx’ was not declared in this scope; did you mean ‘x’? 34 | if(mx==my){ | ^~ | x pereche1.cpp:34:16: error: ‘my’ was not declared in this scope 34 | if(mx==my){ | ^~ pereche1.cpp:35:20: error: ‘amax’ was not declared in this scope; did you mean ‘fmax’? 35 | if(a+b>amax+bmax) | ^~~~ | fmax pereche1.cpp:35:25: error: ‘bmax’ was not declared in this scope; did you mean ‘fmax’? 35 | if(a+b>amax+bmax) | ^~~~ | fmax pereche1.cpp:40:8: error: ‘amax’ was not declared in this scope; did you mean ‘fmax’? 40 | if(amax) | ^~~~ | fmax pereche1.cpp:41:26: error: ‘bmax’ was not declared in this scope; did you mean ‘fmax’? 41 | cout<<amax<<" "<<bmax<<endl; | ^~~~ | fmax
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Pereche1 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ă.