ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1209. 1, 10, 100, 1000...

Show all messages Hide all messages

#include <iostream>
using namespace std;
int main ()
{
  unsigned int A[65536];
  unsigned short int N,Y;
  cin>>N;
     for (int i=1; i<=N;i++)
     cin>>A[i];
   for (int i=1;i<=N; i++)  {
       int S=0,j=1;
      bool k=true;
 while (k)
    {
      S+=j;
      j++;
     if (A[i]<=S)
      k=false;
     }
      Y=S-A[i];
        if (((j-1)-Y)==1)
            cout<<"1"<<" ";
          else
            cout<<"0"<<" "; }
            return 0;
 }

Edited by author 06.06.2012 18:42
hi mister Hamdam your code has any mistake
it's truely code is mine
so you want to see it?
please phone to me if you have any questions
phone number: +998916378115
Ok!!!
Let's take it!!!

#include <iostream>
#include <math.h>
using namespace std;
int main()
{
long float m,n;
int N;
    cin>>N;
    for  (int i=1; i<=N; i++)
    {
    cin>>m;
    n=(1+sqrt(8*m-7))/2;
 if((1+sqrt(8*m-7))/2==floor((1+sqrt(8*m-7))/2))
   cout<<1<<" ";
    else
    cout<<0<<" ";
     }
    cin>>N;
    return 0;
    }
Kottakon raxmat !

Edited by author 06.06.2012 23:17