1081
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
 
using namespace std;
 
int main ()
{
    int N;
    int K;
    int a[100];
    int i = 0;
 
    cin >> N >> K;
 
    a[0] = 2;
    a[1] = 3;
    for(i = 2; i < 100; i++)
        a[i] = a[i-1]+a[i-2];
 
    if( a[N-1] < K )
    {
        cout << -1;
        return 0;
    }
 
    i = N-1;
 
    while(1)
    {
        if( i == 0)
        {
            cout << K-1;
            break;
        }
        if(a[i-1] >= K)
        {
            cout << 0;
        }
        else
        {
            cout << 10;
            K -= a[i-1];
            i--;
        }
 
        i--;
 
        if( i < 0 ) 
            break;
    }
 
    return 0;
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.