예제 #1
0
        public override void Solve(IOManager io)
        {
            var  n     = io.ReadInt();
            long count = 0;

            var eratos = new Eratosthenes(n);

            for (int c = 1; c < n; c++)
            {
                var remain = n - c;
                var divs   = eratos.GetDivisiors(remain);
                count += divs.Count();
            }

            io.WriteLine(count);
        }
예제 #2
0
 public void GetDivisiorsTest(int n, params int[] divisiors)
 {
     Assert.Equal(divisiors, _eratosthenes.GetDivisiors(n).OrderBy(i => i));
 }