結果
| 問題 | No.681 Fractal Gravity Glue | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-04-27 23:56:35 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 800 bytes | 
| コンパイル時間 | 555 ms | 
| コンパイル使用メモリ | 66,316 KB | 
| 実行使用メモリ | 13,880 KB | 
| 最終ジャッジ日時 | 2024-06-27 22:33:03 | 
| 合計ジャッジ時間 | 4,081 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 8 TLE * 1 -- * 11 | 
コンパイルメッセージ
main.cpp:45:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   45 | main()
      | ^~~~
            
            ソースコード
#include<iostream>
using namespace std;
const long long mod=1e9+7;
long long count(int i,int d)
{
	long long ans=0;
	for(long long j=1;j<=i;j++)
	{
		ans=(d+ans*(d+1)%mod)%mod;
	}
	return ans;
}
long long sum(int i,int d)
{
	long long ans=0;
	for(long long j=1;j<=i;j++)
	{
		ans=(j*d%mod+ans*(d+1)%mod)%mod;
	}
	return ans;
}
long long sumcount(int i,int d,int n)
{
    return 0;
	long long s=count(i-1,d),t=sum(i-1,d);
	long long now=0;
	for(;;)
	{
		if(n<s)
		{
			return (now+sumcount(i-1,d,n))%mod;
		}
		else if(n==s)
		{
			return (now+t)%mod;
		}
		else if(n==s+1)
		{
			return (now+t+i)%mod;
		}
		now=(now+t+i)%mod;
		n-=s+1;
	}
}
main()
{
	long long n,b,d;cin>>n>>b>>d;
	for(int i=1;;i++)
	{
		if(count(i,d)>n)
		{
			cout<<(sum(b,d)+mod-sumcount(i,d,n))%mod<<endl;
			return 0;
		}
	}
}
            
            
            
        