QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#395690#8330. Count off 3xlwangRE 0ms0kbC++142.0kb2024-04-21 17:17:132024-04-21 17:17:13

Judging History

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

  • [2024-04-21 17:17:13]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-04-21 17:17:13]
  • 提交

answer

#include<bits/stdc++.h>
#define fr(i,j,k) for(register int i=j;i<=k;++i)
#define rf(i,j,k) for(register int i=j;i>=k;--i)
#define foredge(i,j) for(register int i=head[j];i;i=e[i].nxt)
#define pb push_back
#define Times printf("Time:%.3lf\n",clock()/CLOCKS_PER_SEC)
using namespace std;
inline int read(){
	int x=0;
	bool f=0;
	char c=getchar();
	while(!isdigit(c)) f|=(c=='-'),c=getchar();
	while(isdigit(c)) x=(x<<3)+(x<<1)+(c^48),c=getchar();
	return f?-x:x;
}
inline void write(int x){
    if(x<0){putchar('-');x=-x;}
    if(x>9)write(x/10);
    putchar(x%10+'0');
}
inline void writeln(int x){write(x); puts("");}
inline void writepl(int x){write(x); putchar(' ');}
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline int randfind(int l,int r){return rnd()%(r-l+1)+l;}
//inline void init(){
//	int t=read();
//	while(t--) work();
//}
const int Maxn=1e5+10,mod=1e9+7;
inline void add(int &x,int y){
    x+=y;if(x>=mod) x-=mod;
}
int f1[7][7][7],f2[7][7][7];
int n;
char c[Maxn];
int ans;
inline void clear(){
    memset(f1,0,sizeof(f1)),memset(f2,0,sizeof(f2));
    ans=0;
}
int s1[Maxn][4],s2[Maxn][4];
inline int ksm(int x,int y,int mod){
    int sum=1;
    while(y){
        if(y&1) sum=sum*x%mod;
        y=y/2;x=x*x%mod;
    }
    return sum;
}
inline int check(int x,int y){
    int now=0;
    fr(i,1,n) now=(now+((1<<(n-i))&(x))*ksm(y,n-i,7))%7;
    // cout<<now<<endl;
    return now!=0;
}
inline void work(){
    scanf("%s",c+1);n=strlen(c+1);
    int tot=0;
    fr(i,1,n) tot+=(1<<(n-i))*(c[i]=='1');
    fr(i,1,tot){
        int flag=1;
        fr(j,1,7) flag&=check(i,j);
        if(flag){
            fr(j,1,n) cout<<((i&(1<<(n-j)))>0);
            cout<<endl;
        }
        ans+=flag;
    }
    writeln(ans);
}
inline void init(){
    int t=read();
    while(t--) work();
}
signed main(){
	freopen("input.in","r",stdin);
	freopen("output1.out","w",stdout);
    init();
    // printf("\nTIME:%.3lf",(double)clock()/CLOCKS_PER_SEC);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Dangerous Syscalls

input:

5
1
1010
110101
1000111000
101101001000

output:


result: