|
|
back to boardTest #3, си Не проходит Тест 3. из темы http://acm.timus.ru/forum/thread.aspx?id=40287&upd=636486286708718852 взял условие, на компьютере все в порядке, отсылаю в тимус: Time limit exceeded #include <stdio.h> int mas[99999]; long int i, n; unsigned long int a, cou = 0, s = 0; int main() { scanf("%d", &n); for (i = 0; i < n; i++){ scanf("%u", &a); cou = 0; s = 1; while(s < a){ cou++; s = s + cou; } if (a == s){ mas[i] = 1; } else { mas[i] = 0; } } for (i = 0; i < n; i++){ printf("%d ", mas[i]); } return 0; } Подскажите пожалуйста что не так. Re: Test #3, си your mass[99999] must be 'long long'. Because Ki <= (1 << 31) - 1; Re: Test #3, си Posted by chev 28 Feb 2018 22:45 Study the consistent pattern in a given sequence (1101001000...) and use the quadratic equation. Luck! |
|
|