Common Board| Show all threads Hide all threads Show all messages Hide all messages | | To admin: What pascal compiler does Ural use now???? | CleverKid | | 7 Feb 2003 16:15 | 4 | The integer is change to 2 byte, And ..anything else??? Please tell us!!!! | | Why Wrong Answer? | Koala | 1103. Pencils and Circles | 7 Feb 2003 11:41 | 1 | program p1103; const maxn=5000; zero=1e-5; type ptype=record x,y:longint; end; var p:array [1..maxn] of ptype; n,i,j,x1,y1,x2,y2,inside,outside:longint; d,x,y,r:real; tp:ptype; function dis(x1,y1,x2,y2:real):real; begin dis:=sqrt(sqr(x1-x2)+sqr(y1-y2)); end; procedure getcircle(x1,y1,x2,y2,x3,y3:longint; var x,y,r:real); var a1,b1,c1,a2,b2,c2:longint; begin a1:=x1-x2; b1:=y1-y2; c1:=x2*x2+y2*y2-x1*x1-y1*y1; a2:=x1-x3; b2:=y1-y3; c2:=x3*x3+y3*y3-x1*x1-y1*y1; x:=(b2*c1-b1*c2)/(a1*b2-a2*b1); y:=(a1*c2-a2*c1)/(a1*b2-a2*b1); x:=-x/2; y:=-y/2; r:=dis(x,y,x1,y1); end; begin read(n); for i:=1 to n do read(p[i].x,p[i].y); for i:=2 to n do if p[i].y<p[1].y then begin tp:=p[1]; p[1]:=p[i]; p[i]:=tp; end; for i:=3 to n do if p[i].y<p[2].y then begin tp:=p[2]; p[2]:=p[i]; p[i]:=tp; end; x1:=p[1].x; y1:=p[1].y; x2:=p[2].x; y2:=p[2].y; for i:=3 to n do begin getcircle(x1,y1,x2,y2,p[i].x,p[i].y,x,y,r); inside:=0; outside:=0; for j:=1 to n do begin d:=dis(x,y,p[j].x,p[j].y); if d<r-zero then inc(inside); if d>r+zero then inc(outside); end; if inside=outside then begin writeln(x1,' ',y1); writeln(x2,' ',y2); writeln(p[i].x,' ',p[i].y); exit; end; end; writeln('No solution'); end. | | help!where is my program wrong? | girl | 1040. Airline Company | 7 Feb 2003 08:06 | 1 | type btype=record x,y:integer end; var b,c:array[1..1000] of integer; a:array[1..1000] of btype; m,n,i:integer; v:array[1..1000] of boolean; function ok(x,dep:integer):boolean; var ff,min,t,f1,f2,i,j:integer; e:array[1..1000] of integer; begin ok:=true; if b[a[x].x]=1 then begin t:=0; f1:=0; f2:=0; for i:=1 to dep-1 do if (a[c[i]].x=a[x].x) then begin inc(t); e[t]:=i; if i mod 2=0 then inc(f2) else inc(f1); end else if (a[c[i]].y=a[x].x) then begin inc(t); e[t]:=i; if i mod 2=0 then inc(f2) else inc(f1); end; inc(t); e[t]:=dep; if dep mod 2=0 then inc(f2) else inc(f1); if (t=1) then exit; if (t>=2) and (f1=0) then begin ok:=false; exit; end; min:=0; min:=e[1]; for i:=2 to t do if e[i]<min then min:=e[i]; if min=1 then exit; for i:=2 to min do begin ff:=0; for j:=1 to t do if e[j] mod i=0 then inc(ff) else break; if ff=t then begin ok:=false; exit; end; end; if b[a[x].y]=1 then begin t:=0; f1:=0; f2:=0; for i:=1 to dep-1 do if (a[c[i]].x=a[x].y) then begin inc(t); e[t]:=i; if i mod 2=0 then inc(f2) else inc(f1); end else if (a[c[i]].y=a[x].y) then begin inc(t); e[t]:=i; if i mod 2=0 then inc(f2) else inc(f1); end; inc(t); e[t]:=dep; if (t=1) then exit; if (t=2) and (f1=0) then begin ok:=false; exit; end; if (t>2) and (f1=0) then begin ok:=false; exit; end; min:=e[1]; for i:=2 to t do if e[i]<min then min:=e[i]; for i:=2 to min do begin ff:=0; for j:=1 to t do if e[j] mod i=0 then inc(ff) else break; if ff=t then begin ok:=false; exit; end; end; end; end; end; procedure search(dep:integer); var i,j:integer; begin for i:=1 to m do if ok(i,dep) and (v[i]=false) then begin v[i]:=true; c[dep]:=i; dec(b[a[i].x]); dec(b[a[i].y]); if dep=m then begin writeln('YES'); for j:=1 to m do write(c[j]:5); halt; end else search(dep+1); c[dep]:=0; inc(b[a[i].x]); inc(b[a[i].y]); v[i]:=false; end; end; begin read(n,m); fillchar(v,sizeof(v),0); fillchar(a,sizeof(a),0); fillchar(b,sizeof(b),0); for i:=1 to m do begin read(a[i].x,a[i].y); inc(b[a[i].x]); inc(b[a[i].y]); end; search(1); writeln('NO'); end. | | this works! | Marcin Mika | 1089. Verification with the Dictionary | 7 Feb 2003 05:27 | 1 | #include <stdio.h> #include <string.h> #include <ctype.h> FILE *in,*out; char words[1000][100]; char data[10000]; char temp[5120]; int match( int k ){ int d=0; int f=0; while ( temp[f] ){ if ( words[k][f]!=temp[f] ) d++; if ( d>1 ) return 0; f++; } return d==1; } void main( void ){ //in=fopen( "input.txt", "r" ); in=stdin; out=stdout; //char temp[512]; int i,j,k; i=0; while ( 1 ){ fscanf( in, "%s", temp ); if ( temp[0]=='#' ) break; strcpy( words[i], temp ); i++; } j=0; fgetc(in); while ( !feof(in) ) data[j++]=fgetc(in); j-=2; data[j]=0; ///j-=2; int ncorrect=0; int p; for ( k=0; k<j; k++ ){ while ( ispunct(data[k]) ) k++; p=0; while ( k<j && isalpha(data[k]) ) temp[p++]=data[k++]; temp[p]=0; int c; for ( c=0; c<i; c++ ) if ( strlen(words[c])==p ) if ( match(c) ){ memcpy( &data[k-p],words[c],p ); ncorrect++; } } for ( k=0; k<j; k++ ) fputc( data[k], out ); fprintf( out, "\n%d\n", ncorrect ); } | | With TP 7.1 my program works very good, but when submitting I got compilation error. Why this can be? | Artem Gluhov | | 7 Feb 2003 05:23 | 2 | | | Whats wrong whith this code | Fechete Dan Ionut[dany] | 1120. Sum of Sequential Numbers | 7 Feb 2003 02:18 | 2 | > #include <stdio.h> #include <math.h> double i,j,n,m,k,a,p; int equal(double a,double b) { double c=a-b; if (c<0) c*=-1; if (c<0.0000001) return 1; return 0; } int main() { scanf ("%lf",&n); for (a=0;a<=n;a++) { double delta=sqrt((2*a-1)*(2*a-1)+8*n); p=(1-2*a+delta)/2; if (equal(p,floor(p))==1) { printf ("%.0lf %.0lf",a,p); return 0; } } return 0; } | | What does "Problem temporary locked" mean? | OverAll | | 4 Feb 2003 23:58 | 1 | | | When would the judge system work correctly? | Adam Alz Rutkowski | | 4 Feb 2003 23:21 | 1 | Half of my correct solusions get "restricted function". It's becoming irritating. | | Yes! I've done it! Now I'm in Timus' Top-25. Thanks to all who helped me on this way... (-) | Dmitry 'Diman_YES' Kovalioff | | 4 Feb 2003 20:30 | 3 | | | What does "problem temporary locked" mean? | OverAll | | 4 Feb 2003 20:28 | 3 | | | ADMINS. Will you make winter OnLine contest. please. | I am david. Tabo. | | 4 Feb 2003 18:53 | 1 | | | It's easy. Look at me | Zhang Ran | 1100. Final Standings | 4 Feb 2003 13:05 | 4 | const Inf ='1100.in'; max =150000; var num :array[1..max] of longint; n :longint; procedure into; var i,a,b :longint; begin assign(input,Inf); reset(input); readln(n); if n=0 then halt; for i:=1 to n do begin readln(a,b); num[i]:=a*1000+b; end; close(input); end; procedure workout; var i,j,max, Tmax :longint; begin for i:=100 downto 1 do for j:=1 to n do if num[j] mod 1000=i then writeln(num[j] div 1000,' ',num[j] mod 1000); end; begin into; workout; end. > const > Inf ='1100.in'; > max =150000; > var > num :array[1..max] of longint; > n :longint; > > procedure into; > var > i,a,b :longint; > begin > assign(input,Inf); reset(input); > readln(n); > if n=0 then halt; > for i:=1 to n do > begin > readln(a,b); > num[i]:=a*1000+b; > end; > close(input); > end; > > procedure workout; > var > i,j,max, > Tmax :longint; > begin > for i:=100 downto 1 do > for j:=1 to n do > if num[j] mod 1000=i then writeln(num[j] div 1000,' ',num[j] > mod 1000); > end; > > begin > into; > workout; > end. > const > Inf ='1100.in'; > max =150000; > var > num :array[1..max] of longint; > n :longint; > > procedure into; > var > i,a,b :longint; > begin > assign(input,Inf); reset(input); > readln(n); > if n=0 then halt; > for i:=1 to n do > begin > readln(a,b); > num[i]:=a*1000+b; > end; > close(input); > end; > > procedure workout; > var > i,j,max, > Tmax :longint; > begin > for i:=100 downto 1 do > for j:=1 to n do > if num[j] mod 1000=i then writeln(num[j] div 1000,' ',num[j] > mod 1000); > end; > > begin > into; > workout; > end. you should write for I := 100 downto "0" instead of "1" You have too many variables that you never used. Aidin | | weird,my program keeps "running",but it doesn't get TLE,please help me,tell me what's the matter | dynamic(Ying Wang) | 1140. Swamp Incident | 4 Feb 2003 12:08 | 3 | i submit my program,but the status is always "running" now i have no idea about it,maybe something is wrong with the judge? here is my program: #include <stdio.h> #include <string.h> #include <math.h> #include <ctype.h> int x=0,y=0,z=0; void eliminate_x(){ y+=x,z-=x,x=0; } void eliminate_y(){ x+=y,z+=y,y=0; } void eliminate_z(){ x-=z,y+=z,z=0; } int main() { int i,n,step,type=0,min,m; char c; //freopen("test.in","r",stdin); scanf("%d",&n); for(i=0;i<n;i++){ c=0; while(!isalpha(c)) c=getchar(); scanf("%d",&step); if (c=='X') x+=step; else if (c=='Y') y+=step; else if (c=='Z') x-=step,y+=step; } min=abs(x)+abs(y); eliminate_x(); if (abs(y)+abs(z)<min) min=abs(y)+abs(z),type=1; eliminate_y(); if (abs(x)+abs(z)<min) min=abs(x)+abs(z),type=2; m=0; if (type==0){ eliminate_z(); if (!x) m++; if (!y) m++; printf("%d\n",m); if (x) printf("X %d\n",-x); if (y) printf("Y %d\n",-y); }else if (type==1){ eliminate_x(); if (!y) m++; if (!z) m++; printf("%d\n",m); if (y) printf("Y %d\n",-y); if (z) printf("Z %d\n",-z); }else{ if (!x) m++; if (!z) m++; printf("%d\n",m); if (x) printf("X %d\n",-x); if (z) printf("Z %d\n",-z); } return 0; } if wait a little more (at last 1day) you will find your result. don`t submit it again... Yours Aidin Yeah... And my program keep running. I submit it before 12 hours !!!! :)))) How many tests there is for this problem ? :)) | | Happy Chinese New Year for all Chinese programmers! | abc | | 3 Feb 2003 20:29 | 3 | May the year of goat be a fruitful year for everyone of you! > May the year of goat be a fruitful year for everyone of you! > > May the year of goat be a fruitful year for everyone of you! | | Worst maybe you are unlucky but you sure are stupid | Fechete Dan Ionut[dany] | | 3 Feb 2003 18:46 | 5 | No. Maybe he is a stupid spammer. He submitted problem 1000 about 4000 times. This is absolutely stupid..... | | What is it "Crash (ACCESS_VIOLATION)" | Volkov Evgeny | | 3 Feb 2003 18:20 | 1 | What is it "Crash (ACCESS_VIOLATION)" admin555p@mail.ru | | Can anyone tell me why could I only use 64k and 0.11sec?Thanks.E-mail to me: Sunread@cmmail.com | SunCat | 1067. Disk Tree | 3 Feb 2003 14:33 | 1 | | | "except maybe for some extra spaces or line breaks." | CleverKid | 1007. Code Words | 2 Feb 2003 19:58 | 2 | But there is no this case in testdata!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IT might that it be because i see u haven`t solved it. i sent a mail today morning. do u got it? (it included my photoes) Yours Aidin | | May be somebody have tests of task 1006. | Volkov Evgeny | 1006. Square Frames | 2 Feb 2003 19:46 | 1 | | | PLEASE ADMINES POST THE PROGRAMS 1233-1241!!!!! | I am david. Tabo. | | 2 Feb 2003 18:21 | 1 | |
|
|