QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#873677#4920. 挑战分解质因数JohnAlfnov35 687ms4096kbC++148.1kb2025-01-26 19:58:492025-01-26 19:58:50

Judging History

你现在查看的是最新测评结果

  • [2025-01-26 19:58:50]
  • 评测
  • 测评结果:35
  • 用时:687ms
  • 内存:4096kb
  • [2025-01-26 19:58:49]
  • 提交

answer

#ifndef __x86_64__
#error Only x86-64 targets are supported
#endif
#include<cstdint>
#include<vector>
#include<string>
#include<iosfwd>
#define __builtin_ia32_adc(x,y,flag) __asm__("addb   %3, %0\n\t" "adcq   %2, %1\n\t" "setc   %0":"+r"(flag),"+r"(x):"r"(y),"i"(-1):"cc")
#include<bits/stdc++.h>
struct bigint{// made by dengyaotriangle!
    typedef unsigned long long u64;
    typedef unsigned __int128 u128;
    typedef std::size_t st;
    std::vector<u64> data;
    bigint(){}
    bigint(u64 x):data(x?std::vector<u64>{x}:std::vector<u64>{}){}
    bigint(const std::string &s){
        st pos=s.length();
        int cnt=0;
        u64 val=0;
        while(pos){
            pos--;
            if(cnt==64){
                data.push_back(val);
                val=0;cnt=0;
            }
            val|=(u64)(s[pos]=='1')<<cnt;
            ++cnt;
        }
        if(cnt&&val)data.push_back(val);
    }
    explicit operator std::string()const{
        if(data.empty())return "0";
        bool t=0;
        std::string ret;
        for(int i=63;i>=0;i--){
            t|=(data.back()>>i)&1;
            if(t)ret+='0'|((data.back()>>i)&1);
        }
        st i=data.size()-1;
        while(i){
            i--;
            for(int j=63;j>=0;j--)ret+='0'|((data[i]>>j)&1);
        }
        return ret;
    }
    explicit operator bool()const{return !data.empty();}
    explicit operator u64()const{return data.empty()?0:data[0];}
    st digit()const{
        if(data.empty())return 0;
        return (data.size()<<6)-__builtin_clzll(data.back());
    }
    bool operator==(const bigint &a)const{return a.data==data;}
    bool operator!=(const bigint &a)const{return a.data!=data;}
    bool operator<(const bigint &a)const{
        if(data.size()!=a.data.size())return data.size()<a.data.size();
        for(st i=data.size();i;){
            i--;
            if(data[i]!=a.data[i])return data[i]<a.data[i];
        }
        return 0;
    }
    bool operator>(const bigint &a)const{return a<(*this);}
    bool operator<=(const bigint &a)const{return !(*this>a);}
    bool operator>=(const bigint &a)const{return !(*this<a);}
    bigint &operator<<=(st n){
        if(data.empty())return *this;
        int w=n&63;st z=n>>6;
        st i=data.size();
        bool flg=0;
        if(w&&(data.back()>>(64-w)))data.push_back(0),flg=1;
        data.resize(data.size()+z);
        while(i){
            i--;
            if(flg)data[i+z+1]|=data[i]>>(64-w);
            data[i+z]=data[i]<<w;
            flg|=bool(w);
        }
        for(st i=0;i<z;i++)data[i]=0;
        return *this;
    }
    bigint &operator>>=(st n){
        int w=n&63;st z=n>>6,i=0;
        for(;i+z<data.size();i++){
            if(w&&i)data[i-1]|=data[i+z]<<(64-w);
            data[i]=data[i+z]>>w;
        }
        while(data.size()>i)data.pop_back();
        while(!data.empty()&&data.back()==0)data.pop_back();
        return *this;
    }
    bigint operator<<(st n)const{return bigint(*this)<<=n;}
    bigint operator>>(st n)const{return bigint(*this)>>=n;}
    bigint &operator+=(const bigint &a){
        data.resize(std::max(data.size(),a.data.size()));
        bool carry=0;
        for(st i=0;i<data.size();i++){
            u64 rg=0;
            if(i<a.data.size())rg=a.data[i];
            __builtin_ia32_adc(data[i],rg,carry);
        }
        if(carry)data.push_back(1);
        return *this;
    }
    bigint &operator-=(const bigint &a){
        bool carry=1;
        for(st i=0;i<data.size();i++){
            u64 rg=-1;
            if(i<a.data.size())rg=~a.data[i];
            __builtin_ia32_adc(data[i],rg,carry);
        }
        while(!data.empty()&&data.back()==0)data.pop_back();
        return *this;
    }
    bigint &operator++(){return *this+=bigint(1);}
    bigint &operator--(){return *this-=bigint(1);}
    bigint operator++(int){bigint tmp=*this;++*this;return tmp;}
    bigint operator--(int){bigint tmp=*this;--*this;return tmp;}
    bigint &operator*=(const bigint &a){
        std::vector<u64> ret(data.size()+a.data.size());
        for(st i=0;i<data.size();i++){
            u64 carry=0;bool wcarry=0;
            st k=i;
            for(st j=0;j<a.data.size();j++,k++){
                u128 r=data[i]*(u128)a.data[j]+carry;
                u64 cur=r;
                carry=r>>64;
                __builtin_ia32_adc(ret[k],cur,wcarry);
            }
            while(carry||wcarry){
                __builtin_ia32_adc(ret[k],carry,wcarry);
                carry=0;k++;
            }
        }
        while(!ret.empty()&&ret.back()==0)ret.pop_back();
        data=ret;
        return *this;
    }
    bigint &operator/=(const bigint &a){
        if(a.digit()>digit()){
            data.clear();
            return *this;
        }
        st z=digit()-a.digit();
        std::vector<u64> ret;
        while(1){
            bigint tmp=a<<z;
            if(tmp<=*this){
                *this-=tmp;
                st v1=z>>6;
                if(ret.size()<=v1)ret.resize(v1+1);
                ret[v1]|=(u64)(1)<<(z&63);
            }
            if(!z)break;
            z--;
        }
        data=ret;
        return *this;
    }
    bigint &operator%=(const bigint &a){
        if(a.digit()>digit())return *this;
        st z=digit()-a.digit();
        while(1){
            bigint tmp=a<<z;
            if(tmp<=*this)*this-=tmp;
            if(!z)break;
            z--;
        }
        return *this;
    }
    bigint operator+(const bigint &a)const{return bigint(*this)+=a;}
    bigint operator-(const bigint &a)const{return bigint(*this)-=a;}
    bigint operator*(const bigint &a)const{return bigint(*this)*=a;}
    bigint operator/(const bigint &a)const{return bigint(*this)/=a;}
    bigint operator%(const bigint &a)const{return bigint(*this)%=a;}
    inline int get(int x){
    	return data[x/64]>>(x%64)&1;
	}
	inline void jia(int x){
		data[x/64]|=1ull<<(x%64);
	}
	inline void shan(int x){
		if(data[x/64]>>(x%64)&1)data[x/64]^=1ull<<(x%64);
	}
};
std::istream &operator>>(std::istream &st,bigint &a){
    std::string s;st>>s;a=bigint(s);return st;
}
std::ostream &operator<<(std::ostream &st,const bigint &a){
    return st<<(std::string)(a);
}
using namespace std;
bigint n,e;
int s=0;
int ss[100005],dd[100005],tot=0;
void print(){
	ss[1]=1;
	for(int i=2;i<=32768;++i){
		if(!ss[i])dd[++tot]=i;
		for(int j=1;j<=tot&&i*dd[j]<=32768;++j){
			ss[i*dd[j]]=1;
			if(i%dd[j]==0)break;
		}
	}
}
vector<bigint>vc;
mt19937 mt(13770618);
bigint powdv(bigint a,bigint b,bigint c){
	int m=b.digit();
	bigint ans=1;
	for(int i=0;i<m;++i){
		int z=b.get(i);
		if(z)ans=ans*a%c;
		a=a*a%c;
	}
	return ans;
}
bigint gcd(bigint a,bigint b){
	while(a&&b){
		while(a%2==0)a/=2;
		while(b%2==0)b/=2;
		if(a<b)swap(a,b);
		a-=b;
	}
	return a+b;
}
bigint jian(int k){
	bigint b;
	b.data.resize((k+63)/64);
	if(k)b.data.back()|=1ll<<((k+63)%64);
	return b;
}
bigint powd(bigint a,int b){
	bigint ans=1;
	while(b){
		if(b&1)ans=ans*a;
		b>>=1,a=a*a;
	}
	return ans;
}
void dfs(bigint b){
	if(b==1)return;
	int T=30;
	while(T--){
		int m=b.digit();
		bigint x=b;
		for(int i=0;i<m;++i){
			x.shan(i);
			if(mt()%2)x.jia(i);
		}
		while(x.data.size()&&x.data.back()==0)x.data.pop_back();
		bigint a=gcd(x,b);
		if(a==b)continue;
		if(a>1){
			dfs(a);dfs(b/a);
			return;
		}
		bigint c=powdv(x,e,b);
		for(int i=0;i<=s;++i){
			if(c==0)break;
			bigint a=gcd(c-1,b);
			if(a<b&&a>1){
				dfs(a);dfs(b/a);
				return;
			}
			c=c*c%b;
		}
	}
	int m=b.digit();
	for(int k=100;k>=2;--k){
		bigint L=1,R=jian(m*log(2)/log(k)+2);
		while(L<=R){
			bigint mid=(L+R)>>1;
			bigint bb=powd(mid,k);
			if(bb>b)R=mid-1;
			else L=mid+1;
		}
		if(powd(R,k)==b){
			while(k--)vc.emplace_back(R);
			return;
		}
	}
	vc.emplace_back(b);
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	print();
	cin>>n>>e;
	while(e%2==0)e/=2,++s;
	for(int i=1;i<=tot;++i){
		int p=dd[i];
		while(n%p==0)n/=p,vc.emplace_back(p);
	}
	dfs(n);
	sort(vc.begin(),vc.end());
	cout<<(signed)vc.size()<<'\n';
	for(auto cu:vc)cout<<cu<<'\n';
	return 0;
}

