Submit | All submissions | Best solutions | Back to list |
DIVCNT1 - Counting Divisors |
Let be the number of positive divisors of .
For example, , and .
Let
Given , find .
Input
First line contains (), the number of test cases.
Each of the next lines contains a single integer . ()
Output
For each number , output a single line containing .
Example
Input
5
1
2
3
10
100
Output
1
3
5
27
482
Explanation for Input
-
Information
There are 6 input files.
- Input #1: , TL = 2s.
- Input #2: , TL = 15s.
- Input #3: , TL = 15s.
- Input #4: , TL = 15s.
- Input #5: , TL = 15s.
- Input #6: , TL = 15s.
My C++ solution runs in about 1.3 seconds for each input #2 - #6.
Note
- Probably, solutions will not pass.
- Intended solutions have a running time of about .
- The answer can be .
Added by: | Min_25 |
Date: | 2015-12-30 |
Time limit: | 2s-15s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU JS-MONKEY |
hide comments
2018-03-16 16:15:28
thanks good problem ;\ Last edit: 2018-03-16 19:04:23 |
|
2017-11-09 04:43:17 Min_25
@Blue.Mary Its approach is a little different from mine. So, I'm not sure it helps to prove the complexity ... |
|
2017-11-08 02:31:15 [Rampage] Blue.Mary
Maybe this paper helps? https://arxiv.org/abs/1206.3369. |
|
2017-11-07 23:31:46 Min_25
@dacin21: Thank you. (Although, the original idea comes from the forum of Project Euler 540) Sorry, I don't have a proof (and the above forum doesn't either). The convex full of this hyperbola seems have sloops slopes for each interval , . So, I can only says that my and your approach (probably) has a complexity of . Last edit: 2017-11-07 23:32:14 |
|
2017-11-07 21:16:12
@Min_25 This is a really beautiful problem, thanks a lot for posting it. Do you have a proof/argument why the solution (from submission 20543216) runs in O(n^{~1/3})? |