結果
問題 | No.2008 Super Worker |
ユーザー |
![]() |
提出日時 | 2022-07-15 21:27:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 245 ms / 2,000 ms |
コード長 | 565 bytes |
コンパイル時間 | 4,869 ms |
コンパイル使用メモリ | 254,504 KB |
最終ジャッジ日時 | 2025-01-30 07:27:28 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
#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; }