답안 #622541

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
622541 2022-08-04T11:12:19 Z bigo 이상한 기계 (APIO19_strange_device) C++14
0 / 100
5000 ms 524288 KB
#define _CRT_SECURE_NO_WARNINGS
#include <string>
#include <iostream>
#include <vector>
#include <map>
#include <set>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
const ll mod = 1e9 + 7;
const ll mod1 = 998244353;
#define all(a) a.begin(),a.end()

int main() {
	ios::sync_with_stdio(false);
	int n, a, b;
	cin >> n >> a >> b;
	vector<pii>vec(n);
	for (int i = 0; i < n; i++)
		cin >> vec[i].first >> vec[i].second;
	set<pii>mp;
	int ans = 0;
	for (int i = 0; i < n; i++) {
		for (int j = vec[i].first; j <= vec[i].second; j++) {
			int x = (j + j / b) % a;
			int y = j % b;
			mp.insert({ x,y });
		}
	}
	cout << mp.size() << endl;
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:22:6: warning: unused variable 'ans' [-Wunused-variable]
   22 |  int ans = 0;
      |      ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5109 ms 405228 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 2953 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 Execution timed out 5100 ms 60488 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5089 ms 93264 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5089 ms 93264 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5089 ms 93264 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 1209 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 Execution timed out 5109 ms 405228 KB Time limit exceeded
3 Halted 0 ms 0 KB -