詳細信息

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

1 1

output:

0

result:

ok "0"

Test #2:

score: 5
Accepted
time: 8ms
memory: 3968kb

input:

1000001010000010011000000000001 1000001010000000000000000000000

output:

2
100100000000001
1110100000000001

result:

ok 3 tokens

Test #3:

score: 5
Accepted
time: 5ms
memory: 3968kb

input:

100011100111101010100110101011 100011100111011001010101000000

output:

2
10011001001011
1110111000100001

result:

ok 3 tokens

Test #4:

score: 5
Accepted
time: 7ms
memory: 3840kb

input:

10001001101010010000101100001111 10001001101001111001001011011000

output:

2
1011000000011011
1100100000011101

result:

ok 3 tokens

Test #5:

score: 5
Accepted
time: 1ms
memory: 3712kb

input:

11010101110001001000101110100011 10001110011111110101111001100000

output:

4
11
11
100100101110011
101001011001001

result:

ok 5 tokens

Test #6:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

11110110100011100110011001 11110100100110011000000000

output:

3
100010101
101100001
1010010101

result:

ok 4 tokens

Test #7:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

11111101101000100101001011110000 1111110001100110011100011000000

output:

7
10
10
10
10
110111011
1010010011
1110001111

result:

ok 8 tokens

Test #8:

