Submission #19677252


Source Code Expand

Copy
#include <iostream>
#include <numeric>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

int main(void) {
  ios::sync_with_stdio(false);
  int64_t N, M;
  cin >> N >> M;
  int64_t answer = M - gcd(N, M);
  cout << answer << endl;
  return 0;
}

Submission Info

Submission Time
Task D - Bus Tour
User ysfk
Language C++ (GCC 9.2.1)
Score 300
Code Size 277 Byte
Status AC
Exec Time 7 ms
Memory 3568 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 28
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_1.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_16.txt, subtask_1_17.txt, subtask_1_18.txt, subtask_1_19.txt, subtask_1_2.txt, subtask_1_20.txt, subtask_1_21.txt, subtask_1_22.txt, subtask_1_23.txt, subtask_1_24.txt, subtask_1_25.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt, subtask_1_8.txt, subtask_1_9.txt
Case Name Status Exec Time Memory
sample_01.txt AC 7 ms 3472 KB
sample_02.txt AC 2 ms 3492 KB
sample_03.txt AC 2 ms 3480 KB
subtask_1_1.txt AC 2 ms 3496 KB
subtask_1_10.txt AC 2 ms 3496 KB
subtask_1_11.txt AC 2 ms 3544 KB
subtask_1_12.txt AC 2 ms 3484 KB
subtask_1_13.txt AC 2 ms 3556 KB
subtask_1_14.txt AC 2 ms 3500 KB
subtask_1_15.txt AC 2 ms 3552 KB
subtask_1_16.txt AC 2 ms 3496 KB
subtask_1_17.txt AC 2 ms 3424 KB
subtask_1_18.txt AC 2 ms 3496 KB
subtask_1_19.txt AC 2 ms 3484 KB
subtask_1_2.txt AC 2 ms 3488 KB
subtask_1_20.txt AC 2 ms 3552 KB
subtask_1_21.txt AC 1 ms 3552 KB
subtask_1_22.txt AC 2 ms 3480 KB
subtask_1_23.txt AC 2 ms 3568 KB
subtask_1_24.txt AC 2 ms 3556 KB
subtask_1_25.txt AC 2 ms 3544 KB
subtask_1_3.txt AC 3 ms 3556 KB
subtask_1_4.txt AC 1 ms 3556 KB
subtask_1_5.txt AC 2 ms 3472 KB
subtask_1_6.txt AC 2 ms 3476 KB
subtask_1_7.txt AC 2 ms 3428 KB
subtask_1_8.txt AC 2 ms 3484 KB
subtask_1_9.txt AC 2 ms 3420 KB