# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
22688 | PurpleNoon backward compatibility (#40) | Fully Generate (KRIII5_FG) | C++98 | 0 ms | 626896 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
long long int b[80000000];
long long int cnt=1,bb[100000],t=0,j;
long long int asd(long long int i,long long int y){
t=0; cnt=1;
while(y!=0){t++; bb[t]=y%2; y/=2;}
for(j=t;j>=1;j--){
if(bb[j]==1) cnt*=i;
cnt%=1000000007;
if(j!=1) cnt*=cnt;
cnt%=1000000007;
}
return cnt;
}
int main(){
long long int n,i,x,y,t,f=0,cnt=0,count=0;
scanf("%lld",&n);
t=1;
if(n==1){printf("1"); return 0;}
x=1; y=1;
cnt=1;
while(t<=n){
x++;
if(f%2==0) y++;
t+=x*y;
f++;
cnt+=y;
}
t-=(x*y);
cnt-=y;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |