QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#20072#3098. Ancient Machineguobo#0 34ms10852kbC++142.1kb2022-02-14 17:28:532023-01-17 10:40:48

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-17 10:40:48]
  • 评测
  • 测评结果:0
  • 用时:34ms
  • 内存:10852kb
  • [2022-02-14 17:28:53]
  • 提交

Anna

#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int maxn=111111,mod=998244353;
#define MP make_pair
#define PB push_back
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define ROF(i,a,b) for(int i=(a);i>=(b);i--)
#define MEM(x,v) memset(x,v,sizeof(x))
inline int qpow(int a,int b){
	int ans=1;
	for(;b;b>>=1,a=1ll*a*a%mod) if(b&1) ans=1ll*ans*a%mod;
	return ans;
}
void Anna(int N,vector<char> S){
	vector<int> v;
	bool flag=false;
	FOR(i,0,N-1){
		if(!flag){
			if(S[i]=='X') flag=true,v.PB(1);
			v.PB(0);
		}
		else{
			if(S[i]=='Z' && (i==N-1 || S[i+1]!='Z')) v.PB(1);
			else v.PB(0);
		}
	}
//	FOR(i,0,N) printf("%d",v[i]);
//	puts("");
	while(v.size()%63) v.PB(0);
	ll f[maxn];
	f[1]=1;
	FOR(i,2,65) f[i]=f[i-1]+f[i-2];
	FOR(i,0,(int)v.size()/63-1){
		ll s=0;
		int lst=-1;
		FOR(j,0,62){
			int x=v[i*63+j];
			if(!x){
				if(lst!=j-1) s+=f[64-j];
				lst=j;
			}
		}
		if(lst!=62) s+=f[1];
		FOR(j,0,43) Send((s>>j)&1);
	}
}

Bruno

#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int maxn=111111,mod=998244353;
#define MP make_pair
#define PB push_back
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define ROF(i,a,b) for(int i=(a);i>=(b);i--)
#define MEM(x,v) memset(x,v,sizeof(x))
inline int qpow(int a,int b){
	int ans=1;
	for(;b;b>>=1,a=1ll*a*a%mod) if(b&1) ans=1ll*ans*a%mod;
	return ans;
}
void Bruno(int N,int L,vector<int> A){
	vector<int> v,vv;
	ll f[maxn];
	f[1]=1;
	FOR(i,2,65) f[i]=f[i-1]+f[i-2];
	FOR(i,0,L/44-1){
		ll s=0;
		FOR(j,0,43) s|=(ll)A[i*44+j]<<j;
		int lst=-1;
		FOR(j,1,63){
			if(s>=f[64-j]) s-=f[64-j],v.PB(1),v.PB(0),j++,putchar('1'),putchar('0');
			else v.PB(0),putchar('0');
		}
		if(s) v.pop_back();
//		putchar(' ');
	}
//	puts("");
	int lst=-1;
	FOR(i,0,N) if(v[i]){
		FOR(j,0,i) vv.PB(v[j]);
		FOR(j,i+2,N) vv.PB(v[j]);
		break;
	}
	v=vv;
	FOR(i,0,N){
		if(i==N || v[i]){
			ROF(j,i-1,lst+1) Remove(j);
			if(lst==-1) lst=i;
			else{
				lst=i;
				if(i!=N) Remove(i);
			}
		}
	}
	FOR(i,0,N) if(v[i]){Remove(i);break;}
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 4492kb

input:

18
Y X Y Z X Z X X Z Z Y Y Z Y Y Z X X

output:

44
11011010001010111100000001011110110011110010

input:

44
11011010001010111100000001011110110011110010

output:

Unauthorized output

result:

wrong output format Expected integer, but "Unauthorized" found

Subtask #2:

score: 0
Wrong Answer

Test #12:

score: 0
Wrong Answer
time: 34ms
memory: 10852kb

input:

100000
X Z X Z Z X Y Z Y X Y X Z Z Z Y X Z Y X Y Y X Y Y Y Z Y Z Z Y X X Y X X Y Y X X X Z Y Y Y Z Z Z Z Y X Y Y Z Z Z X Y Z X X X X Y X Y X X Z X Z Z Z X Y X X X Z X Z X X X Y Y Y Y Z X X Y Z Y Y X Z X Z Z Z Z Z Y Z Y X Y Y Y Y X Z Z Y Z Z Y Z Z Z X Z Z X X Z Z Z Z X X Z Y Y Z Y Y Z Z Y Y Z Y Z Y Z...

output:

69872
011100110000101011011011110000011001011100011010011101000110111011111010111001000110000000010000000010000101010001011100010001001000010010001110011100010101001001111001010101001100011010101111100100101101100011100011000010110111000001101001101111000111111100000010001111010000000101011001011100...

input:

69872
011100110000101011011011110000011001011100011010011101000110111011111010111001000110000000010000000010000101010001011100010001001000010010001110011100010101001001111001010101001100011010101111100100101101100011100011000010110111000001101001101111000111111100000010001111010000000101011001011100...

output:

Unauthorized output

result:

wrong output format Expected integer, but "Unauthorized" found