Show all threads Hide all threads Show all messages Hide all messages |
Case 6 Explained! | ElPsyCongroo | 1607. Taxi | 26 May 2014 23:21 | 1 |
This case was a corner usecase. This talks about the scenario where the driver offers less than what the traveller is trying to pay. Example: 11 1 10 2. Since the traveller/Petr can never do a '-' operation, he has to satisfy for 11. Thanks, ElPsyCongroo. |
It is useful for you... | Adhambek | 1375. Bill Clevers | 26 May 2014 22:39 | 2 |
x^2 + y^2 = A * p + k; you use this simple algorithm: A = [0....p] and simple Check: first time : y = 0 and x = sqrt(A*p + k) if(x*x == A*p + k) you should Print this answer: x and y else second time: x = (int) sqrt(A*p + k) and y = sqrt(A*p + k - (int)x*x) if(x*x + y*y == A*p + k) you should Print this answer : x and y else continue and increasing only ONE count of A Sorry my English... Edited by author 04.01.2014 13:44 Edited by author 26.05.2014 22:39 |
Weak tests | Tbilisi SU: Gio | 1720. Summit Online Judge | 26 May 2014 20:54 | 4 |
1000000000 1000000001 100000000000000000 1000000000000000000 for such kind of tests my solution works more than 10 sec, here I got AC in 0.031. Confirming this test has to be added. My solution that got AC on the contest gets TLE on it. |
Python hint | Xel | 1640. Circle of Winter | 26 May 2014 20:16 | 1 |
Use print '%.16f' % (result) instead of print result |
Почему ВА на 22 тесте???? | Алёна | 1785. Lost in Localization | 26 May 2014 18:34 | 1 |
Var n:LongInt; Begin Read(n); if n in [1..4] then writeLn('few'); if n in [5..9] then writeLn('several'); if n in [10..19] then writeLn('pack'); if n in [20..49] then writeLn('lots'); if n in [50..99] then writeLn('horde'); if n in [100..249] then writeLn('throng'); if ((n>=250) and (n<=499)) then writeLn('swarm'); if ((n>=500) and (n<=999)) then writeLn('zounds'); if n>=1000 then writeLn('legion'); end. |
test #8 please | Mihail | 1240. Heroes of Might and Magic | 26 May 2014 06:18 | 1 |
Tell input data for test number 8, please ! :) |
WA13 | Rodrigo Paim | 2008. Swifty | 25 May 2014 23:54 | 1 |
WA13 Rodrigo Paim 25 May 2014 23:54 Hello there, I keep getting wrong answer for test 13 and I have no clue whatsoever of the reason. I am using integer values (long long) in this problem and always check if the flea can go left->right->left->head OR right->left->right->head. Moreover, I consider different scenarios: * Pure vertical jump (dx = 0), and I only allow an upward jump in this case (otherwise it would be a simple fall with no effort); * Horizontal jump (dy = 0): I apply the formula for the maximum horizontal range (with theta = 45 degrees); * Upward jump with horizontal move: I calculate the minimum initial horizontal and vertical speeds (as it is a parabolic trajectory, I try to check if there is an initial configuration such that the vertex of the parabola (with Vy = 0) coincides with the final position; * Fall with horizontal move (dy < 0 and dx != 0): In this case, I consider that the flea only has non null initial horizontal speed and check if the horizontal distance is enough to reach the final point. So that is it. Thank you very much for eventual answers. Edited by author 25.05.2014 23:55 |
Sorry. :-( | Mazykach | 1880. Psych Up's Eigenvalues | 25 May 2014 18:34 | 2 |
I write question and find the ansver my selve, so i delete the question to not bother you. But i dont now hav to erase my qestion, so i vrite this thing. Sory for litter on your forum. Ps. And sorry for my english. Edited by author 05.10.2012 16:16 Next time leave the question and answer it yourself, it may help someone else! |
Accepted on C++ | Izobara | 1001. Reverse Root | 24 May 2014 22:00 | 8 |
#include <stdio.h> #include <math.h> double stack[131073]; int main() { int index = -1; while(scanf("%lf", &stack[++index]) != EOF); for(; index > 0;printf("%.4lf\n", sqrt(stack[--index]))); return 0; } If the digit is negative? If the digit is negative? Just use the same method, and append "i" to denote the imaginary number. If the digit is negative? lol 0<=A<=10^18 read description :P Edited by author 21.11.2013 00:35 Edited by author 21.11.2013 00:35Hi, can this code be accepted? The input value can be much larger than double value, even long type. A strange fact: [...] double b[100000000]; int i = 0; int main(){ while (scanf("%lf", &b[i++]) == 1); i--; while (i > 0) printf("%.4lf\n", sqrt((double)b[--i])); return 0; } Get AC BUT: [...] long long b[100000000]; int i = 0; int main(){ long long a; while (scanf("%lld", &b[i++]) == 1); i--; while (i > 0) printf("%.4lf\n", sqrt((double)b[--i])); return 0; } Gets WA 1. I understand nothing in this life..=) I wonder where may be mistake? Compiler G++ 4.7.2 Mingw gcc does not recognize %lld, use %I64u. And now it does not work with %.4lf in printf, only with %.4f (in C++11 mode). Well, it should be double not long long since the output is in real number A strange fact: [...] double b[100000000]; int i = 0; int main(){ while (scanf("%lf", &b[i++]) == 1); i--; while (i > 0) printf("%.4lf\n", sqrt((double)b[--i])); return 0; } Get AC BUT: [...] long long b[100000000]; int i = 0; int main(){ long long a; while (scanf("%lld", &b[i++]) == 1); i--; while (i > 0) printf("%.4lf\n", sqrt((double)b[--i])); return 0; } Gets WA 1. I understand nothing in this life..=) I wonder where may be mistake? Compiler G++ 4.7.2 |
Be carefully from Test 25. | Adhambek | 1915. Titan Ruins: Reconstruction of Bygones | 24 May 2014 16:53 | 2 |
this is simple test for TEST 25. 10 -1 0 1 2 0 0 -1 -1 -1 2 Answer : 2 1 2 Edited by author 07.11.2013 16:13 That's not a valid test since you can't begin with -1, popping an empty stack. |
some tests | Vladimir | 1936. Roshambo | 24 May 2014 01:44 | 10 |
Give me, please, first 10-15 answers. It's not hard to get the correct formula for this problem, but harder to implement it because of high precision required. At last I had to use precalculated array for getting AC. Here's your answers: 2 -> 1.5 3 -> 2.25 4 -> 3.21428571 5 -> 4.48571429 6 -> 6.21981567 7 -> 8.64673579 8 -> 12.1044438 9 -> 17.0919353 10 -> 24.3495978 Re: some tests Vedernikoff 'Goryinyich' Sergey (HSE: АОП) 18 Dec 2012 04:19 What was the issue? For me straightforward implementation in C++ using double got AC easily. How did you take 100th power of 3/2? I can't think it out. I've never used decimal long arithmetic. Edited by author 03.01.2013 16:06 Edited by author 03.01.2013 16:06 Re: some tests Vedernikoff 'Goryinyich' Sergey (HSE: АОП) 4 Jan 2013 16:09 It is useful to remember that standard double type can store numbers up to 10^300 (and even a bit more). (3/2)^100 < 2^100 < 10^35 => no problem to compute it in double. And since you need relative accuracy of only 7 digits => 16+ digits that double variable stores is more than enough to compute what you need. Actually, here with usual double you can calculate answers for n up to 500+. Is it really true? I always thought that double type takes only 8 bytes of memory and hence cannot store such big numbers. But anyway thank you. Maybe I just have bad compiler or bad implementation as always :) Re: some tests Vedernikoff 'Goryinyich' Sergey (HSE: АОП) 6 Jan 2013 01:25 good test: n=40 ans=3688328.070956036 The problem asks for at least 6 correct decimals. I had to compute up to 100 decimals (in intermediate computations) to get the required precision in the final answer for n = 100. Here is the (censored) answer for the biggest possible test: n = 100 answer = 13552*3*4*4*1*6*18.186159417 |
although slower than DFA, AC with kmp ( 0.625 sec) | muhammad | 1102. Strange Dialog | 24 May 2014 01:07 | 2 |
Are you kidding? My dumb solution in python ACCed in 0.3 sec:D Edited by author 24.05.2014 01:07 |
WA #25 | igorsky | 1711. Code Names | 23 May 2014 23:41 | 4 |
WA #25 igorsky 12 Oct 2009 16:58 Re: WA #25 DM^Dude (Kherson State University) 22 Oct 2009 01:53 me help test --------------------------------------------------- 16 cipher grille kamkohob names grillee pcodes newtests rejudge timus size volume summit watchmen braineater twosides solution random yesorno keywords subversion commands bosses shooting shaitan game strategy playgame mnemonic palindromes bestname eligibility rectangle rules txxxxxxx txxxyzasd txxxxxas volvo vlot volt vvv vvilia vvobla what is it zina whashing potatoes 2 1 7 10 9 6 11 3 8 4 5 12 13 14 15 16 ------------------------------------------------ answer is ------------------------------------------------ grillee kamkohob keywords mnemonic playgame random rectangle rejudge shaitan size twosides txxxxxas vlot vvilia what zina For your test,i got the same answer ,but my code wa#20 I've had this problem too. THen i found my mistake. My function that compared two strings and returned the lower one: f f("aa","aaaa")="aa"; f("aaaaa","aa")="aaaaa"; - this was a mistake. It should have returned "aa" sorry for my English |
WA №3 | AKruglyak | 1131. Copying | 22 May 2014 22:33 | 3 |
WA №3 AKruglyak 21 Feb 2012 21:48 Why? This is my solution: #include <iostream> using namespace std; int main(){ long int a,b,f=0; long int k=1; cin>>a>>b; if (a==1) { f=0; cout<<f; return 0;
}
if (b>=a && a<=2) f=1;
else if(a!=1){ while (k<=b){ f++; k*=2;
} a -=k; while (a>0){ f++; a=a-b;
} } cout<<f;
return 0; } Some test for your program 10 1 ans 9 3 8 ans 2 Some test for your program 10 1 ans 9 3 8 ans 2 Спасибо, помогло=) |
I u have WA #7 | † SiriuS † [TWYT Union] | 1419. Maps of the Island Worlds | 22 May 2014 16:47 | 1 |
I got WA #7 several times. If u also got WA just try this test: 9 5 O-O-O-O-O |\ \|/ /| O-O O O-O |/|\ /|\| O-O-O-O-O It helped me to get AC. |
acmp | Abdulkhakim | 1025. Democracy in Danger | 22 May 2014 15:12 | 3 |
acmp Abdulkhakim 15 Jan 2014 14:54 why this is accepted but in the acmp wrong answer 2 461 in acmp Edited by author 15.01.2014 14:54 Because there numbers may be even. Re: acmp Smilodon_am [Obninsk INPE] 22 May 2014 15:12 Restrictions on number K are different |
... Stack overflow... ? C++ | Ingy | 1001. Reverse Root | 22 May 2014 14:58 | 2 |
#include <cmath> #include <iomanip> #include <iostream> using namespace std; int main () { double number [100000]; int i=0; while ( ! cin.eof()) { cin >> number [i]; i++; } for( int j=i-1; j>=0; j--) { cout<< setprecision (4) << sqrt(number[j])<<endl; } return 0; } here's my program but I don't know what's wrong.. when i put the number of elements of the array to 140000 it says "stack overflow", when i put 10000 it says wrong answer. All local variables are allocated in stack. Array "number"[] is local, because it is described in function "main". Standard size of stack is 1 MB, size of double variable is 8 bytes. So it isn't enough space to allocate all array with 140000 elements. You should increase stack size. http://acm.timus.ru/help.aspx?topic=cpp #pragma comment(linker, "/STACK:16777216") Edited by author 22.05.2014 15:07 |
2admins: why tle on test42? | svg2003 | 1915. Titan Ruins: Reconstruction of Bygones | 21 May 2014 20:03 | 2 |
This my results. For this task, time limit is 1.0 second, so why it happend with 0.265 time? 5520909 12:24:55 21 фев 2014 svg2003 1915. Руины титанов: воссоздание былого Visual C# 2010 Time limit exceeded 42 0.265 49 708 КБ Edited by author 21.02.2014 12:30 Edited by author 21.02.2014 12:31 May be 0.265 is time of last succefull test. Looks like test 42 uses geometric progression - coins double many times. So solution should work with unlimited stacks. |
1083 Runtime error (integer division by zero)? SOS | Dior | 1083. Factorials!!! | 21 May 2014 06:52 | 1 |
|
AC with DP | [RISE] Levon Oganesyan [RAU] | 1786. Sandro's Biography | 21 May 2014 01:42 | 1 |
AC with DP [RISE] Levon Oganesyan [RAU] 21 May 2014 01:42 I solve this problem with dp. Cool problem, similar to the Levenshtein,but with some differents. |