标签:
Description
Input
Output
Sample Input
3 2 10 20
Sample Output
1 8 22
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <queue> #include <vector> #include <iomanip> #include <math.h> using namespace std; #define FIN freopen("input.txt","r",stdin); #define INF 0x3f3f3f3f #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 typedef long long LL; LL p[500005]; int main() { //FIN for(int i=2;i<=500000;i++) for(int j=i;j<=500000;j+=i) p[j]+=i; LL n,t; scanf("%lld",&t); while(t--) { scanf("%lld",&n); printf("%lld\n",p[n]-n+1); } }
标签:
原文地址:http://www.cnblogs.com/Hyouka/p/5721550.html