QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#487202#6341. The Last BattleUnforgettablepl0 151ms4084kbC++201.8kb2024-07-22 18:05:592024-07-22 18:05:59

Judging History

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

  • [2024-07-22 18:05:59]
  • 评测
  • 测评结果:0
  • 用时:151ms
  • 内存:4084kb
  • [2024-07-22 18:05:59]
  • 提交

Anna

#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;

const int maxN = 43;
const int COPIES = 2;

namespace {

int possget(int a,int b){
	int curr = 0;
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			if(i==a and j==b)return curr;
			curr++;
		}
	}
}

}

void Anna(int X, int Y, int N, string S) {
	int currpos = possget(X,Y);
	vector<vector<bool>> skip(8,vector<bool>(8));
	for(int i=0;i<8;i++)skip[i][Y]=skip[X][i]=true;
	while(S.size()<maxN)S.insert(S.end(),'A');
	long long num_to_write = 0;
	for(int i=0;i<maxN;i++)if(S[i]=='B')num_to_write|=(1ll<<i);
	for(int i=0;i<COPIES;i++){
		num_to_write<<=6;
		num_to_write+=currpos;
	}
	int bit = 0;
	for(int i=0;i<8;i++){
		if(i==X)continue;
		for(int j=0;j<8;j++){
			if(j==Y)continue;
			Paint(i,j,min(1ll,num_to_write&(1ll<<bit)));
			bit++;
		}
	}
}

Bruno

#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;

const int maxN = 43;
const int COPIES = 2;

namespace {

pair<int,int> possget(int x){
	int curr = 0;
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			if(curr++==x)return {i,j};
		}
	}
}

string getans(vector<vector<int>> &T,int X,int Y,int N){
	long long num_to_read = 0;
	int bit = 0;
	for(int i=0;i<8;i++){
		if(i==X)continue;
		for(int j=0;j<8;j++){
			if(j==Y)continue;
			if(T[i][j])num_to_read|=(1ll<<bit);
			bit++;
		}
	}
	for(int i=0;i<COPIES;i++){
		if(possget(num_to_read%(1<<6))!=make_pair(X,Y))return "";
		num_to_read>>=6;
	}
	string ans;
	for(int i=0;i<N;i++)
		if(num_to_read&(1ll<<i))ans.insert(ans.end(),'B');
		else ans.insert(ans.end(),'A');
	return ans;
}

}

string Bruno(int N, vector<vector<int>> T) {
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			auto ans = getans(T,i,j,N);
			if(ans!="")return ans;
		}
	}
	assert(false);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 151ms
memory: 4084kb

Manager to Anna

20000
1 7 1 A
2 3 1 A
0 1 1 A
1 1 1 A
7 4 1 A
2 3 1 A
0 3 1 B
0 7 1 A
4 2 1 B
5 4 1 A
6 0 1 B
7 3 1 A
0 7 1 A
2 3 1 A
1 6 1 A
5 2 1 B
2 7 1 B
6 3 1 A
3 3 1 A
1 7 1 A
2 3 1 A
1 2 1 A
5 3 1 A
3 5 1 A
4 3 1 A
2 3 1 A
4 6 1 B
7 3 1 B
2 3 1 A
4 4 1 A
7 3 1 A
4 5 1 B
0 7 1 A
0 3 1 B
2 0 1 B
4 1 1 A
6 0 1 ...

Anna to Manager

1111001111000000000000000000000000000000000000000
1100101100100000000000000000000000000000000000000
1000001000000000000000000000000000000000000000000
1001001001000000000000000000000000000000000000000
0011110011110000000000000000000000000000000000000
1100101100100000000000000000000000000000000000000
...

Manager to Bruno

20000
1 1111001110010100111000000000000000000001000000000000000100000000
1 1101010110001000000011000001000000010000000100000000000000010000
1 1101011111000001000000000100000000000000010000000100000001000000
1 1100100100000001000100000000000000000000010000000000000000000000
1 001111100111110000000000...

Bruno to Manager

A
A
A
A
A
A
B
A
B
A
B
A
A
A
A
B
B
A
A
A
A
A
A
A
A
A
B
B
A
A
A
B
A
B
B
A
B
A
B
B
A
A
B
A
A
A
A
B
A
B
A
A
B
B
A
A
A
A
A
A
A
B
A
B
A
B
B
A
A
A
B
B
B
B
B
A
B
A
B
A
A
B
A
A
A
B
B
B
A
A
B
A
B
A
A
B
B
A
A
B
A
A
B
A
A
A
A
A
A
A
B
B
B
A
B
A
A
A
A
A
A
A
A
B
A
A
B
A
A
B
A
A
B
A
A
A
A
B
A
A
B
A
A
A
A
B
A
A
A
A
...

result:

points 0.0 Accepted: 0