Highly divisible triangular number】的更多相关文章

Highly divisible triangular number Problem 12 The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36,…
我的那个暴力求解,太耗时间了. 用了网上产的什么因式分解,质因数之类的.确实快!还是数学基础不行,只能知道大约. The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 2…
title: The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of…
最直接的想法就是暴力搞搞,直接枚举,暴力分解因子.再好一点,就打个素数表来分解因子.假设num=p1^a1p2^a2...pn^an,则所有因子个数为(a1+1)(a2+1)...(an+1). 再好一点呢,还是要利用积性函数.假设因子个数函数为f(x),因为num=n(n+1)/2,所以num2=n(n+1),因为n和n+1为相邻的正整数,所以互质,所以f(2num)=f(n)f(n+1), 则f(num)=f(n)f((n+1)/2)(n+1为偶数)或者f(num)=f(n/2)*f(n+1…
PE 中文翻译 最喜欢做这种很有意思的数学题了虽然数学很垃圾 但是这个网站的提交方式好鬼畜啊qwq 1.Multiples of 3 and 5 直接枚举 2.Even Fibonacci numbers 直接枚举 3.Largest prime factor $\sqrt(n)$枚举 #include<cstdio> #include<vector> #include<set> #include<algorithm> #define sit #define…
本题来自 Project Euler 第12题:https://projecteuler.net/problem=12 # Project Euler: Problem 12: Highly divisible triangular number # The sequence of triangle numbers is generated by adding the natural numbers. # So the 7th triangle number would be 1 + 2 + 3…
描述 The nth Triangular number, T(n) = 1 + … + n, is the sum of the first n integers. It is the number of points in a triangular array with n points on side. For example T(4): XX XX X XX X X X Write a program to compute the weighted sum of triangular n…
http://codeforces.com/problemset/problem/47/A Triangular numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A triangular number is the number of dots in an equilateral triangle unifor…
Triangular Sums 时间限制:3000 ms  |  内存限制:65535 KB 难度:2   描述 The nth Triangular number, T(n) = 1 + … + n, is the sum of the first n integers. It is the number of points in a triangular array with n points on side. For example T(4): XX X X X X X X X X Wri…
CF47A Triangular numbers 题意翻译 给定一个数n,问你是否存在一个整数i,满足i*(i+1)/2=n. 若存在,输出"YES",否则输出"NO". 1<=n<=500 Translated by @稀神探女 题目描述 A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example…