Common BoardI have checked all test cases, but i still have not AC! Please give me more special tests(( please check for the case when ay==by type ex = extended; var x1,y1,x2,y2,x3,y3,x,y,l,ll,mi,ma,a,b,c,p,k1,k2,b1,b2 : ex; function min (a,b : ex) : ex; begin if a<b then min:=a else min:=b; end; function max (a,b : ex) : ex; begin if a>b then max:=a else max:=b; end; function dist (x1,y1,x2,y2 : ex) : ex; begin dist:=sqrt(sqr(x1-x2)+sqr(y1-y2)); end; procedure wr (mi,ma : ex); begin ma:=ma-l; if ma<0 then ma:=0; mi:=mi-l; if mi<0 then mi:=0; writeln(mi:0:2); writeln(ma:0:2); halt(0); end; begin read(x1,y1,x2,y2,x,y,l); if x1=x2 then begin if (y<=max(y1,y2))and(y>=min(y1,y2))then begin mi:=abs(x-x2); ma:=max(dist(x,y,x1,y1),dist(x,y,x2,y2)); wr(mi,ma); end; ma:=max(dist(x,y,x1,y1),dist(x,y,x2,y2)); mi:=min(dist(x,y,x1,y1),dist(x,y,x2,y2)); wr(mi,ma); end; if y1=y2 then begin if (x<=max(x1,x2))and(x>=min(x1,x2))then begin mi:=abs(y1-y); mi:=mi-l; ma:=max(dist(x,y,x1,y1),dist(x,y,x2,y2)); wr(mi,ma); end; ma:=max(dist(x,y,x1,y1),dist(x,y,x2,y2)); mi:=min(dist(x,y,x1,y1),dist(x,y,x2,y2)); wr(mi,ma); end; a:=dist(x1,y1,x,y); b:=dist(x2,y2,x,y); c:=dist(x1,y1,x2,y2); p:=(a+b+c)/2; ll:=2*sqrt(p*(p-a)*(p-b)*(p-c))/c; k1:=(y1-y2)/(x1-x2); b1:=y1-k1*x1; k2:=-1/k1; b2:=y-k2*x; x3:=(b2-b1)/(k1-k2); y3:=k1*x3+b1; if (x3<=max(x1,x2))and(x3>=min(x1,x2))and (y3<=max(y1,y2))and(y3>=min(y1,y2))then begin mi:=ll; ma:=max(dist(x,y,x1,y1),dist(x,y,x2,y2)); wr(mi,ma); end else begin ma:=max(dist(x,y,x1,y1),dist(x,y,x2,y2)); mi:=min(dist(x,y,x1,y1),dist(x,y,x2,y2)); wr(mi,ma); end; end. please try for case when ay==by #include <cstdio> char a[300010], k; int main(){ char c; while((c = getchar()) != EOF){ if(k == 0 || a[k - 1] != c) a[k++] = c; else k--; } for(int i = 0; i < k; i++) putchar(a[i]); return 0; } This one gives RE(AV) on the 6th test. I tried it 4 times with different sizes of array "a" (200000, 200010, 300010, 2000000) and each time got this error. I found it very strange, could you help me please? Any tests? Try it in this cases: 1. Only one team. 2. No Isenbaev at all. any idea mobius inversion? Did anyone make it to the time limit using Python 3.3? I make it to memory limit To do it in Python 3.3, forget about numbers. Use only strings and Boyer-Moore algorithm :) [AC CODE] Edited by author 24.01.2006 19:33 Why? Edited by author 23.01.2006 22:29 a'a'a'a'a - five words. thanx a lot , i got AC too!!! Can anyone write for me test 18, plz? Any help would be appreciate! what is test 22? i wa 22 what's wrong? #include<stdio.h> #include<string.h> int n,p,a[1000010],min=1000000,max=0,sum=0,ans=0; int main() { int i,x,j,k; memset(a,0,sizeof(a)); scanf("%d%d",&n,&p); for(i=1; i<=n; i++) { scanf("%d",&x); a[x]++; if(x<min) min=x; if(x>max) max=x; } for(i=min; i<=max; i++) if(a[i]!=0) { if(a[i]*i>=p) break; sum+=a[i]; ans++; } for(k=min; k<i; k++) if(a[k]!=0){ for(j=k+1; j<i; j++) if(a[j]!=0) break; if(a[j]==0) break; if(j*(a[k]+a[j])<p) { ans--; a[j]+=a[k]; a[k]=0; } } printf("%d %d\n",sum,ans); return 0; } Edited by author 10.03.2013 08:41 呃…… Edited by author 10.03.2013 08:48 Edited by author 10.03.2013 08:48 you can cast a spell with power of p Hello i wrote the following code in python , but it takes too much time, hwo should it be improved class timus1073: def __init__(self): pass def problem(self,y): a = [0] + range(1,60001) b = [x**2 for x in range(1,246)] for i in b: j = 0 while j+i <= 60000: if (a[j+i] > a[j] + 1): a[j+i] = a[j] + 1 j = j + 1 return a[y] if __name__ == "__main__": p = timus1073() a = input() print p.problem(int(a)) test #2 include 1,when you input 1,you will output 2 not 1 Пример исходные данные результат 3 2 3 ||| - 3 бифштекса, 2 на одной сковороде || - 2 минуты | - 2 минуты итого 4 минуты, а не 3 Please read down the forum.. 12 23 13 их можно недожареные убирать потом опять ложить чтобы всегда на сковороде лежало з штуки! Подумай над этим Как? Если количество месть на сковороде 2 как ты туда одновременно положишь 3? вы че считать не умеете? how u can put third Steak if you can put only 2? Where is the Logic? А все я понял! Но все равно ты не правильно объясняешь!) А другим объяснить видимо нельзя,спасибо. Первая минута: 1 сторона 1-ого Б. , 1 сторона 2-ого Б. Вторая минута: 2 сторона 1-ого Б. , 1 сторона 3-ого Б.(первый готов) Третья минута: 2 сторона 2-ого Б. , 2 сторона 3-ого Б.(второй и третий готов) New tests were added. 123 authors lost AC after rejudge. Which is strange, since everything else is allowed in output. em test thử tren visual 2010 ra kết quả nhung khi nop len acm toan in ra cau tra loi sai |
|