QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#124483 | #6341. The Last Battle | Adam_GS | 0 | 43ms | 3780kb | C++17 | 2.6kb | 2023-07-14 22:35:51 | 2023-07-14 22:35:52 |
Judging History
Anna
#include "Anna.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
#define rep(a, b) for(int a = 0; a < (b); ++a)
namespace {
int P[8][8];
}
void Anna(int X, int Y, int N, string S) {
P[0][0]=110;
P[0][1]=190;
P[1][1]=164;
P[0][2]=97;
P[1][2]=233;
P[2][2]=50;
P[0][3]=68;
P[1][3]=74;
P[2][3]=55;
P[3][3]=147;
P[0][4]=49;
P[1][4]=179;
P[2][4]=247;
P[3][4]=114;
P[4][4]=87;
P[0][5]=41;
P[1][5]=217;
P[2][5]=43;
P[3][5]=45;
P[4][5]=137;
P[5][5]=57;
P[0][6]=215;
P[1][6]=16;
P[2][6]=194;
P[3][6]=141;
P[4][6]=19;
P[5][6]=244;
P[6][6]=245;
P[0][7]=240;
P[1][7]=216;
P[2][7]=207;
P[3][7]=12;
P[4][7]=81;
P[5][7]=127;
P[6][7]=94;
P[7][7]=253;
rep(i, 8) rep(j, i) P[i][j]=P[j][i];
rep(i, 8) if(i!=X && i!=Y) {
if(P[X][Y]&(1<<i)) Paint(i, i, 1);
else Paint(i, i, 0);
}
while(S.size()<100) S+="A";
bool czy=false;
if(X==Y) czy=true;
int akt=0;
rep(i, 8) rep(j, 8) if(i!=X && j!=Y && i!=j) {
if(!czy && i!=Y && j!=X) {
if(X<=Y) Paint(i, j, 0);
else Paint(i, j, 1);
czy=true;
} else {
if(S[akt]=='A') Paint(i, j, 0);
else Paint(i, j, 1);
++akt;
}
}
}
Bruno
#include "Bruno.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
namespace {
int P[8][8], odw[8][8];
}
string Bruno(int N, vector<vector<int>>T) {
P[0][0]=110;
P[0][1]=190;
P[1][1]=164;
P[0][2]=97;
P[1][2]=233;
P[2][2]=50;
P[0][3]=68;
P[1][3]=74;
P[2][3]=55;
P[3][3]=147;
P[0][4]=49;
P[1][4]=179;
P[2][4]=247;
P[3][4]=114;
P[4][4]=87;
P[0][5]=41;
P[1][5]=217;
P[2][5]=43;
P[3][5]=45;
P[4][5]=137;
P[5][5]=57;
P[0][6]=215;
P[1][6]=16;
P[2][6]=194;
P[3][6]=141;
P[4][6]=19;
P[5][6]=244;
P[6][6]=245;
P[0][7]=240;
P[1][7]=216;
P[2][7]=207;
P[3][7]=12;
P[4][7]=81;
P[5][7]=127;
P[6][7]=94;
P[7][7]=253;
int X=-1, Y=-1;
rep(i, 8) odw[i][i]=1;
rep(i, 8) rep(j, i+1) {
bool ok=true;
rep(a, 8) if(a!=i && a!=j){
if(T[a][a]!=((P[j][i]&(1<<a))==(1<<a))) ok=false;
}
if(ok) {
X=j; Y=i;
}
}
if(X!=Y) {
bool czy=false;
rep(i, 8) rep(j, 8) if(i!=X && i!=Y && j!=X && j!=Y && i!=j && !czy) {
if(T[i][j]) swap(X, Y);
czy=true;
odw[i][j]=1;
}
}
string ans="";
rep(i, 8) rep(j, 8) if(!odw[i][j] && i!=X && j!=Y) ans+=(T[i][j]?"B":"A");
while(ans.size()>N) ans.pop_back();
return ans;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 43ms
memory: 3780kb
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
0000000000000000010000000100000000000000010000000 1000000010000000000000001000000010000000000000000 0000000010000000100000001000000010000000000000001 0000000010000000000000000000000010000000000000001 1100000000000000000000000000000000000000000000010 1000000010000000000000001000000010000000000000000 ...
Manager to Bruno
20000 1 0000000110010100000000000001000000001001000000000000001100000000 1 1001000001000000000011000001000000011000000101000000000000010000 1 1101011101000000001000000101000000001000010001000100000001000001 1 0100000000000001001000000000000000000000010001000000000000000001 1 110010000000100000000000...
Bruno to Manager
A A A A A A B A B A A A A A A B A A A A A A A A A A A A A A A A A B A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A B A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A B A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A ...
result:
points 0.0 Accepted: 0