結果
問題 |
No.2008 Super Worker
|
ユーザー |
|
提出日時 | 2022-07-15 22:37:25 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 476 bytes |
コンパイル時間 | 2,107 ms |
コンパイル使用メモリ | 199,588 KB |
最終ジャッジ日時 | 2025-01-30 08:25:54 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 RE * 3 TLE * 2 |
ソースコード
#include<bits/stdc++.h> using namespace std; const int mod=1e9+7; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin>>N; vector<array<long long,2>>A(N); for(auto &i:A)cin>>i[0]; for(auto &i:A)cin>>i[1]; sort(A.begin(),A.end(),[](array<long long,2>a,array<long long,2>b){ return a[0]+a[1]*b[0]>=b[0]+b[1]*a[0]; }); long long ans=0,x=1; for(int i=0;i<N;i++){ ans=(ans+x*A[i][0])%mod; x=x*A[i][1]%mod; } cout<<ans<<'\n'; }