score: 5
Accepted
time: 1ms
memory: 3712kb

input:

10000000000000000000000000000000 1000000000000000000000000000000

output:

31
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10

result:

ok 32 tokens

Test #9:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

10100000001100011011100000000000 100010110011100000000000000000

output:

17
10
10
10
10
10
10
10
10
10
10
10
11
111
1011
1101
10011
10111

result:

ok 18 tokens

Test #10:

score: 5
Accepted
time: 59ms
memory: 3840kb

input:

10100010000000000000000000000001 10100010000000000000000000000000

output:

1
10100010000000000000000000000001

result:

ok 2 tokens

Test #11:

score: 5
Accepted
time: 2ms
memory: 3968kb

input:

11011011011011001101111101010000 101101100110000011101000000000

output:

9
10
10
10
10
11
101
111
1011
110000101000100111

result:

ok 10 tokens

Test #12:

score: 5
Accepted
time: 2ms
memory: 3840kb

input:

110000101111111000100000001 110000101111100100110000010

output:

2
10011101111111
10011101111111

result:

ok 3 tokens

Test #13:

score: 5
Accepted
time: 1ms
memory: 3840kb

input:

110011010101010011110001 100000011111011111100000

output:

8
101
101
101
111
111
1101
1101
1101

result:

ok 9 tokens

