Submission #50351524
Source Code Expand
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int main(){
ll n;
cin >> n;
vector<ll> as;
for (ll i = 0; i < n; i++){
ll a;
cin >> a;
as.push_back(a);
}
for (ll i = 0; i < n - 1; i++){
ll s, t;
cin >> s >> t;
ll times = (as[i] - (as[i] % s)) / s;
as[i+1] += times * t;
}
cout << as[n-1] << "\n";
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Foreign Exchange |
| User | ThousandthStar |
| Language | C++ 20 (gcc 12.2) |
| Score | 150 |
| Code Size | 416 Byte |
| Status | AC |
| Exec Time | 151 ms |
| Memory | 5352 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 150 / 150 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| 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 |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 1 ms | 3432 KiB |
| 001.txt | AC | 84 ms | 5152 KiB |
| 002.txt | AC | 50 ms | 5116 KiB |
| 003.txt | AC | 151 ms | 5232 KiB |
| 004.txt | AC | 145 ms | 5352 KiB |
| 005.txt | AC | 85 ms | 4196 KiB |
| 006.txt | AC | 80 ms | 4152 KiB |
| 007.txt | AC | 141 ms | 5212 KiB |
| 008.txt | AC | 141 ms | 5196 KiB |
| 009.txt | AC | 141 ms | 5208 KiB |
| 010.txt | AC | 141 ms | 5264 KiB |
| 011.txt | AC | 125 ms | 5136 KiB |
| 012.txt | AC | 107 ms | 5216 KiB |
| 013.txt | AC | 140 ms | 5152 KiB |
| 014.txt | AC | 124 ms | 5136 KiB |
| 015.txt | AC | 108 ms | 5188 KiB |
| 016.txt | AC | 141 ms | 5232 KiB |
| 017.txt | AC | 125 ms | 5208 KiB |
| 018.txt | AC | 107 ms | 5192 KiB |
| 019.txt | AC | 139 ms | 5144 KiB |
| 020.txt | AC | 120 ms | 5196 KiB |
| 021.txt | AC | 109 ms | 5152 KiB |
| example0.txt | AC | 1 ms | 3432 KiB |
| example1.txt | AC | 1 ms | 3464 KiB |