結果
問題 |
No.2008 Super Worker
|
ユーザー |
![]() |
提出日時 | 2022-07-15 22:00:02 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 544 bytes |
コンパイル時間 | 3,384 ms |
コンパイル使用メモリ | 258,676 KB |
実行使用メモリ | 9,600 KB |
最終ジャッジ日時 | 2024-06-27 17:51:27 |
合計ジャッジ時間 | 6,442 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 5 WA * 28 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int N; cin>>N; vector<int> A(N),B(N); for(int i=0;i<N;i++){ cin>>A[i]; A[i] = 10000000-A[i]; } for(int i=0;i<N;i++) cin>>B[i]; vector<pair<int,int>> S(N); for(int i=0;i<N;i++) S[i] = {B[i],A[i]}; sort(S.rbegin(),S.rend()); int ans = 0; int now = 1; int mod = 1000000007; for(int i=0;i<N;i++){ ans += now*(10000000-S[i].second); ans %= mod; now *= (S[i].first); now %= mod; } cout<<ans<<endl; }