Search found 167 matches

by Ivan Golubev
Tue Jan 27, 2004 11:02 am
Forum: Volume 6 (600-699)
Topic: 623 - 500!
Replies: 187
Views: 43174

It won't get TLE, forget about anupam's posts -- he's wrong (btw, never trust posts written in bold (and italic) fonts). Even if you'll declare array as char facts[1001][2600] it will only takes 2.5M of memory. Is this too much? Don't think so. About computation, it's trivial: BigInteger facts[1001]...
by Ivan Golubev
Sun Jan 18, 2004 11:50 pm
Forum: Volume 6 (600-699)
Topic: 623 - 500!
Replies: 187
Views: 43174

Test your code with input:
1
2
3
...
999
1000

And you'll figure out why it gots TLE.
[Something like a hint] While you're computing 1000! you're computing all other factorial values as well... what's the reason to do same calculations several times?..
by Ivan Golubev
Fri Sep 26, 2003 6:31 pm
Forum: Volume 1 (100-199)
Topic: 127 - "Accordian" Patience
Replies: 83
Views: 8988

Of course, gets faster than cin, as well as fread faster than gets. About fread parameters -- you can use stdin (and stdout for fwrite). STL, obviously, very slow for this problem because it contains too much unnecessary code (for this problem especially). Own stack routines + own I/O routines are k...
by Ivan Golubev
Tue Sep 02, 2003 1:24 pm
Forum: Volume 104 (10400-10499)
Topic: 10402 - Triangle Covering
Replies: 37
Views: 5504

Zaheed, the only reason of your accepted result is that you've been enough lucky to make the same mistake as the author of judge's test input/output. Nothing else.
by Ivan Golubev
Sat Aug 09, 2003 4:20 pm
Forum: Volume 102 (10200-10299)
Topic: 10254 - The Priest Mathematician
Replies: 10
Views: 5466

Yeah, bigint is necessary to solve this problem. However my accepted solution for input 9876 produces this answer:

Code: Select all

202100503361683772220167446845875776147947521
by Ivan Golubev
Wed Jul 16, 2003 9:33 am
Forum: General
Topic: SECURITY FLAW IN ONLINE JUDGE
Replies: 34
Views: 8431

Actually it's easy to solve 4-8 problems per day (as I did) and if you have good education (not as mine) you can increase this value twice or more. So it's possible to solve 1200+ problems within 4-6 months not 'few years' :). The question is in free time + motivation.
by Ivan Golubev
Thu Jun 12, 2003 12:08 pm
Forum: C++
Topic: asm
Replies: 2
Views: 1878

It's possible to use assembly but it must be in GAS format, i.e. something like this: __asm__ __volatile__ ( "pushal\n" "movl $tbl, %ebx\n" "movl %ebx, %edx\n" "xorl %eax, %eax\n" ".align 16\n" "__0:\n" "movl %eax, (%edx)\n" "addl $4, %edx\n" "addl $34943, %eax\n" ...
by Ivan Golubev
Thu Jun 12, 2003 12:02 pm
Forum: Volume 1 (100-199)
Topic: 128 - Software CRC
Replies: 62
Views: 7266

Input:

Code: Select all

RFC: 793
#
Your output:

Code: Select all

10A 21
by Ivan Golubev
Thu May 22, 2003 11:37 am
Forum: Other words
Topic: The new leader is coming........
Replies: 6
Views: 4026

Congrats to Anton! :D

Reuber Guerra Duarte was first for a long time a couple of years ago. And AFAIR Shahriar Manzoor was first before him (when I've joined uva.es at Feb 1999). Also Dmitry Lyubshin was first for several monthes.
by Ivan Golubev
Sat Apr 19, 2003 11:18 am
Forum: Volume 7 (700-799)
Topic: 727 - Equation
Replies: 156
Views: 34169

Here this a part from my code:[c]void getexpression(void); void getfact(void) { if (*st == '(') { st++; getexpression(); assert(*st == ')'); st++; if (isdigit(*st)) { printf("%c", *st); st++; } return; } while (isdigit(*st)) { printf("%c", *st); st++; } }[/c] The fix itself here is:[c] if (isdigit(*...
by Ivan Golubev
Mon Feb 24, 2003 12:03 pm
Forum: C++
Topic: How to combine a char & a word ?!?
Replies: 13
Views: 5058

[c]void strchrcat(char *s, char c)
{
while (*s != 0) s++;
*s = c;
*(s + 1) = 0;
}[/c]
by Ivan Golubev
Sat Feb 15, 2003 2:12 pm
Forum: Volume 6 (600-699)
Topic: 631 - Microzoft Calendar
Replies: 11
Views: 6059

Caesum wrote:Can anyone give the output for:
1600-01-01
5000-12-31
Bates-Sun-Second-4-399bd
Bates-Sun-Second-5-3003
by Ivan Golubev
Mon Feb 03, 2003 1:18 pm
Forum: Volume 1 (100-199)
Topic: 114 - Simulation Wizardry
Replies: 80
Views: 7341

Oops, sorry, I was wrong! Yeah, the walls are inside the grid.
by Ivan Golubev
Mon Feb 03, 2003 11:49 am
Forum: Volume 1 (100-199)
Topic: 128 - Software CRC
Replies: 62
Views: 7266

Do not skip blank lines. And there no "\r"'s in unix text files (but it doesn't really matters). Use gets() to read input and everything will be fine.
by Ivan Golubev
Mon Feb 03, 2003 11:45 am
Forum: Volume 1 (100-199)
Topic: 114 - Simulation Wizardry
Replies: 80
Views: 7341

epsilon0 wrote:also i assumed walls were within the grid. ie playground 4x4 means only 2x2 "non-wall" positions.
No, walls are outside the grid, so 4x4 means it's really 4x4 playground.

Go to advanced search