結果

問題 No.2008 Super Worker
ユーザー okkuukenkenokkuukenken
提出日時 2022-07-15 21:28:58
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 629 bytes
コンパイル時間 1,338 ms
コンパイル使用メモリ 126,188 KB
実行使用メモリ 6,636 KB
最終ジャッジ日時 2023-09-10 00:36:10
合計ジャッジ時間 4,665 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,384 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,388 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,384 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,384 KB
testcase_18 AC 3 ms
4,384 KB
testcase_19 AC 2 ms
4,384 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,384 KB
testcase_23 AC 103 ms
6,464 KB
testcase_24 AC 104 ms
6,472 KB
testcase_25 AC 103 ms
6,424 KB
testcase_26 AC 104 ms
6,468 KB
testcase_27 AC 104 ms
6,596 KB
testcase_28 AC 141 ms
6,424 KB
testcase_29 AC 142 ms
6,476 KB
testcase_30 AC 141 ms
6,636 KB
testcase_31 AC 141 ms
6,572 KB
testcase_32 AC 141 ms
6,536 KB
testcase_33 AC 136 ms
6,476 KB
testcase_34 AC 143 ms
6,424 KB
testcase_35 AC 94 ms
6,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<iomanip>
#include<numeric>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
int dx[]={1,0,0,-1},dy[]={0,1,-1,0};
struct st{
	ll a,b;
};
bool operator<(st a,st b){
	return a.a+b.a*a.b>b.a+a.a*b.b;
}
int main(){
	int n;
	static st ab[200000];
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>ab[i].a;
	for(int i=0;i<n;i++)
		cin>>ab[i].b;
	sort(ab,ab+n);
	ll ans=0,tmp=1;
	for(int i=0;i<n;i++){
		ans=(ans+ab[i].a*tmp)%mod;
		tmp=tmp*ab[i].b%mod;
	}
	cout<<ans<<endl;
}
0