Codeforces Round #392 (Div. 2), problem: (F) Geometrical Progression Solution in C/C++

By | 2017-04-07T22:10:18+00:00 January 20th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

#include<stdio.h> #include<stdlib.h> #define N 10000001 #define SN 3163 typedef long long unsigned llu; typedef unsigned u; int F(const void*x,const void*y) { if(*(llu*)x>*(llu*)y)return 1; if(*(llu*)y>*(llu*)x)return-1; return 0; } u D[N],Ga[N],Gi[N];llu *G[N]; int main() { u a,b,c,i,j,k,n,x,y,lo,hi,mi;llu e;llu r=0; for(i=0;++i<SN;)for(k=i*i,j=0;(j+=k)<N;)D[j]=i; scanf("%u%u%u",&n,&x,&y); if(n<3) { r=y-x+1; if(n==0)r=1; if(n==2)r=r*(r-1); [...]