Search found 9 matches

by ItaloSpedini
Sun Nov 28, 2010 8:00 pm
Forum: Volume 118 (11800-11899)
Topic: 11876 - N + NOD (N)
Replies: 9
Views: 5945

Re: 11876 - N + NOD(N)

@ItaloSpedini, did u solve the problem uva 294 called divisors? If u didn't then go to steven halim's site and try to find the number of total divisor of an integer that way using prime factorization. It's a bit tricky to do it within time limit but i think u can do it if u give the matter a deep ...
by ItaloSpedini
Wed Nov 24, 2010 2:53 am
Forum: Volume 118 (11800-11899)
Topic: 11889 - Benefit
Replies: 27
Views: 14867

Re: 11889 - Benefit

Here are some testcases, hope they help.

input:
23
2 6
32 1760
7 16
59 44132
218 8066
846 192042
469 28609
676 29068
5 2855
458 115874
77 4081
237 68019
697 14637
74 72298
493 340170
732 104676
355 103305
878 179990
357 111384
157 90275
973 2919
28 6188
429 27456

output:
3
55
NO SOLUTION
748 ...
by ItaloSpedini
Tue Nov 23, 2010 12:57 am
Forum: Volume 118 (11800-11899)
Topic: 11889 - Benefit
Replies: 27
Views: 14867

Re: 11889 - Benefit

Could anyone post some inputs and their outputs? Thanks. I'm getting WA or TLE.
by ItaloSpedini
Wed Nov 17, 2010 1:44 am
Forum: Volume 118 (11800-11899)
Topic: 11876 - N + NOD (N)
Replies: 9
Views: 5945

Re: 11876 - N + NOD(N)

Hi " ItaloSpedini " This is very simple Number Theory Problem I sloved This problem this way :
1=> generate the divisor sequence
2=>from 1to 1000000 set a vector with 0 and 1
3=> cumulative sum of set vector
Then O(1) produce the output.

hope it help you.

I didn't understand. The divisor ...
by ItaloSpedini
Tue Nov 16, 2010 6:06 pm
Forum: Volume 118 (11800-11899)
Topic: 11876 - N + NOD (N)
Replies: 9
Views: 5945

Re: 11876 - N + NOD(N)

The method you described should work. However, you need to pre-process all the answers and give O(1) output for each case.

That was my idea. First generate in a vector all the possible numbers in the sequence (max 1000000), then only use iterators to get the numbers and give the distance. For a ...
by ItaloSpedini
Tue Nov 16, 2010 3:21 am
Forum: Volume 118 (11800-11899)
Topic: 11876 - N + NOD (N)
Replies: 9
Views: 5945

11876 - N + NOD (N)

How to find de number of divisors of a number quickly? In brute force it will time lime. I thought to use sieve of Eratosthenes and then use the primes to determine the number of divisors, but i think it will time limite too.

Thanks.
by ItaloSpedini
Mon Sep 13, 2010 1:15 am
Forum: Volume 118 (11800-11899)
Topic: 11804 - Argentina
Replies: 11
Views: 5967

Re: Can i use system("pause")?

I tested my code with command using a .in file with many examples and it's ok.
How are you sure that you have tried with all types of cases?
I didn't said that i tried with all types of case, but i tried with many different cases (some of them i got on the forum, in the question topic), even with ...
by ItaloSpedini
Sun Sep 12, 2010 1:41 am
Forum: Volume 118 (11800-11899)
Topic: 11804 - Argentina
Replies: 11
Views: 5967

Can i use system("pause")?

I was using system("pause") in my code with the library stdlib.h and i was getting wrong answer on the problem 11677 - Alarm Clock. I was alerted not to use the system("pause"), so i remove it and the library, but i'm still getting wrong answer. All of my outputs is certain. I tested my code with ...
by ItaloSpedini
Sat Sep 11, 2010 1:28 am
Forum: Volume 116 (11600-11699)
Topic: 11677 - Alarm Clock
Replies: 18
Views: 7302

Re: 11677: Alarm Clock

My code is ok for all the inputs above, and i'm getting wrong answer. I'm not using system("pause") in my code but it's not being accepted.

Go to advanced search