D. [COCI 2006/2007 #1] Modulo

    远端评测题 1000ms 32MiB

[COCI 2006/2007 #1] Modulo

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

题目描述

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 will contain 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.

题目大意

给出 1010 个整数,问这些整数除以 4242 后得到的余数有多少种。

  • 第一个样例的十个结果是 1,2,3,4,5,6,7,8,9,101,2,3,4,5,6,7,8,9,10,有 1010 个不同的结果;
  • 第二个样例结果都是 00,只有一个不同的结果;
  • 第三个样例余数是 39,40,41,0,1,2,40,41,0,139,40,41,0,1,2,40,41,0,1,有 0,1,2,39,40,410,1,2,39,40,41 这六个不同的结果。
1
2
3
4
5
6
7
8
9
10
10
42
84
252
420
840
126
42
84
420
126
1
39
40
41
42
43
44
82
83
84
85
6

提示

In the first example, the numbers modulo 42 are 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10. In the second example all numbers modulo 42 are 0. In the third example, the numbers modulo 42 are 39, 40, 41, 0, 1, 2, 40, 41, 0 and 1. There are 6 distinct numbers.

基础提高-2班-day8排序2+结构体

未认领
状态
已结束
题目
6
开始时间
2025-8-13 8:30
截止时间
2025-8-20 23:59
可延期
24 小时