답안 #983033

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
983033 2024-05-15T07:13:24 Z vjudge1 이상한 기계 (APIO19_strange_device) C++17
0 / 100
263 ms 35612 KB
#include<bits/stdc++.h>
#define sz size()
#define ll long long
using namespace std;

void out(__int128 a)
{
    string s;
    while(a)
        s += char(a % 10 + '0'),
        a /= 10;
    reverse(s.begin(), s.end());
    cout << s;
}

void solve()
{
    ll n, A, B, i, j, k;
    cin >> n >> A >> B;
    ll l[n + 1], r[n + 1];
    for(i = 1; i <= n; ++i)
        cin >> l[i] >> r[i];

    ll g = __gcd(A, B);
    __int128 x = A, y = B, z = g, x0 = (r[1] - l[1] + 1);
    x = x / z * y;
    if(x0 < x) x = x0;
    out(x);
}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    solve();
}

Compilation message

strange_device.cpp: In function 'void solve()':
strange_device.cpp:18:20: warning: unused variable 'j' [-Wunused-variable]
   18 |     ll n, A, B, i, j, k;
      |                    ^
strange_device.cpp:18:23: warning: unused variable 'k' [-Wunused-variable]
   18 |     ll n, A, B, i, j, k;
      |                       ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 3 ms 860 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 263 ms 35612 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 263 ms 35612 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 263 ms 35612 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 26 ms 4292 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 3 ms 860 KB Output isn't correct
3 Halted 0 ms 0 KB -