Saratov State University :: Online Contester


::Go
- home
- news
- register
- update personal info
- problemset archive
- submit
- status online
- standing
- contests
- virtual contests
- forum
- statistic
- FAQ
- links
- projects

::Poll
Are you registered on Codeforces?
Yes
No
What is it???

[results]

::webboard

Why WA on Test 11
Author: AlirezaJJ
ID: 045813
Problem: 375
Contest: 0
Date: 2011-12-05 16:42:19

#include<iostream>
using namespace std;
bool a[100000];
int s=0;
int solo (int n)
{
if (n==1)
return 0;
if (n%4==1)
{
a[s]=0;
s++;
return solo((n+1)/2)+1;
}
else
{
a[s]=1;
s++;
return solo((n-1)/2)+1;
}
}
int main()
{
int n;
cin>>n;
if (n%2==0)
{
cout<<"No Solution";
return 0;
}
cout<<solo(n)<<endl;
for (int i=s-1;i>=0;--i)
cout<<a[i]+1<<' ';
}

see sub-tree reply to that message


::Login
Forgot password?

::News
22.10.12 - The problems from the Southern Subregional Programming Contest 2012 added to the problemset archive (542 - 553).
22.10.12 - After the start of the contest the statements in PDF will be available by the link.
23.10.11 - The problems from the Southern Subregional Programming Contest 2011 added to the problemset archive (530 - 541).

::Counter

Server time: 2017-09-21 11:01:56Online Contester Team © 2002 - 2016. All rights reserved.