답안 #698842

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
698842 2023-02-14T12:43:07 Z Abrar_Al_Samit 이상한 기계 (APIO19_strange_device) C++17
0 / 100
297 ms 15956 KB
#include<bits/stdc++.h>
using namespace std;

void PlayGround() {
  long long n, a, b;
  cin>>n>>a>>b;

  vector<array<long long,2>>iner(n);
  for(int i=0; i<n; ++i) {
    cin>>iner[i][0]>>iner[i][1];
  }

  long long g = __gcd(a, b+1);
  long long interval = (a / __gcd(a, b+1)) * b;
  cout<<min(iner[0][1]-iner[0][0]+1, interval)<<'\n';

  // cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  PlayGround();
  return 0;
}

Compilation message

strange_device.cpp: In function 'void PlayGround()':
strange_device.cpp:13:13: warning: unused variable 'g' [-Wunused-variable]
   13 |   long long g = __gcd(a, b+1);
      |             ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 3 ms 468 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 320 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 297 ms 15956 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 297 ms 15956 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 297 ms 15956 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 31 ms 5584 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 3 ms 468 KB Output isn't correct
3 Halted 0 ms 0 KB -