QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#20588#3098. Ancient Machinelinmuhan#0 54ms11200kbC++201.9kb2022-02-16 19:00:192023-01-17 10:46:06

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:46:06]
  • 评测
  • 测评结果:0
  • 用时:54ms
  • 内存:11200kb
  • [2022-02-16 19:00:19]
  • 提交

Anna

#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
const int NT = 220021;
#define ll long long
int bi[NT], tot = 0;
ll Sum = 0, fib[NT];
int sd[NT], cnt = 0;
void Anna (int N, vector <char> S) {
	int p = -1;
	for (int i=0;i<N;i++) {
		if (S[i] == 'X') {
			p = i;
			break ;
		}
	}
	if (S[p + 1] == 'Z') S[p + 1] = 'X';
	bi[p] = 1; bi[p + 1] = 0; tot = p + 2;
	for (int l=p+1,r;l<N;l=r+1) {
		r = l; if (S[r] != 'Z') continue ;
		while (S[r] == S[l] && r < N) r ++; r --;
		bi[r] = 1; tot = r + 1;
	}
	fib[0] = 1; fib[1] = 2;
	for (int i=2;i<=64;i++) fib[i] = fib[i - 1] + fib[i - 2];
	for (int i=0;i<tot;i+=64) {
		Sum = 0;
		for (int j=0;j<64;j++) {
			int t = j + i; if (t >= tot) break ;
			if (bi[j]) Sum += fib[j];
		}
		for (int t=0;t<44;t++) {
			if (Sum & (1ll << t)) sd[++ cnt] = 1;
			else sd[++ cnt] = 0;
		}
	}
	for (int i=1;i<=cnt;i++) Send (sd[i]);
}

Bruno

#include "Bruno.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int NTT = 220021;
int bit[NTT];
ll fibb[NTT];
bool rem[NTT];

void Bruno(int N, int L, vector<int> A) {
//	for (int i=0;i<A.size();i++) cout << A[i]; puts ("");
	fibb[0] = 1; fibb[1] = 2;
	for (int i=2;i<=64;i++) fibb[i] = fibb[i - 1] + fibb[i - 2];
	int p = 0;
	for (int i=0;i<L;i+=44) {
		ll sum = 0;
		for (int j=i+43;j>=i;j--) sum = sum * 2 + A[j];
		for (int j=63;j>=0;j--) {
			if (sum >= fibb[j]) {
				sum -= fibb[j];
				bit[j + p] = 1;
			}
		}
		p += 64;
	}
	p = max (p, N);
//	for (int i=0;i<p;i++) cout << bit[i]; puts ("");
	int t = -1;
	for (int i=0;i<p;i++) {
		if (bit[i]) {
			t = i;
			break ;
		}
		Remove (i); rem[i] = 1;
	}
	if (t == -1) {
		return ;
	}
	rem[t] = 1;
	for (int j=t+1;j<p;j++) {
		if (bit[j]) {
			for (int k=j-1;!rem[k];k--) Remove (k), rem[k] = 1;
			Remove (j); rem[j] = 1;
		}
	}
	rem[t] = 1; Remove (t);
	for (int i=0;i<p;i++) if (! rem[i]) Remove (i);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 4ms
memory: 5668kb

input:

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

output:

44
11000100000100000000000000000000000000000000

input:

44
11000100000100000000000000000000000000000000

output:

3

result:

wrong answer Wrong Answer [3]

Subtask #2:

score: 0
Wrong Answer

Test #12:

score: 0
Wrong Answer
time: 54ms
memory: 11200kb

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:

68772
110001000001111001010010010100010000001110001100010000011110010100100101000100000011100011000100000111100101001001010001000000111000110001000001111001010010010100010000001110001100010000011110010100100101000100000011100011000100000111100101001001010001000000111000110001000001111001010010010100...

input:

68772
110001000001111001010010010100010000001110001100010000011110010100100101000100000011100011000100000111100101001001010001000000111000110001000001111001010010010100010000001110001100010000011110010100100101000100000011100011000100000111100101001001010001000000111000110001000001111001010010010100...

output:

3

result:

wrong answer Wrong Answer [3]