답안 #683247

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
683247 2023-01-18T03:32:44 Z Nursik 이상한 기계 (APIO19_strange_device) C++14
0 / 100
5000 ms 524288 KB
#include <stdio.h>
 
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;
 
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define ld long double
#define bug cout << "bug\n";

const ll maxn = 1e2 + 1, maxm = 2e2 + 1;
const ll mod = 1e9 + 7, inf = 1e9, block = 550, hb = 126067, base = 1000050017,
         biginf = 5e18;
const ld eps = 1e-15;
using namespace std;

ll n, a, b;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cin >> n >> a >> b;
    set<pair<ll, ll>> setik;
    for (int i = 1; i <= n; ++i){
        ll l, r;
        cin >> l >> r;
        for (ll j = r; j >= l; --j){
            ll x = (j + j / b) % a;
            ll y = j % b;
            if (setik.find(mp(x, y)) != setik.end()){
                break;
            }
            setik.insert(mp(x, y));
        }
    }
    int sz = (int)setik.size();
    cout << sz;
}
/*
 */


# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 56 ms 12300 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5063 ms 508716 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 122 ms 30232 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 272 KB Output is correct
2 Correct 584 ms 62896 KB Output is correct
3 Runtime error 2792 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 272 KB Output is correct
2 Correct 584 ms 62896 KB Output is correct
3 Runtime error 2792 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 272 KB Output is correct
2 Correct 584 ms 62896 KB Output is correct
3 Runtime error 2792 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 1801 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 56 ms 12300 KB Output isn't correct
3 Halted 0 ms 0 KB -