{"action":"opened","issue":{"url":"https://api.github.com/repos/mahbubcseju/algos/issues/1","labels_url":"https://api.github.com/repos/mahbubcseju/algos/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/mahbubcseju/algos/issues/1/comments","events_url":"https://api.github.com/repos/mahbubcseju/algos/issues/1/events","html_url":"https://github.com/mahbubcseju/algos/issues/1","id":56726834,"number":1,"title":"Al","user":{"login":"mahbubcseju","id":9093289,"avatar_url":"https://avatars.githubusercontent.com/u/9093289?v=3","gravatar_id":"","url":"https://api.github.com/users/mahbubcseju","html_url":"https://github.com/mahbubcseju","followers_url":"https://api.github.com/users/mahbubcseju/followers","following_url":"https://api.github.com/users/mahbubcseju/following{/other_user}","gists_url":"https://api.github.com/users/mahbubcseju/gists{/gist_id}","starred_url":"https://api.github.com/users/mahbubcseju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahbubcseju/subscriptions","organizations_url":"https://api.github.com/users/mahbubcseju/orgs","repos_url":"https://api.github.com/users/mahbubcseju/repos","events_url":"https://api.github.com/users/mahbubcseju/events{/privacy}","received_events_url":"https://api.github.com/users/mahbubcseju/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-05T20:45:05Z","updated_at":"2015-02-05T20:45:05Z","closed_at":null,"body":"/********************************\r\n*MAHBUBCSEJU                    *\r\n*CSE 22                         *\r\n*JAHANGIRNAGAR UNIVERSITY       *\r\n*TIMUS:164273FU                 *\r\n*UVA>>LIGHTOJ>>HUST:mahbubcseju *\r\n********************************/\r\n#include<cfloat>\r\n#include<climits>\r\n#include<fstream>\r\n#include<cstdio>\r\n#include<cstdlib>\r\n#include<cmath>\r\n#include<sstream>\r\n#include<iostream>\r\n#include<algorithm>\r\n#include<map>\r\n#include<cstring>\r\n#include<string>\r\n#include<vector>\r\n#include<queue>\r\n#include<stack>\r\n#include<set>\r\n#define I int\r\n#define LL long long int\r\n#define UL unsigned long long int\r\n#define D double\r\n#define S(a) scanf(\"%d\",&a)\r\n#define S2(a,b) scanf(\"%d%d\",&a,&b)\r\n#define S3(a,b,c) scanf(\"%d%d%d\",&a,&b,&c)\r\n#define SL(a) scanf(\"%lld\",&a)\r\n#define SL2(a,b) scanf(\"%lld%lld\",&a,&b)\r\n#define SL3(a,b,c) scanf(\"%lld%lld%lld\",&a,&b,&c)\r\n#define P(a) printf(\"%d\\n\",a)\r\n#define PL(a) printf(\"%lld\\n\",a)\r\n#define PT(t) printf(\"Case %d: \",t)\r\n#define F(I1,a,b) for(int I1=a;I1<=b;I1++)\r\n#define FR(I2,a,b) for(int I2=a;I2>=b;I2--)\r\n#define FL(J,a,b) for(long long J=a;J<=b;J++)\r\n#define FLR(J1,a,b) for(long long J1=a;J1>=b;J1--)\r\n#define IT(x) for(typeof (x.begin()) it = x.begin(); it != x.end (); it++)\r\n#define ITP(x) for(typeof (x.begin()) it = x.begin(); it != x.end (); it++) {  cout << *it << \" \"; } cout << endl;\r\n#define PB(a) push_back(a)\r\n#define xx first\r\n#define yy second\r\n#define SC scanf\r\n#define PC printf\r\n#define NL printf(\"\\n\")\r\n#define SET(a) memset(a,0,sizeof a)\r\n#define SETR(a) memset(a,-1,sizeof a)\r\n#define SZ(a) ((int)a.size())\r\n#define pi 2.0*acos(0.0)\r\n#define R(a) freopen(a, \"r\", stdin);\r\n#define W(a) freopen(a, \"w\", stdout);\r\n#define CB(x) __builtin_popcount(x)\r\n#define STN(a) stringtonumber<LL>(a)\r\nusing namespace std;\r\ntemplate <class T> inline T BM(T p,T e,T M)\r\n{\r\n    LL ret = 1;\r\n    for(; e > 0; e >>= 1)\r\n    {\r\n        if(e & 1) ret = (ret * p) % M;\r\n        p = (p * p) % M;\r\n    }\r\n    return (T)ret;\r\n}\r\ntemplate <class T> inline T gcd(T a,T b)\r\n{\r\n    if(b==0)return a;\r\n    return gcd(b,a%b);\r\n}\r\ntemplate <class T> inline T MDINV(T a,T M)\r\n{\r\n    return BM(a,M-2,M);\r\n}\r\ntemplate <class T> inline T PW(T p,T e)\r\n{\r\n    LL ret = 1;\r\n    for(; e > 0; e >>= 1)\r\n    {\r\n        if(e & 1) ret = (ret * p);\r\n        p = (p * p);\r\n    }\r\n    return (T)ret;\r\n}\r\ntemplate <class T>string NTS ( T Number )\r\n{\r\n    stringstream ss;\r\n    ss << Number;\r\n    return ss.str();\r\n}\r\ntemplate <class T>T stringtonumber ( const string &Text )\r\n{\r\n    istringstream ss(Text);\r\n    T result;\r\n    return ss >> result ? result : 0;\r\n}\r\ntypedef pair<int ,int >P;\r\n////////define value//////////\r\n#define MX 3000000\r\n#define MD    1000000007LL\r\n#define eps FLT_EPSILON\r\n/////////////////////////////\r\n////////////////////////////\r\n////Function Area Start////\r\nchar a[100005];\r\nstruct da\r\n{\r\n    int x,y,z;\r\n    da()\r\n    {\r\n\r\n    }\r\n    da(int _x,int _y,int _z)\r\n    {\r\n\r\n        x=_x,y=_y,z=_z;\r\n    }\r\n    bool operator<(const da &p)const\r\n    {\r\n        if(x==p.x)\r\n        {\r\n            if(y==p.y)return z<p.z;\r\n            else\r\n                return y<p.y;\r\n        }\r\n        else return x<p.x;\r\n    }\r\n\r\n};\r\nda b[100000+3];\r\nint step[18][100000+2];\r\nint main()\r\n{\r\n\r\n        scanf(\"%s\",a+1);\r\n        int l=strlen(a+1);\r\n\r\n\r\n        for(int i=1; i<=l; i++)\r\n        {\r\n            step[0][i]=a[i]-48;\r\n        }\r\n        int c=1;\r\n        for(int i=1; (1<<i)<=l; i++)\r\n        {\r\n            for(int j=1; j<=l; j++)\r\n            {\r\n                b[j].x= step[i-1][j];\r\n                b[j].y=j+c<=l?step[i-1][j+c]:-1;\r\n                b[j].z=j;\r\n            }\r\n            sort(b+1,b+l+1);\r\n            for(int j=1; j<=l; j++)\r\n            {\r\n                step[i][b[j].z]=j-1>0&&b[j-1].x==b[j].x&&b[j-1].y==b[j].y?step[i][b[j-1].z]:j;\r\n            }\r\n\r\n            c*=2;\r\n        }\r\n        for(int i=1;i<=l;i++){\r\n            P(b[i].z-1);\r\n        }\r\n\r\n    return 0;\r\n}\r\n"}}