|
|
back to boardWhy time limit exceeded in test#3 ? Posted by Shadab 26 Apr 2016 00:38 My Code: #include <bits/stdc++.h> using namespace std; int main() { //freopen("in.txt","r", stdin); unsigned long long int n,k,x,j; cin >> n; for(int i=1; i<=n; i++) { cin >> k; x=1; j=0; while(j<k) { j+=x; if(j<k) x++; } x--; if(j-k < x) cout << 0 << " "; else cout << 1 << " "; } cout << endl; return 0; } Edited by author 26.04.2016 00:41 Re: Why time limit exceeded in test#3 ? Re: Why time limit exceeded in test#3 ? Posted by Shadab 26 Apr 2016 10:42 Thanx :) |
|
|