提出 #50338652
ソースコード 拡げる
#include <bits/stdc++.h>
#include <atcoder/modint>
namespace {
using ModInt [[maybe_unused]] = atcoder::modint998244353;
using Num [[maybe_unused]] = long long int;
using Vec [[maybe_unused]] = std::vector<Num>;
using Set [[maybe_unused]] = std::set<Num>;
using Mset [[maybe_unused]] = std::multiset<Num>;
using Edges [[maybe_unused]] = std::vector<std::vector<Num>>;
template<typename T>
using Q [[maybe_unused]] = std::queue<T>;
template<typename T>
using PQ [[maybe_unused]] = std::priority_queue<T, std::vector<T>, std::greater<T>>;
}
void solve(std::istream& is, std::ostream& os) {
Num n {0};
is >> n;
Vec aset(n);
for(auto&& a : aset) {
is >> a;
}
for(Num i{0}; i<(n-1); ++i) {
Num s,t;
is >> s >> t;
Num u = aset.at(i) / s;
aset.at(i+1) += t * u;
}
os << aset.at(n-1) << "\n";
}
int main(void) {
solve(std::cin, std::cout);
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Foreign Exchange |
| ユーザ | zettsut |
| 言語 | C++ 20 (gcc 12.2) |
| 得点 | 150 |
| コード長 | 1013 Byte |
| 結果 | AC |
| 実行時間 | 148 ms |
| メモリ | 4876 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 150 / 150 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example0.txt, example1.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, example0.txt, example1.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 000.txt | AC | 1 ms | 3532 KiB |
| 001.txt | AC | 84 ms | 4752 KiB |
| 002.txt | AC | 50 ms | 4676 KiB |
| 003.txt | AC | 148 ms | 4808 KiB |
| 004.txt | AC | 145 ms | 4812 KiB |
| 005.txt | AC | 84 ms | 4132 KiB |
| 006.txt | AC | 81 ms | 3904 KiB |
| 007.txt | AC | 141 ms | 4736 KiB |
| 008.txt | AC | 139 ms | 4732 KiB |
| 009.txt | AC | 141 ms | 4660 KiB |
| 010.txt | AC | 140 ms | 4876 KiB |
| 011.txt | AC | 125 ms | 4788 KiB |
| 012.txt | AC | 108 ms | 4752 KiB |
| 013.txt | AC | 141 ms | 4656 KiB |
| 014.txt | AC | 126 ms | 4656 KiB |
| 015.txt | AC | 107 ms | 4712 KiB |
| 016.txt | AC | 140 ms | 4648 KiB |
| 017.txt | AC | 124 ms | 4644 KiB |
| 018.txt | AC | 107 ms | 4740 KiB |
| 019.txt | AC | 139 ms | 4692 KiB |
| 020.txt | AC | 119 ms | 4804 KiB |
| 021.txt | AC | 106 ms | 4728 KiB |
| example0.txt | AC | 1 ms | 3476 KiB |
| example1.txt | AC | 1 ms | 3440 KiB |