QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#163613 | #7123. Robot Contest | Lynkcat | 0 | 212ms | 5044kb | C++20 | 3.2kb | 2023-09-04 12:36:58 | 2023-09-04 12:36:59 |
Judging History
你现在查看的是测评时间为 2023-09-04 12:36:59 的历史记录
- [2023-09-04 12:36:58]
- 提交
answer
#include<bits/stdc++.h>
#include "robot.h"
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
// #define int ll
// #define N
using namespace std;
namespace
{
int s[4];
string val="WSENHT";
}
inline int rev(int x)
{
return ((x-2)^4)+2;
}
inline int rl(int x)
{
return (x-2)&3;
}
inline int sta(int x)
{
if (x<2) return 2;
return (x-2)>3;
}
void work(int k)
{
if (k==4)
{
if (s[1]==-2&&s[2]==-2)
{
int o=0,p=1;
for (int i=0;i<4;i++)
if (s[i]==0) p=0;
if (p)
{
for (int i=0;i<4;i++)
if (s[i]>0) o=i;
for (int j=2;j<=9;j++)
set_instruction((poly){j,s[0],s[1],s[2],s[3]},1,val[o]);
return;
}
}
if (s[0]==-2&&s[3]==-2)
{
for (int j=2;j<=9;j++)
{
int o=4;
for (int i=0;i<4;i++)
if (s[i]==1) o=i;
if (o!=4)
{
set_instruction((poly){j,s[0],s[1],s[2],s[3]},1,val[5]);
} else
{
int nxt=4;
for (int i=0;i<4;i++)
if (s[i]==0||sta(s[i])==(sta(j)^1)) nxt=i;
if (nxt!=4)
{
set_instruction((poly){j,s[0],s[1],s[2],s[3]},j,val[nxt]);
} else
{
int nxt=4;
for (int i=0;i<4;i++)
if (sta(s[i])==sta(j)) nxt=i;
if (nxt!=4)
set_instruction((poly){j,s[0],s[1],s[2],s[3]},rev(j),val[nxt]);
}
}
}
int o=4;
for (int i=0;i<4;i++)
if (s[i]==0) o=i;
set_instruction((poly){0,s[0],s[1],s[2],s[3]},2,val[o]);
return;
}
{
int o=4,op=4;
for (int i=0;i<4;i++)
if (s[i]==1) o=i^2;
if (o!=4)
{
for (int j=2;j<=9;j++)
set_instruction((poly){j,s[0],s[1],s[2],s[3]},1,val[rl(j)]);
return;
}
}
for (int j=2;j<=9;j++)
{
int o=sta(s[rl(j)]);
int nxt=4;
for (int i=0;i<4;i++)
if (s[i]==0||sta(s[i])==(o^1)&&rl(s[i])==(i^2)) nxt=i;
if (nxt==4) nxt=rl(j);
set_instruction((poly){j,s[0],s[1],s[2],s[3]},
(rl(j)^(o*4))+2,val[nxt]);
}
int fa=0;
for (int i=0;i<4;i++)
if (s[i]>0)
fa=i;
set_instruction((poly){0,s[0],s[1],s[2],s[3]},(fa^(sta(s[fa])*4))+2,val[fa]);
return;
}
for (int i=-2;i<=9;i++)
{
s[k]=i;
work(k+1);
}
}
void program_pulibot()
{
int mx=9;
work(0);
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 192ms
memory: 4740kb
input:
4 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 t
output:
p71c1rw3EvfjFcMVWG0EOedGbWDX5uUp OK 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
wrong answer Unexpected state: [0, 5, -2, -2, 9]
Subtask #2:
score: 0
Wrong Answer
Test #9:
score: 0
Wrong Answer
time: 206ms
memory: 4972kb
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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
wrong answer Unexpected state: [1, 2, -2, -2, 1]
Subtask #4:
score: 0
Wrong Answer
Test #40:
score: 0
Wrong Answer
time: 212ms
memory: 4860kb
input:
15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 ...
output:
p71c1rw3EvfjFcMVWG0EOedGbWDX5uUp OK 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
wrong answer Unexpected state: [0, -1, -2, -2, 9]
Subtask #5:
score: 0
Skipped
Dependency #1:
0%