#3048
artifact
Arheologii au găsit un artifact care pare să conțină o ecuație matematică, care folosește simbolurile unei scrieri necunoscute încă. O serie de ipoteze au început să apară, așa că ei își propun să rezolve ecuația în vederea descifrării simbolurilor. Ecuația conține N + M
termeni, fiecare termen reprezentând un număr codificat printr-o înșiruire de simboluri, care au fost înlocuite cu literele mari ale alfabetului englez, de la A
la Z
. Se presupune că suma primelor N
numere trebuie să fie egală cu suma ultimelor M
numere. De asemenea, fiecare literă corespunde unei cifre de la 0
la 9
, iar două litere diferite sunt asociate cu două cifre diferite. Se cere să se afle câte soluții distincte admite ecuația găsită.
Problema | artifact | Operații I/O |
artifact.in /artifact.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 128 MB
/
Stivă 8 MB
|
Id soluție | #53520469 | Utilizator | |
Fișier | artifact.cpp | Dimensiune | 4.55 KB |
Data încărcării | 04 Noiembrie 2024, 09:35 | Scor / rezultat | Eroare de compilare |
artifact.cpp: In function 'int main()': artifact.cpp:51:9: error: 'bt' was not declared in this scope bt(1); ^ artifact.cpp: At global scope: artifact.cpp:64:11: error: redefinition of 'std::ifstream f' ifstream f("artifact.in"); ^ artifact.cpp:8:10: error: 'std::ifstream f' previously declared here ifstream f("artifact.in"); ^ artifact.cpp:65:11: error: redefinition of 'std::ofstream g' ofstream g("artifact.out"); ^ artifact.cpp:9:10: error: 'std::ofstream g' previously declared here ofstream g("artifact.out"); ^ artifact.cpp:67:5: error: redefinition of 'int n' int n,m; ^ artifact.cpp:11:5: error: 'int n' previously declared here int n,m; ^ artifact.cpp:67:7: error: redefinition of 'int m' int n,m; ^ artifact.cpp:11:7: error: 'int m' previously declared here int n,m; ^ artifact.cpp:69:8: error: redefinition of 'std::string s' string s; ^ artifact.cpp:13:8: error: 'std::string s' previously declared here string s; ^ artifact.cpp:71:21: error: redefinition of 'std::map<int, std::vector<int> > coef1' map<int,vector<int>>coef1; ^ artifact.cpp:15:21: error: 'std::map<int, std::vector<int> > coef1' previously declared here map<int,vector<int>>coef1; ^ artifact.cpp:72:21: error: redefinition of 'std::map<int, std::vector<int> > coef2' map<int,vector<int>>coef2; ^ artifact.cpp:16:21: error: 'std::map<int, std::vector<int> > coef2' previously declared here map<int,vector<int>>coef2; ^ artifact.cpp:74:4: error: redefinition of 'long long int p' ll p,sol = 0; ^ artifact.cpp:18:4: error: 'long long int p' previously declared here ll p,sol = 0; ^ artifact.cpp:74:6: error: redefinition of 'long long int sol' ll p,sol = 0; ^ artifact.cpp:18:6: error: 'long long int sol' previously defined here ll p,sol = 0; ^ artifact.cpp:76:10: error: redefinition of 'int fr [51]' int fr[51],x[51],ne = 0; ^ artifact.cpp:20:5: error: 'int fr [51]' previously declared here int fr[51],x[51],ne = 0; ^ artifact.cpp:76:16: error: redefinition of 'int x [51]' int fr[51],x[51],ne = 0; ^ artifact.cpp:20:12: error: 'int x [51]' previously declared here int fr[51],x[51],ne = 0; ^ artifact.cpp:76:18: error: redefinition of 'int ne' int fr[51],x[51],ne = 0; ^ artifact.cpp:20:18: error: 'int ne' previously defined here int fr[51],x[51],ne = 0; ^ artifact.cpp: In function 'int main()': artifact.cpp:78:5: error: redefinition of 'int main()' int main(){ ^ artifact.cpp:22:5: error: 'int main()' previously defined here int main(){ ^ artifact.cpp:107:9: error: 'bt' was not declared in this scope bt(1); ^ artifact.cpp: At global scope: artifact.cpp:120:11: error: redefinition of 'std::ifstream f' ifstream f("artifact.in"); ^ artifact.cpp:8:10: error: 'std::ifstream f' previously declared here ifstream f("artifact.in"); ^ artifact.cpp:121:11: error: redefinition of 'std::ofstream g' ofstream g("artifact.out"); ^ artifact.cpp:9:10: error: 'std::ofstream g' previously declared here ofstream g("artifact.out"); ^ artifact.cpp:123:5: error: redefinition of 'int n' int n,m; ^ artifact.cpp:11:5: error: 'int n' previously declared here int n,m; ^ artifact.cpp:123:7: error: redefinition of 'int m' int n,m; ^ artifact.cpp:11:7: error: 'int m' previously declared here int n,m; ^ artifact.cpp:125:8: error: redefinition of 'std::string s' string s; ^ artifact.cpp:13:8: error: 'std::string s' previously declared here string s; ^ artifact.cpp:127:21: error: redefinition of 'std::map<int, std::vector<int> > coef1' map<int,vector<int>>coef1; ^ artifact.cpp:15:21: error: 'std::map<int, std::vector<int> > coef1' previously declared here map<int,vector<int>>coef1; ^ artifact.cpp:128:21: error: redefinition of 'std::map<int, std::vector<int> > coef2' map<int,vector<int>>coef2; ^ artifact.cpp:16:21: error: 'std::map<int, std::vector<int> > coef2' previously declared here map<int,vector<int>>coef2; ^ artifact.cpp:130:4: error: redefinition of 'long long int p' ll p,sol = 0; ^ artifact.cpp:18:4: error: 'long long int p' previously declared here ll p,sol = 0; ^ artifact.cpp:130:6: error: redefinition of 'long long int sol' ll p,sol = 0; ^ artifact.cpp:18:6: error: 'long long int sol' previously defined here ll p,sol = 0; ^ artifact.cpp:132:10: error: redefinition of 'int fr [51]' int fr[51],x[51],ne = 0; ^ artifact.cpp:20:5: error: 'int fr [51]' previously declared here int fr[51],x[51],ne = 0; ^ artifact.cpp:132:16: error: redefinition of 'int x [51]' int fr[51],x[51],ne = 0; ^ artifact.cpp:20:12: error: 'int x [51]' previously declared here int fr[51],x[51],ne = 0; ^ artifact.cpp:132:18: error: redefinition of 'int ne' int fr[51],x[51],ne = 0; ^ artifact.cpp:20:18: error: 'int ne' previously defined here int fr[51],x[51],ne = 0; ^ artifact.cpp: In function 'int main()': artifact.cpp:134:5: error: redefinition of 'int main()' int main(){ ^ artifact.cpp:22:5: error: 'int main()' previously defined here int main(){ ^ artifact.cpp:163:9: error: 'bt' was not declared in this scope bt(1); ^ artifact.cpp: At global scope: artifact.cpp:176:11: error: redefinition of 'std::ifstream f' ifstream f("artifact.in"); ^ artifact.cpp:8:10: error: 'std::ifstream f' previously declared here ifstream f("artifact.in"); ^ artifact.cpp:177:11: error: redefinition of 'std::ofstream g' ofstream g("artifact.out"); ^ artifact.cpp:9:10: error: 'std::ofstream g' previously declared here ofstream g("artifact.out"); ^ artifact.cpp:179:5: error: redefinition of 'int n' int n,m; ^ artifact.cpp:11:5: error: 'int n' previously declared here int n,m; ^ artifact.cpp:179:7: error: redefinition of 'int m' int n,m; ^ artifact.cpp:11:7: error: 'int m' previously declared here int n,m; ^ artifact.cpp:181:8: error: redefinition of 'std::string s' string s; ^ artifact.cpp:13:8: error: 'std::string s' previously declared here string s; ^ artifact.cpp:183:21: error: redefinition of 'std::map<int, std::vector<int> > coef1' map<int,vector<int>>coef1; ^ artifact.cpp:15:21: error: 'std::map<int, std::vector<int> > coef1' previously declared here map<int,vector<int>>coef1; ^ artifact.cpp:184:21: error: redefinition of 'std::map<int, std::vector<int> > coef2' map<int,vector<int>>coef2; ^ artifact.cpp:16:21: error: 'std::map<int, std::vector<int> > coef2' previously declared here map<int,vector<int>>coef2; ^ artifact.cpp:186:4: error: redefinition of 'long long int p' ll p,sol = 0; ^ artifact.cpp:18:4: error: 'long long int p' previously declared here ll p,sol = 0; ^ artifact.cpp:186:6: error: redefinition of 'long long int sol' ll p,sol = 0; ^ artifact.cpp:18:6: error: 'long long int sol' previously defined here ll p,sol = 0; ^ artifact.cpp:188:10: error: redefinition of 'int fr [51]' int fr[51],x[51],ne = 0; ^ artifact.cpp:20:5: error: 'int fr [51]' previously declared here int fr[51],x[51],ne = 0; ^ artifact.cpp:188:16: error: redefinition of 'int x [51]' int fr[51],x[51],ne = 0; ^ artifact.cpp:20:12: error: 'int x [51]' previously declared here int fr[51],x[51],ne = 0; ^ artifact.cpp:188:18: error: redefinition of 'int ne' int fr[51],x[51],ne = 0; ^ artifact.cpp:20:18: error: 'int ne' previously defined here int fr[51],x[51],ne = 0; ^ artifact.cpp: In function 'int main()': artifact.cpp:190:5: error: redefinition of 'int main()' int main(){ ^ artifact.cpp:22:5: error: 'int main()' previously defined here int main(){ ^ artifact.cpp:219:9: error: 'bt' was not declared in this scope bt(1); ^ artifact.cpp: At global scope: artifact.cpp:232:11: error: redefinition of 'std::ifstream f' ifstream f("artifact.in"); ^ artifact.cpp:8:10: error: 'std::ifstream f' previously declared here ifstream f("artifact.in"); ^ artifact.cpp:233:11: error: redefinition of 'std::ofstream g' ofstream g("artifact.out"); ^ artifact.cpp:9:10: error: 'std::ofstream g' previously declared here ofstream g("artifact.out"); ^ artifact.cpp:235:5: error: redefinition of 'int n' int n,m; ^ artifact.cpp:11:5: error: 'int n' previously declared here int n,m; ^ artifact.cpp:235:7: error: redefinition of 'int m' int n,m; ^ artifact.cpp:11:7: error: 'int m' previously declared here int n,m; ^ artifact.cpp:237:8: error: redefinition of 'std::string s' string s; ^ artifact.cpp:13:8: error: 'std::string s' previously declared here string s; ^ artifact.cpp:239:21: error: redefinition of 'std::map<int, std::vector<int> > coef1' map<int,vector<int>>coef1; ^ artifact.cpp:15:21: error: 'std::map<int, std::vector<int> > coef1' previously declared here map<int,vector<int>>coef1; ^ artifact.cpp:240:21: error: redefinition of 'std::map<int, std::vector<int> > coef2' map<int,vector<int>>coef2; ^ artifact.cpp:16:21: error: 'std::map<int, std::vector<int> > coef2' previously declared here map<int,vector<int>>coef2; ^ artifact.cpp:242:4: error: redefinition of 'long long int p' ll p,sol = 0; ^ artifact.cpp:18:4: error: 'long long int p' previously declared here ll p,sol = 0; ^ artifact.cpp:242:6: error: redefinition of 'long long int sol' ll p,sol = 0; ^ artifact.cpp:18:6: error: 'long long int sol' previously defined here ll p,sol = 0; ^ artifact.cpp:244:10: error: redefinition of 'int fr [51]' int fr[51],x[51],ne = 0; ^ artifact.cpp:20:5: error: 'int fr [51]' previously declared here int fr[51],x[51],ne = 0; ^ artifact.cpp:244:16: error: redefinition of 'int x [51]' int fr[51],x[51],ne = 0; ^ artifact.cpp:20:12: error: 'int x [51]' previously declared here int fr[51],x[51],ne = 0; ^ artifact.cpp:244:18: error: redefinition of 'int ne' int fr[51],x[51],ne = 0; ^ artifact.cpp:20:18: error: 'int ne' previously defined here int fr[51],x[51],ne = 0; ^ artifact.cpp: In function 'int main()': artifact.cpp:246:5: error: redefinition of 'int main()' int main(){ ^ artifact.cpp:22:5: error: 'int main()' previously defined here int main(){ ^ artifact.cpp:275:9: error: 'bt' was not declared in this scope bt(1); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema artifact 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ă.