QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#138001 | #6341. The Last Battle | waldi# | 0 | 505ms | 4432kb | C++17 | 1.8kb | 2023-08-10 20:30:44 | 2024-07-04 01:33:45 |
Judging History
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));
t[x][y] = 2;
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(t[i][j]!=2 && !(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){
if(it < n) t[i][j] = s[it++]=='B';
else t[i][j] = 0;
}
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));
t[x][y] = 2;
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(t[i][j]!=2 && !(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){
if((int)s.size() < n) s += 'A'+t[i][j];
}
return s;
}
详细
Test #1:
score: 0
Wrong Answer
time: 505ms
memory: 4432kb
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
1111111101001000000000000000000000000000010000000 0011000110001010010000001000001000000000000000000 1000010110000010000001000000110000010000001000000 1111111110010010000001000000110000010000001000000 0001100000000000001000001000000100000001001100010 0011000110001010010000001000001000000000000000000 ...
Manager to Bruno
20000 1 1111111110010100101001000000000000000001000000000000001100000000 1 0011100011000010000011001001100000011000001100000000000000010000 1 1101011111000010101000001100000010000000111000001100000011000000 1 1111111100000001101001001000000010000000111000001000000010000000 1 000111000000100000000100...
Bruno to Manager
B A B B A A B B A A B A B A B A A A A B A B A A A A A A A A A A B B B B B B A B A A B A B A A B A A B A A A A A A A B A A A A B B B A B A A B B B A A A B A A B A B B A A A B B A B A A A A B A A A A A A A B A A A A A A A A A B A A A A A B B B A B B A A A B A A A A B A B A A B A A A B A A A A A A A B ...
result:
points 0.0 Accepted: 0