QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#137986#6341. The Last Battlewaldi#Compile Error//C++171.7kb2023-08-10 20:17:262024-07-04 01:33:35

Judging History

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

  • [2024-07-04 01:33:35]
  • 评测
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-10 20:17:26]
  • 提交

Anna

#include <bits/stdc++.h>
#include "Anna.h"
#define FOR(i,p,k) for(int i=(p);i<=(k);++i)
#define REP(i,n) FOR(i,0,(n)-1)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define fi first
#define se second
using namespace std;

vvi gen(int x, int y){
	// 0,1 - info
	// 2 - blokada
	// 3 - info slowa
	vvi t(8, vi(8, 0));
	REP(i, 8) if(i != x){
		if(y) t[i][y-1] = 1;
		t[i][y] = 2;
		if(y<7) t[i][y+1] = 1;
	}
	REP(j, 8) if(j != y){
		if(x) t[x-1][j] = 1;
		t[x][j] = 2;
		if(x<7) t[x+1][j] = 1;
	}
	REP(i, 8) REP(j, 8) if(!(i==0 || j==0 || i==j || i+j==7)) t[i][j] = 3;
	return t;
}

void Anna(int x, int y, int n, string s){
	vvi t = gen(x, y);
	int it = 0;
	REP(i, 8) REP(j, 8) if(t[i][j] == 3){
		t[i][j] = s[it++]=='B';
		if(it == n) break;
	}
	REP(i, 8) REP(j, 8) if(t[i][j] < 2) paint(i, j, t[i][j]);
}

Bruno

#include <bits/stdc++.h>
#include "Bruno.h"
#define FOR(i,p,k) for(int i=(p);i<=(k);++i)
#define REP(i,n) FOR(i,0,(n)-1)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define fi first
#define se second
using namespace std;

vvi gen(int x, int y){
	// 0,1 - info
	// 2 - blokada
	// 3 - info slowa
	vvi t(8, vi(8, 0));
	REP(i, 8) if(i != x){
		if(y) t[i][y-1] = 1;
		t[i][y] = 2;
		if(y<7) t[i][y+1] = 1;
	}
	REP(j, 8) if(j != y){
		if(x) t[x-1][j] = 1;
		t[x][j] = 2;
		if(x<7) t[x+1][j] = 1;
	}
	REP(i, 8) REP(j, 8) if(!(i==0 || j==0 || i==j || i+j==7)) t[i][j] = 3;
	return t;
}

string Bruno(int n, vvi t){
	int x, y;
	REP(xx, 8) REP(yy, 8){
		vvi t2 = gen(xx, yy);
		bool git = 1;
		REP(i, 8) REP(j, 8) if(t[i][j]<2 && t2[i][j]<2 && t2[i][j]!=t[i][j]) git = 0;
		if(git){x=xx, y=yy; break;}
	}
	
	string s;
	REP(i, 8) REP(j, 8) if(i!=x && j!=y){
		s += 'A'+t[i][j];
		if((int)s.size() == n) break;
	}
	return s;
}

Details

Anna.code: In function ‘void Anna(int, int, int, std::string)’:
Anna.code:38:45: error: ‘paint’ was not declared in this scope; did you mean ‘Paint’?
   38 |         REP(i, 8) REP(j, 8) if(t[i][j] < 2) paint(i, j, t[i][j]);
      |                                             ^~~~~
      |                                             Paint