답안 #933216

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
933216 2024-02-25T09:26:46 Z sleepntsheep 이상한 기계 (APIO19_strange_device) C++17
0 / 100
476 ms 524288 KB
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <cstring>
#include <vector>
#include <algorithm>
#include <deque>
#include <set>
#include <utility>
#include <array>
#include <complex>

using u32 = unsigned;
using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f64 = double;
using f80 = long double;

using namespace std;
using pt = complex<f80>;
#define ALL(x) begin(x), end(x)
#define ShinLena cin.tie(nullptr)->sync_with_stdio(false);
#define N 400005

i64 n, a, b, l[N], r[N];

int main()
{
    ShinLena;
    cin >> n >> a >> b;
    for (int i = 0; i < n; ++i) cin >> l[i] >> r[i];

    vector<pair<i64, i64>> v;
    for (int i = 0; i < n; ++i)
    {
        for (int j = l[i]; j <= r[i]; ++j)
        {
            v.push_back({(j+j/b)%a, j%b});
        }
    }

    sort(ALL(v));
    cout << unique(ALL(v)) - begin(v);

    return 0;
}


# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2396 KB Output is correct
2 Runtime error 476 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Runtime error 421 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Runtime error 469 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2396 KB Output is correct
2 Runtime error 112 ms 13184 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2396 KB Output is correct
2 Runtime error 112 ms 13184 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2396 KB Output is correct
2 Runtime error 112 ms 13184 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Runtime error 471 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2396 KB Output is correct
2 Runtime error 476 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -