結果

問題 No.2008 Super Worker
ユーザー 沙耶花沙耶花
提出日時 2022-07-15 21:27:29
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 565 bytes
コンパイル時間 4,376 ms
コンパイル使用メモリ 261,668 KB
実行使用メモリ 7,196 KB
最終ジャッジ日時 2023-09-10 00:32:50
合計ジャッジ時間 7,416 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 3 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 3 ms
4,376 KB
testcase_19 AC 3 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 3 ms
4,376 KB
testcase_23 AC 112 ms
7,080 KB
testcase_24 AC 111 ms
7,172 KB
testcase_25 AC 108 ms
7,068 KB
testcase_26 AC 109 ms
6,916 KB
testcase_27 AC 111 ms
7,136 KB
testcase_28 AC 146 ms
7,068 KB
testcase_29 AC 148 ms
6,952 KB
testcase_30 AC 148 ms
7,068 KB
testcase_31 AC 149 ms
7,136 KB
testcase_32 AC 149 ms
7,140 KB
testcase_33 AC 135 ms
7,196 KB
testcase_34 AC 148 ms
7,188 KB
testcase_35 AC 96 ms
7,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint1000000007;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001

int main(){
	
	int n;
	cin>>n;
	vector<long long> a(n),b(n);
	vector<int> t(n);
	rep(i,n){
		cin>>a[i];
		t[i] = i;
	}
	rep(i,n)cin>>b[i];
	
	sort(t.begin(),t.end(),[&](int x,int y){
		return a[x]*(b[y]-1)<a[y]*(b[x]-1);
	});
	
	mint x = 1;
	mint ans = 0;
	rep(i,n){
		ans += x * a[t[i]];
		x *= b[t[i]];
	}
	cout<<ans.val()<<endl;
	
    return 0;
}
0