Общий форум#include<iostream.h> #include<math.h> int main() { double pi; double l, r,alpha,segm,treug,delta; cin>>l>>r; pi=3; l/=2; if(r<=l/2) cout<<pi*r*r; if(r>(l*sqrt(2))) cout<<l*l*4; else { alpha=2*acos(l/r); segm=pi*r/(2*alpha); treug=l*sqrt(((r*r)-(l*l))); delta=segm-treug; cout<<pi*r*r-4*delta; } return 0; } Sorry pi=3,145 Why when inpus is: 3 1 Output is: -1.#IND ??? Compiler: Visual C++ 6.0 It is said in problem text that the number of measurings does not exceed 25001. But my program get AC only if I set this number >=25002, else WA#9!!! Check your test please!!! This problem appeared after rejudgement. Sorry for wrong verdict after regudge. N was equal 25002 in 9th test. It was my bug. Limitations in the problem statement were changed. Now N <=25000 (as in the original version of problem). All tests with N>25000 were fixed, submits were rejudged. If somebody will find more bugs in this problem, please, write about it. Edited by author 14.05.2007 00:30 Sandro, you add only one test? In test 9 M=2. My wrong solution works now 0.015 :))) Edited by author 14.05.2007 04:59 The limitations in the problem statement are weak. Do you have a test that fails your solution with "if m<100"? By the way you can also replace this line with "if m<1000" :) Try to solve this problem with limitations N<=10^6, numbers <= 10^9. It will be not so easy to get AC with O(N^2) solution. :) If you have some good tests you can mail me: sandro sobaka plotinka ru Edited by author 14.05.2007 11:48 I DO NOT KOWN WHY WHENEVER I GET A CRASH ABOUT(ACCESS VIOLATION). CAN SOMEBODY TELL ME WHY? HERE IS MY PROGRAM: {$M 10000} program ru1116; type node=record b,e,y:integer; end; var n,nn,i,j,k,tot,b,e,y:integer; f1,f:array[1..100]of node; flag:array[-32000..32000]of boolean; begin // assign(input,'input.in');reset(input); read(n); for i:=1 to n do with f1[i] do read(b,e,y); fillchar(flag,sizeof(flag),false); read(k); for i:=1 to k do begin read(b,e,y); for j:=b to e-1 do flag[j]:=true; end; tot:=0; k:=1; while k<=n do begin b:=f1[k].b;e:=f1[k].e; i:=b; repeat while not flag[i] and (i<e) do inc(i); if i>b then begin inc(tot); f[tot].b:=b; f[tot].e:=i; f[tot].y:=f1[k].y; end; while (i<=e)and(flag[i]) do inc(i); b:=i; until i>=e; inc(k); end; write(tot); for i:=1 to tot do write(' ',f[i].b,' ',f[i].e,' ',f[i].y); end. Why I WA test4?? why?????????????? if you know,please tell me!! thank you!! May be you have to use int64 ? Hi, people! I want to thank the author of task for his creation! And I want say, that it was hard work for me to solve this task. But I did it :) Solving this task I found many new things and tricks, so I gained a little experience :) Once again thank you, author! Good luck! PS. Oh, sorry for my bad english I think new tests must be added! This solution get TL#39; time more then 2sec [code deleted] But! If I modify string with label "ATTENSION!" like "for i:=k downto 1 do begin" I get AC with time=0.39 I think it's no good. My solution is wrong. Edited by moderator 09.05.2007 16:05 I wanna see you solution, please contact me in icq: 361968553. Thanks. Author. "each of the remaining lines contains one word, which consists of maximally !50! small letters" but words, which can used can have maximum 10 letters why so much ? I have WA #12? may be my program really have a bug, but how i can guess about your tricky tests? please help me, post there some test cases I have found a bug :) there was for (int i = 0; i < n; i++) instead of for (int i = 0; i <= n; i++) I DONT KNOW WY MY PROGRAM ISN'T CORECT HERE IS MY CODE. WHY WA?? [code deleted] Edited by moderator 09.05.2007 16:03 Wa #5, please hepl! Post some test, please! who knows what is in the test number 3? If anyone can tell me what then sample stands for? It requires that you should print then smaller group,but in the sample No.5 can be put in the larger group so the anser should be 3? Моя прога работает за О(n^3)(алгоритм Флойда). Как можно решить эту задачу по-другому? I am using Pascal and this is my last submitted program [code deleted] I am WONDERING what's wrong with it and I have gone MAD because I have submitted for tens of times........ When I use Longint to solve it I've got an "Time limit exceed" and when I use Extended to calculate it said "wrong answer" on test#1..I don't know why ?~! Edited by moderator 09.05.2007 16:04 Try to use longint without any extended. I mean, read extended, transform it to longint (but carefully) and run. yes I have tried but failed It said that TIME LIMIT EXCEEDED and I also tried round() and trunc() and I got the same answer! I am bored........ Anyone would help me? I will send him my source code.I am not sure whether I have missed something important. But I noticed that long ago that the maxium result should be 5001.Am I wrong? Now .... I want to argue for my program. When I copy a 'AC' script from one of the post above, yes, sure enough it got an 'AC' but the program is rather SLOW. I tested some datas, which were like 0.01and0.02,0.02and0.03,.....until 99.98and99.99, but the result of MY program had NO DIFFERENCES from the AC's. I DON'T KNOW WHY ~?! Am I missed some IMPORTANT extreme situation? Help me, please. [code deleted] please,help me!!!i<=?please,answer!Thank you very much!!!! Edited by author 27.04.2007 19:53 Edited by moderator 09.05.2007 16:04 Edited by author 09.05.2007 21:59 i get AC,But when i Go by different way!!!what wrong in this code? In your first 'for' you use sqrt(this calculates by formula Teylor) Sorry for my english Вобщем на английском не получается. Короче говоря ты в твоем основном цикле используешь квадратный корень а в C++ он считается формулой тейлора т.е. цикл состоящий как минимум 50 шагов да еще то что все считаеш в double => для числа 1'000'000'000 ты выполняешь не 1'000'000'000 а 50'000'000'000 шагов ВОТ и поэтому TLE#9 УСЕ. Спасибо.Кстати я получил AC,но решил по-другому!!!У Эдгара кажется получилось оптимизировать этот код!!! I couldn't image where my prog can get WA: [code deleted] Edited by moderator 09.05.2007 16:04 Ok, if you have WA10 just read carefully BOO gives you -4 Dance Points, MISS -5, with a little change my prog gets AC. Edited by author 09.05.2007 13:51 [code deleted] It doesn't work. Write 'Wrong Answare'. Please, help. Where is my mistake? Edited by moderator 09.05.2007 16:04 And what if there is no words in dictionary which are started with some given prefix? What should I output? Edited by author 22.04.2007 22:32 Edited by author 08.05.2007 22:00 It's first big test. And i had WA because my RadixSort and BinarySearch were wrong, so test 11 isn't special. no body can solve this problem using C++ const int NN = 100000; int a[NN]; unsigned short b[NN]; gets MLE #10 ! Edited by author 06.05.2007 15:00 I have the same problem :( You can use bit operations with this code: const int NN = 100000; int a[NN]; int b[NN / 2]; You can use bit operations with this code: const int NN = 100000; int a[NN]; int b[NN / 2]; It's also 6*10^5 I think admins can subtract ~200K from memory result i can use unsigned short[NN] of course, if i have normal compiler If you experience some technical problems it is faster to contact Vladimir Yakovlev directly through: 1) e-mail; 2) ICQ; 3) mobile phone. P.S. The best C++ compiler ever is used on Timus Online Judge, and you still complain... year ago i solve this problem, now my AC program gets MLE it is really problem |
|