| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1367092 | serendipitous | 이상한 기계 (APIO19_strange_device) | C++20 | 5094 ms | 456 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
map<pair<ll, ll>, bool> store;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
ll n, a, b; cin >> n >> a >> b;
ll ans = 0;
for(int i = 0; i < n; ++i) {
ll l, r; cin >> l >> r;
for(ll k = 0; k < b; ++k) {
// all congruent to l + k
ll l_eq = l + k;
ll r_eq = b*(r/b) + (l_eq%b); // at least l
if(r_eq > r) {
ans += min((r_eq - l_eq)/b, a);
} else {
ans += min((r_eq - l_eq)/b + 1, a);
}
}
}
cout << ans;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
