#3345
divimax
Având note mici la matematică, Gicuţa primeşte spre rezolvare următoarea problemă (uşoară pentru clasa a X-a) pentru a-şi mări nota: “Dându-se un şir X
cu N
numere naturale nenule: X
1
, X
2
,…., X
N
, să se determine cel mai mare divizor prim dintre toti divizorii tuturor numerelor din şirul X
“.
Însă, pentru a obţine nota 10
, el mai are de rezolvat o cerinţă a problemei: să determine cel mai mare număr care se poate forma din concatenarea divizorilor primi maximi ai fiecărui număr din şirul X
.
Olimpiada etapa locala București
Problema | divimax | Operații I/O |
divimax.in /divimax.out
|
---|---|---|---|
Limita timp | 0.01 secunde | Limita memorie |
Total: 8 MB
/
Stivă 8 MB
|
Id soluție | #53154556 | Utilizator | |
Fișier | divimax.cpp | Dimensiune | 972 B |
Data încărcării | 19 Octombrie 2024, 12:21 | Scor / rezultat | Eroare de compilare |
divimax.cpp:6:1: error: expected initializer before 'bool' bool cmp(string a,string b) ^ divimax.cpp: In function 'int main()': divimax.cpp:14:5: error: expected ',' or ';' before 'ofstream' ofstream cout("divimax.out") ^ divimax.cpp:16:10: error: 'cer' was not declared in this scope cin>>cer>>n; ^ divimax.cpp:16:15: error: 'n' was not declared in this scope cin>>cer>>n; ^ divimax.cpp:19:14: error: 'a' was not declared in this scope cin>>a; ^ divimax.cpp:20:22: error: 'd' was not declared in this scope while(a>1 && d*d<=a) ^ divimax.cpp:24:17: error: 'cnt' was not declared in this scope cnt++;a=a/d; ^ divimax.cpp:26:16: error: 'cnt' was not declared in this scope if(cnt>0 && d>maxp) ^ divimax.cpp:26:27: error: 'maxp' was not declared in this scope if(cnt>0 && d>maxp) ^ divimax.cpp:28:13: error: 'cnt' was not declared in this scope cnt=0; ^ divimax.cpp:31:21: error: 'maxp' was not declared in this scope if(a>1 && a>maxp) ^ divimax.cpp:33:9: error: 'v' was not declared in this scope v[i]=maxp; ^ divimax.cpp:33:14: error: 'maxp' was not declared in this scope v[i]=maxp; ^ divimax.cpp:34:17: error: 'maxt' was not declared in this scope if(maxp>maxt) maxt=maxp; ^ divimax.cpp:37:13: error: 's' was not declared in this scope s=char(a%10+'0')+s; ^ divimax.cpp:40:14: error: 's' was not declared in this scope v[i]=s; ^ divimax.cpp:41:9: error: 'd' was not declared in this scope d=2; maxp=0; cnt=0; ^ divimax.cpp:41:22: error: 'cnt' was not declared in this scope d=2; maxp=0; cnt=0; ^ divimax.cpp:43:15: error: 'cout' was not declared in this scope if(cer==1)cout<<maxt; ^ divimax.cpp:43:21: error: 'maxt' was not declared in this scope if(cer==1)cout<<maxt; ^ divimax.cpp:46:14: error: 'v' was not declared in this scope sort(v,v+n,cmp) ^ divimax.cpp:46:20: error: 'cmp' was not declared in this scope sort(v,v+n,cmp) ^ divimax.cpp:47:9: error: expected ';' before 'for' for(int i=0;i<n;i++) ^ divimax.cpp:47:21: error: 'i' was not declared in this scope for(int i=0;i<n;i++) ^ divimax.cpp:47:28: error: expected ';' before ')' token for(int i=0;i<n;i++) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema divimax 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ă.