Test #14:

score: 5
Accepted
time: 1ms
memory: 3840kb

input:

100001110101100001111101110111 100000100101110000010111000000

output:

4
11101
11101
1011111001
1101110111

result:

ok 5 tokens

Test #15:

score: 5
Accepted
time: 3ms
memory: 4096kb

input:

110111000001001110000000001111 110100101000000111101101001100

output:

3
10111
10111
110101010000000011111

result:

ok 4 tokens

Subtask #2:

score: 15
Accepted

Dependency #1:

100%
Accepted

Test #16:

score: 15
Accepted
time: 129ms
memory: 3968kb

input:

10100111000100000000000000000011100100000000000000000000000001 10100111000100000000000000000000000000000000000000000000000000

output:

2
1000010000000000000000000000001
10100010000000000000000000000001

result:

ok 3 tokens

Test #17:

score: 15
Accepted
time: 24ms
memory: 3968kb

input:

1000010000111101001111000011011101001000011011101010000010110001 1000010000111101001111000011010111010111011001001101011101100100

output:

2
10101010100101101001100101011111
11000110011100110010111111101111

result:

ok 3 tokens

Test #18:

score: 15
Accepted
time: 24ms
memory: 3968kb

input:

1001011100010111001100011001111111010011001111110111011010111001 1001011100010111001100011001111001000110010111101110000111110100

output:

2
10101100000000010111100000001111
11100000110111110001110010110111

result:

ok 3 tokens

Test #19:

score: 15
Accepted
time: 28ms
memory: 3968kb

input:

1100100001100010110111100100101001111000010010100011110010110000 110010000110001011011110010000000010001001010011111110000000000

output:

6
10
10
10
10
10110011011100000011110001011
10001110111100010101110011000001

result:

ok 7 tokens

Test #20:

score: 15
Accepted
time: 20ms
memory: 3840kb

input:

1010101001010100010010001101000111000100010110010111111001100000 101010100101010000011000100110001101001011001011011000000000000

output:

8
10
10
10
10
10
10001010110010000101
10010001100100110111
100010100010000100001

result:

ok 9 tokens

Test #21:

score: 15
Accepted
time: 48ms
memory: 3968kb

input:

1011000100010101011000101010110000001001011100000000000001 1011000100010101000000000000000000000000000000000000000000

output:

3
100100000000000001
100010100000000000001
100100100000000000001

result:

ok 4 tokens

Test #22:

score: 15
Accepted
time: 53ms
memory: 3968kb

input:

101110011111000001101010111000000000111001000000000000001 101110011111000000000000000000000000000000000000000000000

output:

3
101000000000000001
10001000000000000001
100011000000000000001

result:

ok 4 tokens

Test #23:

score: 15
Accepted
time: 0ms
memory: 3712kb

input:

1000000000000000000000000000000000000000000000000000000000000000 100000000000000000000000000000000000000000000000000000000000000

output:

63
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10

result:

ok 64 tokens

Test #24:

score: 15
Accepted
time: 26ms
memory: 3968kb

input:

11110011110101111001001011010001111000011100110110000000001 11110011110101111001001011001100010111000111010001000000010

