Data Structures & AlgorithmsHardCAT · Codeforces Div2 B
How many integers x in [1, 200] are divisible by 4 but not by 6?
- A. 35
- B. 36
- C. 38
- D. 34
Correct answer: D. 34
There are 50 multiples of 4 up to 200; the ones also divisible by 6 are the 16 multiples of 12, leaving 34.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- What is the sum of (x^2 mod 13) for x = 1 to 12, taken modulo 13?
- How many ordered pairs (a, b) with 1 <= a, b <= 10 satisfy (a + b) mod 5 = 0?
- What is the modular inverse of 3 modulo 11, that is the x in [0, 10] with 3x ≡ 1 (mod 11)?
- A cellular automaton of 6 cells starts as [1, 0, 0, 0, 0, 0]. In each step every cell becomes the XOR of its two neighbours (cells outside…
- What is the minimum number of swaps of two (not necessarily adjacent) elements needed to sort the permutation [4, 2, 5, 1, 3] (0-based…
- Which quantity gives the minimum number of arbitrary swaps needed to sort a permutation, and why is it correct?