| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1339231 | trungcan | Ravnalo (COCI25_ravnalo) | C++20 | 30 ms | 1216 KiB |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e5 + 5;
int n, a[N], b[N];
ll ans = 0;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n;
for (int i = 1; i <= n; ++i) cin >> a[i];
for (int i = 1; i <= n; ++i) cin >> b[i];
ans = n + 2 + b[1];
for (int i = 2; i <= n; ++i){
ans += b[i];
ll x = a[i - 1] * 1LL * b[i], y = a[i] * 1LL * b[i - 1];
ll tmp = __gcd(x, y);
x /= tmp; y /= tmp;
ans -= min(b[i] / x, b[i - 1] / y);
}
cout << ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
