mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-27 13:56:26 +00:00
parent
b3589241ce
commit
6ba378d498
65
LibreOJ/3737/3737.cpp
Normal file
65
LibreOJ/3737/3737.cpp
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
using std::cin;
|
||||||
|
using std::cout;
|
||||||
|
const char endl = '\n';
|
||||||
|
|
||||||
|
const int mod = 1e9 + 7;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
std::ios::sync_with_stdio(false);
|
||||||
|
cin.tie(nullptr);
|
||||||
|
|
||||||
|
int n;
|
||||||
|
long long ans = 1;
|
||||||
|
|
||||||
|
cin >> n;
|
||||||
|
|
||||||
|
std::vector<std::pair<int, int>> data(n);
|
||||||
|
|
||||||
|
for (auto &item : data) {
|
||||||
|
cin >> item.first;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto &item : data) {
|
||||||
|
cin >> item.second;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto &item : data) {
|
||||||
|
if (item.first == 1) {
|
||||||
|
ans = (ans + item.second) % mod;
|
||||||
|
item.first = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long double max = ans;
|
||||||
|
auto max_it = data.end();
|
||||||
|
|
||||||
|
for (auto it = data.begin(); it != data.end(); it++) {
|
||||||
|
if (it->first == -1) continue;
|
||||||
|
|
||||||
|
long double t = static_cast<long double>(ans + it->second) / it->first;
|
||||||
|
|
||||||
|
if (t > max) {
|
||||||
|
max = t;
|
||||||
|
max_it = it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (max_it != data.end()) {
|
||||||
|
ans += max_it->second;
|
||||||
|
max_it->first = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto &item : data) {
|
||||||
|
if (~item.first) {
|
||||||
|
ans = (ans * item.first) % mod;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << ans << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
LibreOJ/3737/data/food1.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food1.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food1.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food10.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food10.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food10.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food11.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food11.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food11.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food11.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food12.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food12.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food12.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food12.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food13.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food13.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food13.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food13.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food14.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food14.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food14.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food14.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food15.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food15.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food15.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food15.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food16.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food16.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food16.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food16.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food17.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food17.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food17.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food17.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food18.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food18.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food18.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food18.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food19.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food19.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food19.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food19.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food2.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food2.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food2.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food20.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food20.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food20.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food20.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food3.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food3.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food3.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food4.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food4.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food4.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food5.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food5.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food5.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food6.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food6.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food6.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food6.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food7.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food7.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food7.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food7.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food8.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food8.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food8.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food8.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food9.ans
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food9.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/3737/data/food9.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/3737/data/food9.in
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user