QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#20393#3098. Ancient Machineuezexh#0 62ms9616kbC++201.4kb2022-02-15 23:16:552023-01-17 10:44:36

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:44:36]
  • 评测
  • 测评结果:0
  • 用时:62ms
  • 内存:9616kb
  • [2022-02-15 23:16:55]
  • 提交

Anna

#include "Anna.h"
#include <vector>
using namespace std;
void Anna(int N,vector<char> S){
	using ll=long long;
	vector<int> a([](int n){
		int x=64;
		while(x<n)
			x<<=1;
		return x;
	}(N));
	ll fib[67]={0,1};
	for(int i=2;i<67;++i)
		fib[i]=fib[i-1]+fib[i-2];
	int f=0;
	for(int i=0;i<N;++i){
		if(!f){
			if(S[i]=='X')
				f=i;
			for(int j=i+1;j<=N;++j)
				if(j==N || S[j]!='Z'){
					i=j-1;
					break;
				}
			a[i]=1;
		}else if(S[i]=='Z'){
			if(S[i-1]=='Z')
				a[i-1]=0;
			a[i]=1;
		}
	}
	for(int i=0;i<int(a.size());i+=64){
		ll s=0;
		for(int j=0;j<64;++j)
			if(a[i+j])
				s+=fib[63-j+2];
		for(int j=0;j<44;++j)
			Send((s>>j)&1);
	}
}

Bruno

#include "Bruno.h"
using namespace std;
void Bruno(int N,int L,vector<int> A){
	using ll=long long;
	vector<int> a([](int n){
		int x=64;
		while(x<n)
			x<<=1;
		return x;
	}(N));
	ll fib[67]={0,1};
	for(int i=2;i<67;++i)
		fib[i]=fib[i-1]+fib[i-2];
	for(int i=0;i<int(A.size());i+=44){
		ll s=0;
		for(int j=0;j<44;++j)
			if(A[i+j])
				s|=(1LL<<j);
		for(int j=0;j<64;++j)
			if(s>=fib[63-j+2]){
				s-=fib[63-j+2];
				a[i+(j++)]=1;
			}
	}
	vector<int> p;
	for(int i=0;i<N;++i)
		if(A[i])
			p.push_back(i);
	if(!p.size()){
		for(int i=0;i<N;++i)
			Remove(i);
	}else{
		p.push_back(N);
		for(int i=0;i<p[0];++i)
			Remove(i);
		for(int i=1;i<int(p.size());++i)
			for(int j=p[i]-1;j>=p[i-1];--j)
				Remove(j);
	}
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3192kb

input:

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

output:

44
00111101110110000110001111111110111110010111

input:

44
00111101110110000110001111111110111110010111

output:

0 44 0

result:

wrong answer your query is valid but your solution is not optimal: read 0 but expected 3

Subtask #2:

score: 0
Wrong Answer

Test #12:

score: 0
Wrong Answer
time: 62ms
memory: 9616kb

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:

90112
000010001010101000000111110110001011111000111110101011101110110000100011101101000101010001011011111000110010001011010101010010010011101100010000011010011111011110101101011101101000001110111110001101110100111100101001011001100000110000000011111010111110110101011000111010101000001001001001111001...

input:

90112
000010001010101000000111110110001011111000111110101011101110110000100011101101000101010001011011111000110010001011010101010010010011101100010000011010011111011110101101011101101000001110111110001101110100111100101001011001100000110000000011111010111110110101011000111010101000001001001001111001...

output:

0 90112 1459

result:

wrong answer your query is valid but your solution is not optimal: read 1459 but expected 22133