| Show all threads Hide all threads Show all messages Hide all messages |
| How to avoid to use int64 | Vlad | 1029. Ministry | 27 Jan 2013 23:58 | 1 |
The result isn't greater than 1 000 000 000. So everytime you make "element = something" you should do "element = min(something, 1 000 000 000)" , min(a, b) returns a if a < b of b if a > b. |
| Online Javascript PIBAS Interpreter here | DR. Zhihua Lai | 1230. Introspective Program | 27 Jan 2013 22:48 | 1 |
|
| For WA10 | gautamvs | 1629. Trip | 27 Jan 2013 20:23 | 1 |
Try getting next day flight if no flight is available after delay by adding 24*60 to flight timings. |
| WA TEST #10 PLEASE! | hisp | 1629. Trip | 27 Jan 2013 20:22 | 2 |
if no suitable flight available after delay, you can try getting next day flight by adding 24*60 to flight timings. |
| wa #7 | Baurzhan | 1699. Turning Turtles | 27 Jan 2013 18:40 | 3 |
wa #7 Baurzhan 5 Nov 2010 19:40 Who had problems with test #7, tell me WTF? Please,anybody,post here some tricky tests! This test helped me to avoid WA#7: 6 6 ###### #.#.#. #.#.## #..... ###### #.#..# 1 3 6 6 6 ans: 6 Right answer is 5, isn't it? Edited by author 27.01.2013 18:40 |
| test | Radi Muhammad Reza | 1885. Passenger Comfort | 26 Jan 2013 22:31 | 12 |
test Radi Muhammad Reza 30 Oct 2011 09:34 10000 500 50 40 best of luck Re: test IgorKoval(from Pskov) 30 Oct 2011 23:40 What is answer on this test? =) Re: test IgorKoval(from Pskov) 31 Oct 2011 03:34 So....., how get this answer? Explain, please. =) If the plane flies at speed 40, it will reach required height in 250 seconds, i.e. it will do it in time (less, than 500), and there are no time when it exceeded the speed limit (when passengers have their ears blocked). So, mintime = 0. Maxtime is 250, because the plane can fly all the way at speed = 40 + EPS :) Edited by author 31.10.2011 13:02 Re: test IgorKoval(from Pskov) 31 Oct 2011 18:08 Thank you very mutch!!! AC! =) And just for fun tests: Test #1 h == 10000 && t2 == 500 && Vm == 50 && x == 10 Test #2 h == 10000 && t2 == 500 && Vm == 50 && x == 9 Test #3 h == 10000 && t2 == 500 && Vm == 50 && x == 11 Test #4 h == 10000 && t2 == 500 && Vm == 50 && x == 20 Test #5 h == 10000 && t2 == 500 && Vm == 50 && x == 19 Test #6 h == 10000 && t2 == 500 && Vm == 50 && x == 21 ans: 0.000000000000000 476.190476190476200 Re: test Kartik Andalam 9 Apr 2012 04:33 Hey there, Is it possible for you to explain the last one. why is it 476..19....? Thanks Answers for tests IgorKoval(from Pskov) 125.00000 500.000000 134.146341 500.0000000 115.384615 500.0000000 0.000000 500.000000 16.129032 500.000000 0.0000000 476.190476 Edited by author 26.01.2013 22:32 What does the EPS mean? How much it must be? EPS is very small positive number. For example, you may assume EPS = 10^-2011 Thank you very much! But I didn't think that it must be SO small. |
| To Admin | Vladislav Antoshkin | 1915. Titan Ruins: Reconstruction of Bygones | 26 Jan 2013 03:26 | 3 |
To Admin Vladislav Antoshkin 24 Jan 2013 22:48 where the number 8 in the output test? 4 3 8 4 3 8 out: 4 3 8 4 out: 4 3 4 3 is correct? 8 is not on the stack, it is the # of input values. I see. Can you delete it topic? |
| WA 25 | YerzhanU | 1905. Travel in Time | 26 Jan 2013 02:38 | 3 |
WA 25 YerzhanU 14 Oct 2012 00:30 Shoud we minimize k ? I got accepted when I minimized k. Edited by author 14.10.2012 11:07 Seconded. I did not see anywhere to minimise k, and my dfs did not pass but my bfs did. Maybe I screwed up the implementation... Shoud we minimize k ? I got accepted when I minimized k. I used dfs, and got accepted. So I don't think it is necessary to minimize k. |
| Why ? Crash | Crushedsheet | 1264. Workdays | 25 Jan 2013 23:19 | 2 |
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { string[] nums = Console.ReadLine().Split(' '); long n = int.Parse(nums[0]); long m = int.Parse(nums[1]); if (0 <= n && n <= 40000) { if (0 <= m && m <= 40000) { Console.WriteLine(n * (m + 1)); Console.ReadKey(); } } } } } I suggest you to remove "if" statements, because there is no alternative output provided. Also, try to remove Console.ReadKey(); line before posting your code. |
| More than one answer? | lancs | 1356. Something Easier | 25 Jan 2013 18:20 | 1 |
Using Pascal I have got correct answers to samples and tests in the forum. There is more than one solution to some integers e.g. 27 = 19 3 5 and 23 2 2 Are we expected to provide one particular answer. I keep getting WA3 Thanks Please ignore: syntax error was the cause. Edited by author 26.01.2013 19:59 |
| Test #3 Incorrect? | tm_tm_tm | 1315. MDPAR and MIIAR | 25 Jan 2013 16:19 | 4 |
I sended many times and I know test #3. <!-- begin test 3 --> 10 10 2 2 10 #........# #.....#### #...###.## #........# #....###.# #....#.#.# ###.#....# #.##.###.# #........# ########## <!--end test 3 --> The answer for this input is "Can be rescued by himself" But how it could be? The minimum length of the path is 20. Or speleologist can swim between two diagonal blocks? But how? the problem description isn't clear about it. Somebody who has got AC, please, clarify... 0 1 2 3 2 1 0 0 0 0 0 2 3 4 3 2 0 0 0 0 0 3 4 5 0 0 0 11 0 0 0 4 5 6 7 8 9 10 9 0 0 3 4 5 6 0 0 0 8 0 0 2 3 4 5 0 11 0 7 0 0 0 0 3 0 9 10 9 8 0 0 11 0 0 11 0 0 0 7 0 0 11 10 9 10 9 8 7 6 0 0 0 0 0 0 0 0 0 0 0 This is matrix, that represent maximal possible count of air, in this test. Watch, you can go to (3, 5) and we can receive air, and go to the next. Than we can reach (5, 7) and receive air again. Than go to the (8, 8), and receive air here :) And than we go to the top, and *YAHOO* Thank you for test3! I got AC... I just increase D at start, and "rescued by himself" if there remain 2 breaths (not 1) at topmost row. But is so strange... Thanks, its such a nice problem but messed up with extremely confusing statement. |
| AC 708KB | pmartynov | 1220. Stacks | 25 Jan 2013 12:41 | 1 |
Got AC. Used 2 arrays(bool and short for holding N's) + 2 arrays(bool and short) for top stack items and 1 int array for values managing 30 bit value storage instead of 32(B <= 1000000000). How can I improve the algo? Edited by author 25.01.2013 12:42 |
| Hint for C/C++: Be careful of the NEW COMPILER!! | tiancaihb | 1307. Archiver | 24 Jan 2013 22:41 | 9 |
On my dev-c++ (gcc) and on the old Timus compiler, they accept such code: char a[]="xxx...xxx"; (there are up to 200000 'x') But after lots of WA1's I tried to run it on VC2008, it won't compile! It said that sth like "string is to long" (Sorry my VC isn't in English so I can't tell exactly) So to solve this problem now, you have to think of a more complicated way... And it took me much effort to escape that terrible WA1.. Exactly! In MSVC2008 we have the following restrictions on strings in C++: Length of one string unit must not be more than 65535 symbols (with ending \0 it is 65536). If you have greater string, you must devide it into several sub-strings, like I did in my solution: const char* psz[] = { "string one", "string two", ... }; And you cant write in one line more than ~2000 charecters in your source file, you have to put newline after each 2000 chars chunk, or compilation error will occure. Yeah, thx, but eventually I split it into array of char[1000] and it's all right to write the whole array on a single line. I think you are wrong. I've submitted my old solution, which has "unsigned char s[]="..." written in one line, and got AC again. The only thing I have is my own experience with MS C++ 2008 compiler. Maybe in VS C++ 2010 (which is currently used on Timus) they took off that restriction. in vc on timus limit ~16000 symbols Edited by author 29.06.2011 18:52 Another gotcha for C++ programmers: The line terminator in the input is "\r\n", so if you read input byte-by-byte, you will see both chars, but if you try to output "\r\n" via std::cout, you will get "\r\r\n" in the output. My solution was to just ignore \r in the input. * Be careful with percent signs using printf function: printf( "...if(c%3==0)..." ); // wrong!!! but sometimes it works printf( "...if(c%%3==0)..." ); // right * It isn't necessary but if you don't want to take care about CR LF characters, you can use this code: #include <io.h> #include <fcntl.h> _setmode(_fileno(stdin),_O_BINARY); _setmode(_fileno(stdout),_O_BINARY); * Don't use these characters: " ? \ Edited by author 03.11.2010 07:54 |
| Crash!? | Andrey | 1197. Lonesome Knight | 24 Jan 2013 20:41 | 2 |
Why do i get 'Crash' but compile successfully on my machine? The "crash" does not mean the program is not compiling. Check for code that accesses an array outside its bounds or divies by zero. |
| Test 27????? Please!!! | ilya trofimov | 1911. Titan Ruins: Overtaking Fire | 24 Jan 2013 18:52 | 1 |
|
| AC O(2n) | huzujun | 1021. Sacrament of the Sum | 24 Jan 2013 09:49 | 1 |
#include<iostream> #include<cmath> using namespace std; int a1[100000],a2[100000]; int main() { int n1,n2; cin>>n1; for (int i=1; i<=n1; i++) cin>>a1[i]; cin>>n2; for (int i=1; i<=n2; i++) cin>>a2[i]; int i=1,j=1; bool bk=false; while (i<=n1 || j<=n2) { if (a1[i]+a2[j]==10000) { bk=true; break; } if (a1[i]+a2[j]<10000) if (i==n1) break; else i++; else if (j==n2) break; else j++; } if (bk==false) cout<<"NO"<<endl; else cout<<"YES"<<endl; return 0; } |
| Yeah!!! I wrote it! Now, I'm proud of myself | Khlyzov Andrew | 1230. Introspective Program | 23 Jan 2013 23:12 | 3 |
Do you agree this is a very interesting problem? I like writing such problems very much! I've done it! 1230 is among the most interesting problems i've ever solved! Imho, it's one of the best on timus. Cool! Mine is only 143 chars long =) |
| why crash??????? | CacTuSx09 | 1787. Turn for MEGA | 23 Jan 2013 21:54 | 1 |
using System; namespace ConsoleApplication5 { class Program { static void Main(string[] args) { int i,s=0; string[] A = Console.ReadLine().Split(' '); string[] B = Console.ReadLine().Split(' '); int min = int.Parse(A[1]); int car = int.Parse(A[0]); for (i = 0; i < min; i++) {
s = s + int.Parse(B[i]); } int a=s-(min*car); if (a >= 0) Console.WriteLine(a); else Console.WriteLine(0);
} } }
|
| Caution. (What is N?) | S.77 | 1131. Copying | 23 Jan 2013 17:51 | 2 |
The statement of the problem says: "In order to let them do it the program has to be copied to all the N computers". You should know that N is the quantity of all the computers INCLUDING the one which has the program already installed. So the program has to be copied not to N, but to (N-1) computers. I've just got WA because of it. Thanks! I got the same issue. It's quite not obvious from the problem statement. |
| Very easy problem!!!!!! | Enigma [UB of TUIT] | 1644. A Whole Lot of Walnuts | 23 Jan 2013 16:55 | 2 |
i agree you.can it done with 0.015s? i have 0.031
Edited by author 23.01.2013 16:55 Edited by author 23.01.2013 16:55 |