#1036
Parc1
Un parc de formă dreptunghiulară este format din zone pietonale şi piste de biciclete. Reprezentând harta parcului într-un sistem cartezian, cu coordonata colţului stânga-jos (0,0)
, pistele de biciclete sunt reprezentate prin dungi orizontale sau verticale colorate cu gri, iar zonele pietonale au culoarea albă, ca în figura din dreapta.
Vizitatorii parcului se pot plimba liber pe zonele pietonale în orice direcţie, însă pistele de biciclete se vor traversa, în linie dreaptă, paralel cu axele. În figura alăturată avem un parc de dimensiuni 10 x 8
, cu piste de biciclete verticale între 2
şi 4
respectiv 5
şi 8
, şi orizontale între 0
şi 1
respectiv între 2
şi 4
. Gigel se află în punctul A(1,1)
şi poate sa ajungă pe drumul cel mai scurt la prietenul lui, în punctul B(8,7)
deplasându-se astfel: porneşte din punctul (1,1)
şi parcurge un traseu format din segmente cu extremităţile în punctele de coordonate (1.5 , 2) (1.5, 4) (2 , 5) (4 , 5) (5 , 7)
şi în final ajunge în punctul de coordonate (8 , 7)
.
Lungimea totală a drumului va fi aproximativ 11.4721359
.
Cunoscând dimensiunile parcului, coordonatele lui Gigel, coordonatele prietenului lui şi poziţiile pistelor de biciclete, să se calculeze lungimea drumului minim şi numărul drumurilor distincte de lungime minimă.
Problema | Parc1 | Operații I/O |
parc1.in /parc1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 32 MB
/
Stivă 8 MB
|
Id soluție | #52309997 | Utilizator | |
Fișier | parc1.cpp | Dimensiune | 4.59 KB |
Data încărcării | 26 Septembrie 2024, 08:53 | Scor / rezultat | Eroare de compilare |
parc1.cpp:37:11: warning: missing terminating " character [enabled by default] scanf("%d %d ^ parc1.cpp:37:5: error: missing terminating " character scanf("%d %d ^ parc1.cpp:38:1: warning: missing terminating " character [enabled by default] ",&xp,&yp); ^ parc1.cpp:38:1: error: missing terminating " character parc1.cpp:39:11: warning: missing terminating " character [enabled by default] scanf("%d %d %d %d ^ parc1.cpp:39:5: error: missing terminating " character scanf("%d %d %d %d ^ parc1.cpp:40:1: warning: missing terminating " character [enabled by default] ",&xg,&yg,&xpr,&ypr); ^ parc1.cpp:40:1: error: missing terminating " character parc1.cpp:54:16: warning: missing terminating " character [enabled by default] { printf("%d ^ parc1.cpp:54:5: error: missing terminating " character { printf("%d ^ parc1.cpp:56:1: warning: missing terminating " character [enabled by default] ",ypr-yg); ^ parc1.cpp:56:1: error: missing terminating " character parc1.cpp:60:16: warning: missing terminating " character [enabled by default] { printf("%d ^ parc1.cpp:60:5: error: missing terminating " character { printf("%d ^ parc1.cpp:62:1: warning: missing terminating " character [enabled by default] ",xpr-xg); ^ parc1.cpp:62:1: error: missing terminating " character parc1.cpp:65:11: warning: missing terminating " character [enabled by default] scanf("%d ^ parc1.cpp:65:5: error: missing terminating " character scanf("%d ^ parc1.cpp:66:1: warning: missing terminating " character [enabled by default] ",&m); ^ parc1.cpp:66:1: error: missing terminating " character parc1.cpp:69:19: warning: missing terminating " character [enabled by default] { scanf("%d %d ^ parc1.cpp:69:9: error: missing terminating " character { scanf("%d %d ^ parc1.cpp:70:1: warning: missing terminating " character [enabled by default] ",&pv[0][i],&pv[1][i]); ^ parc1.cpp:70:1: error: missing terminating " character parc1.cpp:77:19: warning: missing terminating " character [enabled by default] { scanf("%d %d ^ parc1.cpp:77:9: error: missing terminating " character { scanf("%d %d ^ parc1.cpp:78:1: warning: missing terminating " character [enabled by default] ",&pv[0][i],&pv[1][i]); ^ parc1.cpp:78:1: error: missing terminating " character parc1.cpp:82:11: warning: missing terminating " character [enabled by default] scanf("%d ^ parc1.cpp:82:5: error: missing terminating " character scanf("%d ^ parc1.cpp:83:1: warning: missing terminating " character [enabled by default] ",&n); ^ parc1.cpp:83:1: error: missing terminating " character parc1.cpp:86:19: warning: missing terminating " character [enabled by default] { scanf("%d %d ^ parc1.cpp:86:9: error: missing terminating " character { scanf("%d %d ^ parc1.cpp:87:1: warning: missing terminating " character [enabled by default] ",&po[0][i],&po[1][i]); // citesc pistele orizontale (y-urile) si daca e nevoie ^ parc1.cpp:87:1: error: missing terminating " character parc1.cpp:94:19: warning: missing terminating " character [enabled by default] { scanf("%d %d ^ parc1.cpp:94:9: error: missing terminating " character { scanf("%d %d ^ parc1.cpp:95:1: warning: missing terminating " character [enabled by default] ",&po[0][i],&po[1][i]); ^ parc1.cpp:95:1: error: missing terminating " character parc1.cpp:144:12: warning: missing terminating " character [enabled by default] printf("%lf ^ parc1.cpp:144:5: error: missing terminating " character printf("%lf ^ parc1.cpp:145:1: warning: missing terminating " character [enabled by default] ",lung); ^ parc1.cpp:145:1: error: missing terminating " character parc1.cpp:146:12: warning: missing terminating " character [enabled by default] printf("%d ^ parc1.cpp:146:5: error: missing terminating " character printf("%d ^ parc1.cpp:147:1: warning: missing terminating " character [enabled by default] ",p2); ^ parc1.cpp:147:1: error: missing terminating " character parc1.cpp: In function 'int main()': parc1.cpp:41:5: error: expected primary-expression before 'if' if (xpr<xg) // voi prelucra doar un singur caz: cand gigel este in stanga-jos ^ parc1.cpp:68:19: warning: statement has no effect [-Wunused-value] for (i=1;i<=m;++i) ^ parc1.cpp:68:26: error: expected ';' before ')' token for (i=1;i<=m;++i) ^ parc1.cpp:75:5: error: 'else' without a previous 'if' else ^ parc1.cpp:79:13: error: expected primary-expression before 'if' if (pv[0][i]>pv[1][i]) swap(pv[0][i],pv[1][i]); ^ parc1.cpp:84:5: error: expected primary-expression before 'if' if (yinv) ^ parc1.cpp:85:19: warning: statement has no effect [-Wunused-value] for (i=1;i<=n;++i) ^ parc1.cpp:85:26: error: expected ';' before ')' token for (i=1;i<=n;++i) ^ parc1.cpp:92:5: error: 'else' without a previous 'if' else ^ parc1.cpp:96:13: error: expected primary-expression before 'if' if (po[0][i]>po[1][i]) swap(po[0][i],po[1][i]); ^ parc1.cpp:148:5: error: expected primary-expression before 'return' return 0; ^ parc1.cpp:31:35: warning: unused variable 'xp' [-Wunused-variable] { int pv[2][10000],po[2][10000],xp,yp,xg,yg,xpr,ypr,m,n,i,j,p2,sv[10000],so[10000]; ^ parc1.cpp:31:38: warning: unused variable 'yp' [-Wunused-variable] { int pv[2][10000],po[2][10000],xp,yp,xg,yg,xpr,ypr,m,n,i,j,p2,sv[10000],so[10000]; ^ parc1.cpp:32:40: warning: unused variable 'xinv' [-Wunused-variable] int startv, finishv,starto,finisho,xinv=0,yinv=0,d_oriz,d_vert,cx,cy,semnx=1,semny=1; ^ parc1.cpp:32:47: warning: unused variable 'yinv' [-Wunused-variable] int startv, finishv,starto,finisho,xinv=0,yinv=0,d_oriz,d_vert,cx,cy,semnx=1,semny=1; ^ parc1.cpp:32:74: warning: unused variable 'semnx' [-Wunused-variable] int startv, finishv,starto,finisho,xinv=0,yinv=0,d_oriz,d_vert,cx,cy,semnx=1,semny=1; ^ parc1.cpp:32:82: warning: unused variable 'semny' [-Wunused-variable] int startv, finishv,starto,finisho,xinv=0,yinv=0,d_oriz,d_vert,cx,cy,semnx=1,semny=1; ^ parc1.cpp:35:34: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("parc1.in","r",stdin); ^ parc1.cpp:36:36: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("parc1.out","w",stdout); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Parc1 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ă.