|
|
back to boardTime Limit Exceeded C Posted by Shaft 9 Apr 2015 22:46 #include <cstdio> int main() { unsigned N, i, discharge, count; unsigned long *array; scanf("%u", &N); array = new unsigned long [N]; for(i = 0; i < N; i++) scanf("%lu", &array[i]); for(i = 0; i < N; i++) { discharge = 1; for(count = 0; discharge <= array[i]; count++) discharge += count; discharge--, count--; if(discharge - (count - 1) == array[i]) printf("%d%c", 1, ' '); else printf("%d%c", 0, ' '); }
return 0; } Can smb help me? |
|
|