| Show all threads Hide all threads Show all messages Hide all messages |
| WA#14 Impossible ! | Mickkie | 1011. Conductors | 29 Dec 2012 13:50 | 1 |
#include<stdio.h> double i,j,p,q,per; int main() { scanf("%lf %lf",&p,&q); for (i=1;;i++) for (j=0;j<=i;j++) { per=100*j/i; if (p<per && per<q) { printf("%d",(int) i); scanf(" "); return 0; } } } |
| If you have TL on test 3, read this | Doctor Lai | 1922. Superhero Team | 28 Dec 2012 07:27 | 1 |
The main loop is just O(n), not O(n^2) you need to sort the heroes first according to their wishes. the main loop is for (int i = 1; i <= ulen; i ++) { if (w[0].wish <= i) { used[0] = true; search(0, i, 1); used[0] = false; } } Edited by author 29.12.2012 01:28 Edited by author 29.12.2012 01:31 |
| 'Each value of the function is longint '..en..it's right i think | LLL | 1010. Discrete Function | 27 Dec 2012 20:08 | 1 |
if 'a' and 'b' are both longint,abs(a-b) can be __int64. |
| What is Wrong? | Bekmyrat | 1110. Power | 27 Dec 2012 08:05 | 2 |
# include <iostream> #include <cmath> #include <vector> using namespace std; int main() { vector < int > asd; int a,b,c,d,e=0;
cin>>a>>b>>c;
for(double i=1;i<=999;i++) { if(i<=b) { d=pow(i,a); if(d%b==c) asd.push_back(i);
else e++; } } if(e==b) cout<<"-1"; else { cout<<asd[0]; for(int i=1;i<asd.size();i++) cout<<' '<<asd[i]; }
getchar(); getchar();
return 0; } I think you should delete lines: getchar(); |
| How my O(n^4) solution got AC. | Raman Gupta | 1146. Maximum Sum | 26 Dec 2012 21:31 | 3 |
I was little discouraged when my O(n^4) solution got AC.What remains the purpose of Dp ,if I could do it by complete search. Please mail me the O(n^3),O(n^2),O(n) solution for this task,any or all complexity written here. My mail id is royalbird.raman@gmail.com thanks for your support O(n) cannot be achieved in this problem, because of O(n^2) input. I think you use a kind of DP when you sum the numbers in every rectangle. (In fact, the most complete search has the complexity O(n^6)) =)) |
| Crash (stack overflow) | Komron | 1203. Scientific Conference | 26 Dec 2012 10:12 | 1 |
I wrote my code 3 times and the checker keeps on telling me that my solution crashes on some kind of stack overflow...Please help in fixing this issue, thanks. UPD: The problem is solved, so the question is canceled. Edited by author 26.12.2012 10:56 |
| using Java.math.BigInteger really saves a lot of coding | Doctor Lai | 1222. Chernobyl’ Eagles | 25 Dec 2012 05:59 | 3 |
Hehe,,, normally i don't write Java code, but I am lazy this time :) YOU ARE REALLY LAZY : void MLT(int x) { int r = 0; REP(i,3000) { int init = ((res[i]*x)+r);
res[i] = init % 10; r = init / 10; } } |
| Crash (floating-point invalid operation) | PolyZonder | 1679. Scrooge's Tower | 24 Dec 2012 07:00 | 2 |
Hello, ladies and gentlemens. Can somebody help me? My program compiles on my computer (Delphi 6), but when i send it to judge, i get message 'Crash (floating-point invalid operation)'. How i can solve this problem? what is wrong? Check that you do not divide to 0. (For example when x1=x2) |
| Those three translation can only use exactly once ~~! | beta | 1007. Code Words | 22 Dec 2012 20:31 | 1 |
|
| if array [1..16600000](longint) then crash(acces violation) if array[1..17000000] then memory exceed.... What to do???? | green_smile | 1915. Titan Ruins: Reconstruction of Bygones | 22 Dec 2012 15:33 | 4 |
What to do with this problem??? Me too, always access violation if type 0 10^6-2 times, and 2 first elements would be nums, so num of elements in array would be 2^(10^6-2). I think that's the problem |
| To admins: does test1 coincide with the sample test from problem statement? | lenny | 1332. Genie Bomber | 21 Dec 2012 19:12 | 1 |
|
| WA 17 | Andrew Shmig [VlSU] | 1027. D++ Again | 20 Dec 2012 20:54 | 4 |
WA 17 Andrew Shmig [VlSU] 1 Aug 2009 15:17 what's in this test что в этом тесте может быть такого? перепроверил все уже... все примеры с форума, свои придумал, но все-равно ВА17 кто знает тест? Edited by author 01.08.2009 17:05 решил. спасибо всем ) Edited by author 01.08.2009 17:20 May be somebody knows the answer? I need an advice... Yeah!!! I solved it! You only need to look through themes before Edited by author 07.08.2009 20:52 Do not forget that space character can not be inside arithmetic expression! That was the reason why I got WA17. Re: WA 17 Inspector [Barnaul] 20 Dec 2012 20:54 Thank you, a good man) It realy works! |
| WA2 | pmartynov | 1109. Conference | 20 Dec 2012 12:41 | 2 |
WA2 pmartynov 19 Dec 2012 03:09 Could someone provide me with a test case? Each test from the discussion list passes ok. But still WA2. Edited by author 20.12.2012 00:01 Re: WA2 pmartynov 20 Dec 2012 12:41 Wrote more than 40 tests by myself to check. All passed correctly. Any help would be appreciated. |
| Some tests, please (-) | exwRabbits_AlMag(VNTU) | 1753. Bookshelf | 20 Dec 2012 08:23 | 2 |
12 234 1344 80.7365278858 10 11 12 0 1 999 1000 487.6458506118 |
| halp me please | Zamesova | 1020. Rope | 19 Dec 2012 15:25 | 2 |
Program NoName; var n,r,i:integer; x: array [1..100] of real; y: array [1..100] of real; s,sg:real; input,output:text; begin s:=0; assign(input, 'input.txt'); reset(input); assign(output, 'output.txt'); rewrite(output); readln(n,r); if n=1 then writeln(1.00)else begin For i:=1 to n do readln(x[i],y[i]); sg:=2*pi*r; For i:=1 to n-1 do s:=s+sqrt(sqr(x[i]-x[i+1])+sqr(y[i]-y[i+1])); s:=s+sqrt(sqr(x[n]-x[1])+sqr(y[n]-y[1])); s:=s+sg; end; writeln(s:1:2); close(input); close(output); end. First, remove the read and write in the txt files, you need to read/write from/to the console. You'll get WA3 now. Try to re-think the case when n=1; the answer is not always 1! |
| please give me test 4!!!!! | [TH0112]_o.o | 1837. Isenbaev's Number | 19 Dec 2012 04:15 | 1 |
|
| wa test 4? | [TH0112]_o.o | 1837. Isenbaev's Number | 19 Dec 2012 04:02 | 1 |
Edited by author 19.12.2012 04:05 wrong test 4? 1837, why? Edited by author 19.12.2012 04:06 Edited by author 19.12.2012 04:06 Edited by author 19.12.2012 04:06 Edited by author 19.12.2012 04:07 Edited by author 19.12.2012 04:10 |
| Why WA#1? | S.Spooky | 1837. Isenbaev's Number | 18 Dec 2012 22:54 | 3 |
I can't realize what my problem is! #1 must be the simplest test case ( or the sample given ) but I can't see anything in my code that seems to be wrong... can YOU help me? I also have a WA #1 Did you find the problem? my problem is using fflush(stdin) after cin>>n ;(n= number of team), When I delete "fflush(stdin);" , I would pass #1. But I have problem with #9. Haha... |
| Maybe useful | KNIGHT0X300 (Nipuna Samarasekara) | 1075. Thread in a Space | 18 Dec 2012 21:36 | 1 |
Maybe useful KNIGHT0X300 (Nipuna Samarasekara) 18 Dec 2012 21:36 I got AC as I changed all ints to longs. I thought ints would be sufficient to do the sum. Still can't figure out why longs are needed. |
| i don't understand why? | Rustam Ganeyev | 1645. Ski Race | 18 Dec 2012 15:57 | 6 |
could you explain me test and answer? i can't understand how this situation may happen finally i understood the problem. solution is much easier than it's problem. the problem's solution is very easy: to find min: min[i] = i -count of a[j] where{j<i and a[j]>a[i]} to find max: max[i] = n -count of a[j] where{j>i and a[j]>a[i]} good luck! Much more harger and so important is to prove the result. here is my solution, i don't know why it is not correct and i always wa at #6 lowest: min[i] = count of a[j] where{j>i and a[j]<a[i]} + 1 highest: max[i] = n - count of a[j] where{j<i and a[j]>a[i]} i need some help, thx. Edited by author 28.10.2008 08:15 finally i understood the problem. solution is much easier than it's problem. the problem's solution is very easy: to find min: min[i] = i -count of a[j] where{j<i and a[j]>a[i]} to find max: max[i] = n -count of a[j] where{j>i and a[j]>a[i]} good luck! I think there are some mistakes in your code. For other: Don't look at this code. Think yourself (As I) :) You are right,that anwer got Wa6 |