output:

2
101100001010101100100111111111
101100001010101100100111111111

result:

ok 3 tokens

Test #25:

score: 15
Accepted
time: 13ms
memory: 3968kb

input:

100001011001100001110000001100100000000110000000110001 11010001011110111111001000110100010000000000000000000

output:

10
111
111
111
10011
10011
10011
11101
11101
11101
101000000000000001

result:

ok 11 tokens

Test #26:

score: 15
Accepted
time: 17ms
memory: 3968kb

input:

110101111011111001001010000111000010010000101101100011010111 110101111011010011000110101000011001001010110111110000000000

output:

4
10010001111111
1001011010011101
1010010111011101
1111100000100001

result:

ok 5 tokens

Test #27:

score: 15
Accepted
time: 0ms
memory: 3840kb

input:

1111010001111011110110111110111110010010011100001000000000000000 111000110100111001111001110001101101010110101000000000000000000

output:

24
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
11111
11111
11111
101011
101011
101011
111101
111101
111101

result:

ok 25 tokens

Test #28:

score: 15
Accepted
time: 243ms
memory: 3968kb

input:

1001000010000000000000000000001000100000000000000000000000000010 100100001000000000000000000000010001000000000000000000000000000

output:

3
10
10001000000000000000000000000001
10001000000000000000000000000001

result:

ok 4 tokens

Test #29:

score: 15
Accepted
time: 0ms
memory: 3840kb

input:

11110011111110001110100010001010000001100000011000111 10100011001000011100000101000000110000000000000000000

output:

10
111
1101
10011
101001
101111
110101
1000111
1001001
1010011
1110001

result:

ok 11 tokens

Test #30:

score: 15
Accepted
time: 1ms
memory: 3840kb

input:

100100000100001011001110111001100101010011010110010101 100010110110100001110110011010000010001110111110000000

output:

8
111101
111101
1011001
1011001
1011001
10011101
10011101
10011101

result:

ok 9 tokens

Subtask #3:

score: 0
Time Limit Exceeded

Test #31:

score: 0
Time Limit Exceeded

input:

100001100011000011110101000011010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010011101101001101100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 10000...

output:


result:


Subtask #4:

score: 15
Accepted

Test #46:

score: 15
Accepted
time: 458ms
memory: 3968kb

input:

11011110000000000010100100101011111000100001100010011001110111010100101110110011111101111100001110110100010000000001111000110000100110111011000111000111001010000001010111010001111111000111100110011010111001011011010001100010101001001111111101000110011110011101011100000001101110111011000101010101101 ...

output:

2
100001101110001100011100001000111100010010000001111101101111011101000011000110100000110100010101100110100011010011100101000010011000011110110100010011
110100101010101001100011111111100111101100100010110001110000100110110110011100010001110100110010101000001100010101011000111101010100000110000100111...

result:

ok 3 tokens

Test #47:

score: 15
Accepted
time: 485ms
memory: 3840kb

input:

1101010101001110110000101001001111110100001110110101110111001100101000111110001010100000101100111110101010111111001001010101111110111010011111111010000011100001101110001001110110110011000001000100100111000011010001111110101011111101100010111110101011010011111001001010011100101000111011110110101 1101...

output:

2
10000001001100111111011111100001101000011111110110101101010101000001101011100101010101000111100101010011011110100101001011110101111110000110111111
110100110101001001010001111001100010101000000100001000100101011011110010111010010111011010011001111101000000100010100101000011011000100101101110001011

result:

ok 3 tokens

Test #48:

score: 15
Accepted
time: 409ms
memory: 3840kb

input:

11000000010000011101001101110011011010001101101011010011110001100001111011010011111101010000100001101101101001011111110100101010001001010001111001010110111110000001001100111110010110010000010011101100010111110000011000110010001001000110000110110000111011001001111011101001100100010110111000101111 110...

output:

3
11000111011110011001100110110000101110010011101010101011001001001101111000000100010011100010000011
110110001011100011100111100100111000111000110110110100100100100010101010011110100100010011000100111
1001000110111010001000111101101101011011100001011111001111110011011010111110110100111011000100010011

