#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 | #51512642 | Utilizator | |
Fișier | cerc2.cpp | Dimensiune | 1.45 KB |
Data încărcării | 02 Iulie 2024, 13:50 | Scor / rezultat | Eroare de compilare |
cerc2.cpp:3:10: warning: character constant too long for its type [enabled by default] fi='cerc2.in';fo='cerc2.out'; ^ cerc2.cpp:3:24: warning: character constant too long for its type [enabled by default] fi='cerc2.in';fo='cerc2.out'; ^ cerc2.cpp:7:15: error: too many decimal points in number p,l:array[0..nmax]of longint; ^ cerc2.cpp:8:15: error: too many decimal points in number ind:array[1..mmax]of longint; ^ cerc2.cpp:9:15: error: too many decimal points in number per:array[1..mmax]of segm; ^ cerc2.cpp:1:1: error: 'program' does not name a type program cerc; ^ cerc2.cpp:2:7: error: 'nmax' does not name a type const nmax=500;mmax=nmax*(nmax-3)div 2; ^ cerc2.cpp:2:16: error: 'mmax' does not name a type const nmax=500;mmax=nmax*(nmax-3)div 2; ^ cerc2.cpp:3:7: error: 'fi' does not name a type fi='cerc2.in';fo='cerc2.out'; ^ cerc2.cpp:3:21: error: 'fo' does not name a type fi='cerc2.in';fo='cerc2.out'; ^ cerc2.cpp:4:1: error: 'type' does not name a type type segm=record p1,p2,lung:integer ^ cerc2.cpp:6:1: error: 'var' does not name a type var n,j:integer;m,i:longint; ^ cerc2.cpp:6:17: error: 'm' does not name a type var n,j:integer;m,i:longint; ^ cerc2.cpp:7:5: error: 'p' does not name a type p,l:array[0..nmax]of longint; ^ cerc2.cpp:8:8: error: found ':' in nested-name-specifier, expected '::' ind:array[1..mmax]of longint; ^ cerc2.cpp:8:5: error: 'ind' does not name a type ind:array[1..mmax]of longint; ^ cerc2.cpp:9:8: error: found ':' in nested-name-specifier, expected '::' per:array[1..mmax]of segm; ^ cerc2.cpp:9:5: error: 'per' does not name a type per:array[1..mmax]of segm; ^ cerc2.cpp:10:6: error: found ':' in nested-name-specifier, expected '::' s:segm;inters:longint; ^ cerc2.cpp:10:5: error: 's' does not name a type s:segm;inters:longint; ^ cerc2.cpp:10:18: error: found ':' in nested-name-specifier, expected '::' s:segm;inters:longint; ^ cerc2.cpp:10:12: error: 'inters' does not name a type s:segm;inters:longint; ^ cerc2.cpp:11:6: error: found ':' in nested-name-specifier, expected '::' f:text; ^ cerc2.cpp:11:5: error: 'f' does not name a type f:text; ^ cerc2.cpp:12:1: error: 'procedure' does not name a type procedure calc(var s:segm); ^ cerc2.cpp:13:1: error: 'var' does not name a type var aux:integer; ^ cerc2.cpp:14:1: error: 'begin' does not name a type begin ^ cerc2.cpp:18:6: error: 'aux' does not name a type aux:=s.p1;s.p1:=s.p2;s.p2:=aux ^ cerc2.cpp:18:16: error: 's' does not name a type aux:=s.p1;s.p1:=s.p2;s.p2:=aux ^ cerc2.cpp:18:27: error: 's' does not name a type aux:=s.p1;s.p1:=s.p2;s.p2:=aux ^ cerc2.cpp:21:1: error: 'procedure' does not name a type procedure citire; ^ cerc2.cpp:22:1: error: 'var' does not name a type var i:longint; ^ cerc2.cpp:23:1: error: 'begin' does not name a type begin ^ cerc2.cpp:24:24: error: expected constructor, destructor, or type conversion before '(' token assign(f,fi);reset(f); ^ cerc2.cpp:25:12: error: expected constructor, destructor, or type conversion before '(' token readln(f,n,m); ^ cerc2.cpp:26:6: error: 'i' does not name a type i:=0; ^ cerc2.cpp:27:6: error: expected unqualified-id before 'while' while not seekeof(f) do begin ^ cerc2.cpp:29:14: error: expected constructor, destructor, or type conversion before '(' token calc(s); ^ cerc2.cpp:30:10: error: expected unqualified-id before 'if' if s.lung=0 then continue; ^ cerc2.cpp:31:13: error: expected constructor, destructor, or type conversion before '(' token inc(p[s.p1]);inc(p[s.p2]); ^ cerc2.cpp:31:26: error: expected constructor, destructor, or type conversion before '(' token inc(p[s.p1]);inc(p[s.p2]); ^ cerc2.cpp:32:13: error: expected constructor, destructor, or type conversion before '(' token inc(l[s.lung]); ^ cerc2.cpp:33:10: error: 'i' does not name a type i:=i+1;per[i]:=s ^ cerc2.cpp:33:17: error: 'per' does not name a type i:=i+1;per[i]:=s ^ cerc2.cpp:35:6: error: 'm' does not name a type m:=i; ^ cerc2.cpp:36:11: error: expected constructor, destructor, or type conversion before '(' token close(f); ^ cerc2.cpp:37:1: error: 'end' does not name a type end; ^ cerc2.cpp:38:1: error: 'procedure' does not name a type procedure sort; ^ cerc2.cpp:39:1: error: 'var' does not name a type var i,j:longint; ^ cerc2.cpp:40:1: error: 'begin' does not name a type begin ^ cerc2.cpp:42:6: error: expected unqualified-id before 'for' for j:=1 to m do begin ^ cerc2.cpp:44:10: error: 'ind' does not name a type ind[l[i]]:=j; ^ cerc2.cpp:45:13: error: expected constructor, destructor, or type conversion before '(' token dec(l[i]) ^ cerc2.cpp:48:1: error: 'begin' does not name a type begin ^ cerc2.cpp:50:6: error: 'sort' does not name a type sort; ^ cerc2.cpp:51:6: error: expected unqualified-id before '{' token {for i:=1 to m do ind[i]:=i;} ^ cerc2.cpp:52:6: error: 'inters' does not name a type inters:=0; ^ cerc2.cpp:53:6: error: expected unqualified-id before 'for' for i:=1 to m do begin ^ cerc2.cpp:55:8: error: 'j' does not name a type j:=s.p1 mod n+1; ^ cerc2.cpp:56:8: error: expected unqualified-id before 'while' while j<>s.p2 do begin ^ cerc2.cpp:58:14: error: 'j' does not name a type j:=j mod n+1 ^ cerc2.cpp:60:11: error: expected constructor, destructor, or type conversion before '(' token dec(p[s.p1]);dec(p[s.p2]) ^ cerc2.cpp:60:24: error: expected constructor, destructor, or type conversion before '(' token dec(p[s.p1]);dec(p[s.p2]) ^ cerc2.cpp:62:12: error: expected constructor, destructor, or type conversion before '(' token assign(f,fo);rewrite(f); ^ cerc2.cpp:62:26: error: expected constructor, destructor, or type conversion before '(' token assign(f,fo);rewrite(f); ^ cerc2.cpp:63:13: error: expected constructor, destructor, or type conversion before '(' token writeln(f,inters); ^ cerc2.cpp:64: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ă.