We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #3: Largest prime factor
Project Euler #3: Largest prime factor
Contest ends in
Sort by
recency
|
459 Discussions
|
Please Login in order to post a comment
PHP
Only one testcase didnot get pass.can anyone tell how to reduce time complexity in this code.
`
In C#:
using System;
class Solution { static void Main(String[] args) { int T = Convert.ToInt32(Console.ReadLine()); for (int a0 = 0; a0 < T; a0++) { long n = Convert.ToInt64(Console.ReadLine()); long largestPrimeFactor = LargestPrimeFactor(n); Console.WriteLine(largestPrimeFactor); } }
}