result:

ok 4 tokens

Test #49:

score: 15
Accepted
time: 367ms
memory: 3968kb

input:

10000000100111110100011011010100111111101000101010010000000110101010001111000111111001011100011110101110111001010110111010111001011010000000011000110010011001111001100011000101110101000001011010110100010101111010111111111010001100101111110100101111010101011111000110000110110001000011100100100101 100...

output:

4
10001011111011111010100011011111001111011101111101011011101101011100100111
10100101111101110000100110001011001001000011111100101110100100101010010111
100011110110111110101000110000000011010011010001011001001011010100100111011
101000011111001000110110011010110000111010000001010110110101110111100011...

result:

ok 5 tokens

Test #50:

score: 15
Accepted
time: 347ms
memory: 3968kb

input:

110110100011111110001000010100110110101100101001101001110111100101000011000010101110110111100000011011111001011110100001100001111110110000111001011010111011001010100010010101010011000100110001111101011111000011010000010101110001100100111000111101011011010011110100101100110001000011011101001 11011010...

output:

6
10011101001110010011100010110001101011101011011
110011001100001001101001110000110010001111111111
1001011010001000001100000000101110110000100010111
1111110101010010110011010101000000000111110110111
11011000001110011100011000101001101111010110010111
11100010000000010011100000010111010011110100000011

result:

ok 7 tokens

Test #51:

score: 15
Accepted
time: 401ms
memory: 3968kb

input:

11000010100100010010101111101101001001001011001111011101011100011110111000011110101110010000101111110101001011010100011110110110010110000001011111011110000010111000010111110000100001100100110000110100010100011111001101010101001100100001010010110001010000100101101100110110101010101110011010101 110000...

output:

4
111001111111110101100111001110010100111111010011
1100111001101000001110101101000000100001010011011
11110101100100101011111101001110110110011011010011
100010101100110001100100110010111000100100111001101100110001011101111001011110101111110011110011111001000000101011000110000101111101010010101110111

result:

ok 5 tokens

Test #52:

score: 15
Accepted
time: 687ms
memory: 3968kb

input:

1101011111101000011101101100000110101011101100111011010100011001111011100000000000010011101001100000001000100110010110011010000011011000100110101111001111111101000000111010111001110110010010100001000001011001111011111101111110001101101001001101011110000001010100110110110000110000001100000111100111 1...

output:

1
1101011111101000011101101100000110101011101100111011010100011001111011100000000000010011101001100000001000100110010110011010000011011000100110101111001111111101000000111010111001110110010010100001000001011001111011111101111110001101101001001101011110000001010100110110110000110000001100000111100111

result:

ok 2 tokens

Test #53:

score: 15
Accepted
time: 664ms
memory: 4096kb

input:

11000110101111001100011101111000010010000101010100100000001011000001111101100000101001001001011011110010101001100010111010011111110010000001011010000111010010011111101010010001101001000011010101001110000101111011100001000000110010000000100111010001100000110010011111011100100001110000010011011011 110...

output:

1
11000110101111001100011101111000010010000101010100100000001011000001111101100000101001001001011011110010101001100010111010011111110010000001011010000111010010011111101010010001101001000011010101001110000101111011100001000000110010000000100111010001100000110010011111011100100001110000010011011011

result:

ok 2 tokens

Test #54:

score: 15
Accepted
time: 27ms
memory: 3840kb

input:

110011101001010111100100011110000111011000001111000011111011000001110000101001001011100111100001000001001001011010111101110110000001101010011101111000011100111010110100100010100111001010001001000001011111101001010010110111111100001110111111001000110001001110111011000101101 11001110000111111111011101...

output:

20
11101110011
111100010111
1000010010011
1001010110011
1111101111011
10001101101011
10110101000011
10110111010011
11001001111011
11001101110011
11100100101111
11111111101011
100001110010011
101001001001011
101101100101011
111001000010111
111001101011011
111001111110011
111010100000111
111100100000111

