結果
問題 |
No.2008 Super Worker
|
ユーザー |
|
提出日時 | 2022-07-16 16:33:13 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 69 ms / 2,000 ms |
コード長 | 737 bytes |
コンパイル時間 | 2,482 ms |
コンパイル使用メモリ | 200,504 KB |
最終ジャッジ日時 | 2025-01-30 09:35:20 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; #define all(A) A.begin(),A.end() #define rep(i, n) for (ll i = 0; i < (ll) (n); i++) int main() { cin.tie(nullptr); ios::sync_with_stdio(false); ll N; cin>>N; vector<pair<double,pair<ll,ll>>> T(N); rep(i,N){ cin>>T[i].second.first; } rep(i,N){ cin>>T[i].second.second; T[i].first=double(T[i].second.second-1)/double(T[i].second.first); } sort(all(T)); reverse(all(T)); ll X=1; ll an=0; ll mod=1e9+7; rep(i,N){ an+=X*T[i].second.first; X*=T[i].second.second; an%=mod; X%=mod; } cout<<an<<endl; }