#749
Cerc2
N
puncte numerotate de la 1
la N
sunt aşezate pe cerc, în sensul acelor de ceasornic, în ordine strict crescătoare.
Există M
segmente de dreaptă diferite care unesc M
perechi de puncte dintre cele N
date. Cele două puncte care formează orice pereche sunt distincte.
Distanţele dintre două puncte succesive sunt alese astfel încât să nu existe 3
sau mai multe segmente care trec printr-un acelaşi punct interior cercului.
Cunoscându-se numărul de puncte, numărul de perechi şi perechile de puncte care vor fi unite, se cere să se determine numărul P
de puncte de intersecţie formate de acestea în interiorul cercului (punctele de intersecţie aflate chiar pe cerc nefiind luate în considerare).
Lot Juniori, Cluj Napoca, 2009
Problema | Cerc2 | Operații I/O |
cerc2.in /cerc2.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 8 MB
/
Stivă 8 MB
|
Id soluție | #51475831 | Utilizator | |
Fișier | cerc2.cpp | Dimensiune | 1.60 KB |
Data încărcării | 24 Iunie 2024, 09:33 | Scor / rezultat | Eroare de compilare |
cerc2.cpp:5:10: warning: character constant too long for its type [enabled by default] fi='cerc2.in';fo='cerc2.out'; ^ cerc2.cpp:5:24: warning: character constant too long for its type [enabled by default] fi='cerc2.in';fo='cerc2.out'; ^ cerc2.cpp:13:15: error: too many decimal points in number p,l:array[0..nmax]of longint; ^ cerc2.cpp:15:15: error: too many decimal points in number ind:array[1..mmax]of longint; ^ cerc2.cpp:17:15: error: too many decimal points in number per:array[1..mmax]of segm; ^ cerc2.cpp:1:19: error: 'program' does not name a type program cerc; ^ cerc2.cpp:3:7: error: 'nmax' does not name a type const nmax=500;mmax=nmax*(nmax-3)div 2; ^ cerc2.cpp:3:16: error: 'mmax' does not name a type const nmax=500;mmax=nmax*(nmax-3)div 2; ^ cerc2.cpp:5:7: error: 'fi' does not name a type fi='cerc2.in';fo='cerc2.out'; ^ cerc2.cpp:5:21: error: 'fo' does not name a type fi='cerc2.in';fo='cerc2.out'; ^ cerc2.cpp:7:1: error: 'type' does not name a type type segm=record p1,p2,lung:integer ^ cerc2.cpp:11:1: error: 'var' does not name a type var n,j:integer;m,i:longint; ^ cerc2.cpp:11:17: error: 'm' does not name a type var n,j:integer;m,i:longint; ^ cerc2.cpp:13:5: error: 'p' does not name a type p,l:array[0..nmax]of longint; ^ cerc2.cpp:15:8: error: found ':' in nested-name-specifier, expected '::' ind:array[1..mmax]of longint; ^ cerc2.cpp:15:5: error: 'ind' does not name a type ind:array[1..mmax]of longint; ^ cerc2.cpp:17:8: error: found ':' in nested-name-specifier, expected '::' per:array[1..mmax]of segm; ^ cerc2.cpp:17:5: error: 'per' does not name a type per:array[1..mmax]of segm; ^ cerc2.cpp:19:6: error: found ':' in nested-name-specifier, expected '::' s:segm;inters:longint; ^ cerc2.cpp:19:5: error: 's' does not name a type s:segm;inters:longint; ^ cerc2.cpp:19:18: error: found ':' in nested-name-specifier, expected '::' s:segm;inters:longint; ^ cerc2.cpp:19:12: error: 'inters' does not name a type s:segm;inters:longint; ^ cerc2.cpp:21:6: error: found ':' in nested-name-specifier, expected '::' f:text; ^ cerc2.cpp:21:5: error: 'f' does not name a type f:text; ^ cerc2.cpp:23:1: error: 'procedure' does not name a type procedure calc(var s:segm); ^ cerc2.cpp:25:1: error: 'var' does not name a type var aux:integer; ^ cerc2.cpp:27:1: error: 'begin' does not name a type begin ^ cerc2.cpp:35:6: error: 'aux' does not name a type aux:=s.p1;s.p1:=s.p2;s.p2:=aux ^ cerc2.cpp:35:16: error: 's' does not name a type aux:=s.p1;s.p1:=s.p2;s.p2:=aux ^ cerc2.cpp:35:27: error: 's' does not name a type aux:=s.p1;s.p1:=s.p2;s.p2:=aux ^ cerc2.cpp:41:1: error: 'procedure' does not name a type procedure citire; ^ cerc2.cpp:43:1: error: 'var' does not name a type var i:longint; ^ cerc2.cpp:45:1: error: 'begin' does not name a type begin ^ cerc2.cpp:47:24: error: expected constructor, destructor, or type conversion before '(' token assign(f,fi);reset(f); ^ cerc2.cpp:49:12: error: expected constructor, destructor, or type conversion before '(' token readln(f,n,m); ^ cerc2.cpp:51:6: error: 'i' does not name a type i:=0; ^ cerc2.cpp:53:6: error: expected unqualified-id before 'while' while not seekeof(f) do begin ^ cerc2.cpp:57:14: error: expected constructor, destructor, or type conversion before '(' token calc(s); ^ cerc2.cpp:59:10: error: expected unqualified-id before 'if' if s.lung=0 then continue; ^ cerc2.cpp:61:13: error: expected constructor, destructor, or type conversion before '(' token inc(p[s.p1]);inc(p[s.p2]); ^ cerc2.cpp:61:26: error: expected constructor, destructor, or type conversion before '(' token inc(p[s.p1]);inc(p[s.p2]); ^ cerc2.cpp:63:13: error: expected constructor, destructor, or type conversion before '(' token inc(l[s.lung]); ^ cerc2.cpp:65:10: error: 'i' does not name a type i:=i+1;per[i]:=s ^ cerc2.cpp:65:17: error: 'per' does not name a type i:=i+1;per[i]:=s ^ cerc2.cpp:69:6: error: 'm' does not name a type m:=i; ^ cerc2.cpp:71:11: error: expected constructor, destructor, or type conversion before '(' token close(f); ^ cerc2.cpp:73:1: error: 'end' does not name a type end; ^ cerc2.cpp:75:1: error: 'procedure' does not name a type procedure sort; ^ cerc2.cpp:77:1: error: 'var' does not name a type var i,j:longint; ^ cerc2.cpp:79:1: error: 'begin' does not name a type begin ^ cerc2.cpp:83:6: error: expected unqualified-id before 'for' for j:=1 to m do begin ^ cerc2.cpp:87:10: error: 'ind' does not name a type ind[l[i]]:=j; ^ cerc2.cpp:89:13: error: expected constructor, destructor, or type conversion before '(' token dec(l[i]) ^ cerc2.cpp:95:1: error: 'begin' does not name a type begin ^ cerc2.cpp:99:6: error: 'sort' does not name a type sort; ^ cerc2.cpp:101:6: error: expected unqualified-id before '{' token {for i:=1 to m do ind[i]:=i;} ^ cerc2.cpp:103:6: error: 'inters' does not name a type inters:=0; ^ cerc2.cpp:105:6: error: expected unqualified-id before 'for' for i:=1 to m do begin ^ cerc2.cpp:109:8: error: 'j' does not name a type j:=s.p1 mod n+1; ^ cerc2.cpp:111:8: error: expected unqualified-id before 'while' while j<>s.p2 do begin ^ cerc2.cpp:115:14: error: 'j' does not name a type j:=j mod n+1 ^ cerc2.cpp:119:11: error: expected constructor, destructor, or type conversion before '(' token dec(p[s.p1]);dec(p[s.p2]) ^ cerc2.cpp:119:24: error: expected constructor, destructor, or type conversion before '(' token dec(p[s.p1]);dec(p[s.p2]) ^ cerc2.cpp:123:12: error: expected constructor, destructor, or type conversion before '(' token assign(f,fo);rewrite(f); ^ cerc2.cpp:123:26: error: expected constructor, destructor, or type conversion before '(' token assign(f,fo);rewrite(f); ^ cerc2.cpp:125:13: error: expected constructor, destructor, or type conversion before '(' token writeln(f,inters); ^ cerc2.cpp:127:11: error: expected constructor, destructor, or type conversion before '(' token close(f) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cerc2 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ă.