답안 #781474

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
781474 2023-07-13T06:50:03 Z devariaota 이상한 기계 (APIO19_strange_device) C++17
0 / 100
5000 ms 524288 KB
#include <bits/stdc++.h>
using namespace std;

#define int long long

// int gcd(int a, int b) {
//   if (b == 0) return a;
//   return gcd(b, a%b);
// }

// int lcm(int a, int b) {
//   return (a*b)/gcd(a, b);
// }

// int unique[100005];
set<int> unik;

signed main() {
  int n, a, b, l, r, kpk;
  cin >> n >> a >> b;
  // kpk = lcm(a, b);
  // cout << kpk << endl;
  for (int i = 0; i < n; i++) {
    cin >> l >> r;
    for (int j = l; j <= r; j++) unik.insert(j%(a*b));
  }
  cout << unik.size() << endl;
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:19:22: warning: unused variable 'kpk' [-Wunused-variable]
   19 |   int n, a, b, l, r, kpk;
      |                      ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 35 ms 9400 KB Output is correct
3 Correct 50 ms 13560 KB Output is correct
4 Incorrect 2 ms 852 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 3422 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 Correct 74 ms 24216 KB Output is correct
3 Correct 76 ms 24084 KB Output is correct
4 Correct 83 ms 22968 KB Output is correct
5 Execution timed out 5066 ms 46924 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1167 ms 47292 KB Output is correct
3 Runtime error 1753 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 Correct 1167 ms 47292 KB Output is correct
3 Runtime error 1753 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 Correct 1167 ms 47292 KB Output is correct
3 Runtime error 1753 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Runtime error 1668 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 35 ms 9400 KB Output is correct
3 Correct 50 ms 13560 KB Output is correct
4 Incorrect 2 ms 852 KB Output isn't correct
5 Halted 0 ms 0 KB -