result:

ok 21 tokens

Test #55:

score: 15
Accepted
time: 283ms
memory: 3968kb

input:

10000001010010101010101101001100101110110101110111100010111101000010100111000010101100011101111110011110100001010001000001000100010001001101011000101010100000010110111110110111111010111100010110000011011101010111101011011101010101000011111010101010111000100101111101001101101000010100100000011 100000...

output:

9
101011011001000010111100010011
11010001111001010011000111111111
11111110010010000110101010011011
100111001110010110100111101011011
101010110000010010011110111101011
111001001010010011000110101111011
1011011100100011111111010001100111
1110010110001110110111110100010011
11111001100011000100110110100...

result:

ok 10 tokens

Test #56:

score: 15
Accepted
time: 6ms
memory: 3840kb

input:

10110101001000000110010101010110110100001010001110011100110110101010010001100001010100110101011110101001011011101001011111001110011110000100010100110010000000110100101000010101110010100100000011001101100110000100001111100000000101100100100011111001011010000001011101000111101111101100100101 100011000...

output:

30
111
11111
101011
1000111
10100111
10111111
101100111
101111111
1000111011
1001001011
1100010011
1100101011
1101110111
1110010111
1110110011
10111110011
11010111011
11111011011
100100100011
100101001111
100110001111
100111100011
100111110111
101100000011
101100111111
110100010011
111001010111
1111...

result:

ok 31 tokens

Test #57:

score: 15
Accepted
time: 338ms
memory: 3840kb

input:

10010110110000010001101100011010001110110111000111110011110101010111101011001000100100000110110101011100110111011010011100011101000101000101000100111100000100010001001011101000000011100010010100001100011100010110011011100011011000100000101110110001010010000000101001101110101101100111000001 100101101...

output:

6
111111010011101000111100010111000011
11011000100001111100110001010011100011
101101010101000110010110010100101001111
1010111111101001011101011101000011110011
1101001010011100001000110000010001100111
11100001000000010110010000010011000011010011010011110010100000111111110101100100010000101000101011

result:

ok 7 tokens

Test #58:

score: 15
Accepted
time: 514ms
memory: 4096kb

input:

10100001001100010100001100011110111100100000001111000001000110101001001000001010110110100111010101111110101100010010111111111100101110110000110001001111010000101011101000101000110000101111100100011001001001100001011000001001001001011110111111010011001111111111010110001111011001010010010111000101 100...

output:

6
1101011
101011011
101101111
110111011
111001111
1111110110100111001110110011111111011000101000110100001001111110101111110101000001110100000001000101111011100101111101110010101000001101111110001001000001110010001000100010100010100111100101100101110111010100101101000011010111010111010000101101110000...

result:

ok 7 tokens

Test #59:

score: 15
Accepted
time: 277ms
memory: 3968kb

input:

10010001010100101001011011110011010000100000010000010000110001011000101010010011010101010010110001001101011100101101011011110001110001010101010000110100000000110101100010001000101111101000001000110000111000110010101010101000101101000110100110000000010000111001001001110000010001101011011100001 100100...

output:

10
1100001011110001000010100111
11000000100101111001111110111
11001100010110011110010011011
100000100110000100110010110111
101000111010110111011000100011
101111100100001011010110001011
110100010111110001100100100111
110111000001000010000111111111
111010110110000111010000101011
1111110111000110101110...

result:

ok 11 tokens

Test #60:

score: 15
Accepted
time: 0ms
memory: 3840kb

input:

1 1

output:

0

result:

ok "0"

Subtask #5:

score: 0
Time Limit Exceeded

Dependency #4:

100%
Accepted

Test #61:

score: 0
Time Limit Exceeded

input:

110111010010011000110101111011100011110100101011100111000000000000000000000000000000000000000000111011100101010110100010010100101001110000000000000000000000000000000000000000000000000000000000001111111110000100000100000000000000000000000000000000000000000000000000000000000000000000000000000001 11011...

output:


result:


Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #6:

0%