//#define _USE_MATH_DEFINES #include #include //#include //#include //#include #include //#include //#include /* #include #include #include #include #include #include #include//assert(); */ #include //ファイル操作 ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)< ///////// //#define mygc(c) (c)=getchar_unlocked() ///////// typedef long long LL; typedef long double LD; typedef unsigned long long ULL; ///////// using namespace::std; ///////// int reader(char c[]){ int i,s=0; for(;;){ //mygc(i); //i = getchar_unlocked(); i = getchar(); if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF) break; }c[s++]=i; for(;;){ //mygc(i); //i = getchar_unlocked(); i = getchar(); if(i==' '||i=='\n'||i=='\r'||i=='\t'||i==EOF) break; c[s++]=i; }c[s]='\0';return s; } ///////// #define ketaMax 9 ULL popcount(ULL b){ b -= (b >> 1) & 0x5555555555555555ULL; b = ((b >> 2) & 0x3333333333333333ULL) + (b & 0x3333333333333333ULL); b = ((b >> 4) + b) & 0x0F0F0F0F0F0F0F0FULL; return (b * 0x0101010101010101ULL) >> 56; } int to_num(ULL* ans, string str){ int len = str.length(); string temp; ULL pow10 = 1; int pos = 0; ans[0] = 0; for(int i= 0;i> 32; //商//num[i] = temp >> divShift; //商 ama = temp & 0xFFFFFFFF;//あまり temp = num[i+1] + ama * 1000000000; num[i+1]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+2] + ama * 1000000000; num[i+2]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+3] + ama * 1000000000; num[i+3]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+4] + ama * 1000000000; num[i+4]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+5] + ama * 1000000000; num[i+5]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+6] + ama * 1000000000; num[i+6]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+7] + ama * 1000000000; num[i+7]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+8] + ama * 1000000000; num[i+8]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+9] + ama * 1000000000; num[i+9]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+10] + ama * 1000000000; num[i+10]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+11] + ama * 1000000000; num[i+11]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+12] + ama * 1000000000; num[i+12]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+13] + ama * 1000000000; num[i+13]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+14] + ama * 1000000000; num[i+14]= temp >> 32; ama = temp & 0xFFFFFFFF; temp = num[i+15] + ama * 1000000000; num[i+15]= temp >> 32; ama = temp & 0xFFFFFFFF; } for( ;i < len;i++){ temp = num[i] + ama * 1000000000; num[i] = temp >> 32; ama = temp & 0xFFFFFFFF; } ans += popcount(ama); //if( num[start] == 0 ){++start;} start += (num[start] == 0); start += (num[start] == 0); start += (num[start] == 0); start += (num[start] == 0); } cout << ans << endl; } }; //string str(1000000,'0'); char str[1000002]; vnum Num; void solve(){ //str.reserve(1000000); reader(str); //cin >> str; Num.set(str); Num.div(); } int main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;// //cout << setprecision(16);// solve(); return 0; }