結果

問題 No.1844 Divisors Sum Sum
ユーザー bekzhan29bekzhan29
提出日時 2022-02-21 21:43:29
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 114 ms / 3,000 ms
コード長 1,185 bytes
コンパイル時間 2,061 ms
コンパイル使用メモリ 198,292 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-12 12:54:31
合計ジャッジ時間 7,347 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
4,380 KB
testcase_01 AC 113 ms
4,376 KB
testcase_02 AC 113 ms
4,376 KB
testcase_03 AC 114 ms
4,376 KB
testcase_04 AC 114 ms
4,376 KB
testcase_05 AC 113 ms
4,376 KB
testcase_06 AC 113 ms
4,376 KB
testcase_07 AC 114 ms
4,380 KB
testcase_08 AC 114 ms
4,380 KB
testcase_09 AC 113 ms
4,376 KB
testcase_10 AC 105 ms
4,376 KB
testcase_11 AC 23 ms
4,380 KB
testcase_12 AC 79 ms
4,376 KB
testcase_13 AC 13 ms
4,376 KB
testcase_14 AC 38 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 1 ms
4,500 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 1 ms
4,380 KB
testcase_34 AC 1 ms
4,376 KB
testcase_35 AC 1 ms
4,380 KB
testcase_36 AC 1 ms
4,376 KB
testcase_37 AC 1 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <stack>
#include <chrono>
#include <random>
using namespace std;
#define pb push_back
#define mp make_pair
#define INF ll(1e18)
#define mod 998244353
#define mod2 1000000007
#define eps 1e-9
#define abs(x) ((x)>=0?(x):-(x))
#define y1 solai
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
const ll N=200100;
ll n,a,b,ans=1,x,y;
ll bin(ll a, ll n)
{
	ll ans=1;
	while(n)
	{
		if(n&1)
			ans*=a,ans%=mod2;
		a*=a,a%=mod2;
		n/=2;
	}
	return ans;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin>>n;
	for(ll i=1;i<=n;i++)
	{
		cin>>a>>b;
		x=bin(a,b+2)-a*b+b-2*a+1;
		x=(x%mod2+mod2)%mod2;
		y=(a-1)*(a-1)%mod2;
		ans*=x*bin(y,mod2-2)%mod2;
		ans%=mod2;
	}
	cout<<ans;
}
/*
10
914260891 350096548
887686339 192497607
786328273 878092875
735623069 355760739
129154631 798229587
427094807 82130028
520933789 204087959
641996039 29097051
278883373 321445979
447005677 226153917

*/
0