Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя skpro19

Автор skpro19, история, 7 лет назад, По-английски

Why am I getting WA in this code?

I am dividing 'x' by all the prime numbers. To find the prime numbers, I am using the sieve. I know, it can be done without using the sieve, but when I am using the sieve, I am getting WA. Can someone please help ?

Div 2E: Counting Arrays

My code

It would be really kind if someone could point out the bug.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
7 лет назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится

Use xx instead of x to check for divisors of original x in this part of code:

		for (int i = 1; i * i <= xx; i++) {

			if (xx % i == 0) {

				int a = i, b = xx / i; 

AC solution: 32667979