답안 #729588

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
729588 2023-04-24T09:24:13 Z danikoynov 이상한 기계 (APIO19_strange_device) C++14
0 / 100
1337 ms 524288 KB
#include<bits/stdc++.h>
#define endl '\n'

using namespace std;
typedef long long ll;

void speed()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

const int maxn = 1e6 + 10;

int n;
ll l[maxn], r[maxn];
ll A, B;


void solve()
{
    cin >> n >> A >> B;
    for (int i = 1; i <= n; i ++)
    {
        cin >> l[i] >> r[i];
    }

    unordered_set < ll > st;
    for (int i = 1; i <= n; i ++)
    {

        for (ll j = l[i]; j <= r[i]; j ++)
        {
            ll x = (j + (j / B)) % A, y = j % B;
            ///cout << x << " " << y << endl;
            st.insert({j % (A + B)});
        }
    }

    cout << st.size() << endl;
}

int main()
{
    solve();
    return 0;
}
/**
7 3
4 1 3 4 0 2 3
*/

Compilation message

strange_device.cpp: In function 'void solve()':
strange_device.cpp:35:16: warning: unused variable 'x' [-Wunused-variable]
   35 |             ll x = (j + (j / B)) % A, y = j % B;
      |                ^
strange_device.cpp:35:39: warning: unused variable 'y' [-Wunused-variable]
   35 |             ll x = (j + (j / B)) % A, y = j % B;
      |                                       ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 16 ms 632 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Runtime error 591 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 13 ms 852 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1337 ms 58692 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1337 ms 58692 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1337 ms 58692 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 560 ms 11120 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 16 ms 632 KB Output isn't correct
3 Halted 0 ms 0 KB -