Modulo
의견: 0
Given two integers \(A\) and \(B\), \(A\) modulo \(B\) is the remainder when dividing \(A\) by \(B\). For example, the numbers \(7\), \(14\), \(27\) and \(38\) become \(1\), \(2\), \(0\) and \(2\), modulo \(3\).
Write a program that accepts \(10\) numbers as input and outputs the number of distinct numbers in the input, if the numbers are considered modulo \(42\).
The input contains \(10\) non-negative integers, each smaller than \(1000\), one per line.
Output the number of distinct values when considered modulo \(42\) on a single line.
| 서브태스크 | 점수 | 설명 |
|---|---|---|
Subtask 1 | 10점 |
1
2
3
4
5
6
7
8
9
1010The numbers modulo 42 are 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10 — all 10 are distinct.
42
84
252
420
840
126
42
84
420
1261All numbers modulo 42 are 0, so there is 1 distinct value.
39
40
41
42
43
44
82
83
84
856Modulo 42 the numbers are 39, 40, 41, 0, 1, 2, 40, 41, 0, 1, giving the 6 distinct values {0, 1, 2, 39, 40, 41}.
평가 및 의견
Modulo
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Modulo