Submission #1031914

# Submission time Handle Problem Language Result Execution time Memory
1031914 2024-07-23T08:40:48 Z Gangsta Strange Device (APIO19_strange_device) C++14
0 / 100
5000 ms 524288 KB
/*
ID: didarco1
TASK: 
LANG: c++17
*/
#include "bits/stdc++.h"
#define ll long long int
#define pb push_back
#define pii pair<ll,ll>
#define ff first
#define ss second
#define sz size()

const int N = 2e5 + 1;

using namespace std;

ll n, a, b;

set <pii> s;

int main(){
    cin >> n >> a >> b;
    for(int i = 1; i <= n; i++){
    	ll x, y;
    	cin >> x >> y;
    	for(int j = x; j <= y; j++){
    		ll san = j + j/b;
    		san %= a;
    		int san1 = j % b;
    		s.insert({san,san1});
    	}
    }
    cout << (int)s.sz;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5107 ms 405112 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 1668 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Execution timed out 5089 ms 60472 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5091 ms 77656 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5091 ms 77656 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5091 ms 77656 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Runtime error 964 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5107 ms 405112 KB Time limit exceeded
3 Halted 0 ms 0 KB -