hd 1885 Key Task

#include <iostream>
#include <queue>
using namespace std;
const
int MAX = 101;
typedef struct

{

int
x, y;
int
cnt;
int
key;
}
Node;
char
Map[MAX][MAX];
int
m, n;
int
dir[4][2] = {{0,1},{0,-1},{1,0},{-1,0}};
bool
state[MAX][MAX][16];
int
c_state(char c)
{

if
( c=='B'||c=='b' ) return 1;
if
( c=='Y'||c=='y' ) return 2;
if
( c=='R'||c=='r' ) return 4;
if
( c=='G'||c=='g' ) return 8;
}

int
main()
{

int
i, j, k;
int
x, y, key;
Node sn, tn, ttn;
queue<Node> mq;
while
(scanf("%d%d", &m, &n) != EOF)
{

getchar();
if
(m==0 && n==0)
break
;
for
(i=0; i<m; ++i)
{

for
(j=0; j<n; ++j)
{

scanf("%c", &Map[i][j]);
if
(Map[i][j] == '*')
{

sn.x = i, sn.y = j, sn.cnt = 0, sn.key = 0;
}
}

getchar();
}

bool
flag = false;
memset(state, false, sizeof(state));
state[sn.x][sn.y][0] = true;

mq.push(sn);
while
(!mq.empty())
{

tn = mq.front();
mq.pop();
if
(Map[tn.x][tn.y] == 'X')
{

flag = true;
break
;
}

for
(i=0; i<4; ++i)
{

x = tn.x + dir[i][0];
y = tn.y + dir[i][1];
if
(x>=0&&x<m && y>=0&&y<n && Map[x][y]!='#')
{

if
(Map[x][y]=='B'||Map[x][y]=='Y'||Map[x][y]=='R'||Map[x][y]=='G')
{

k = c_state(Map[x][y]);
if
( !(k&tn.key) ) continue;
key =tn.key;
}

else if
(Map[x][y]=='b'||Map[x][y]=='y'||Map[x][y]=='r'||Map[x][y]=='g')
{

k = c_state(Map[x][y]);
key = k|tn.key;
}

else

key = tn.key;
if
(!state[x][y][key])
{

state[x][y][key] = true;
ttn.x = x;
ttn.y = y;
ttn.key = key;
ttn.cnt = tn.cnt+1;
mq.push(ttn);
}
}
}
}

while
(!mq.empty())
mq.pop();
if
(flag)
printf("Escape possible in %d steps./n",tn.cnt);
else

printf("The poor student is trapped!/n");

}

return
0;
}
<?xml version="1.0" encoding="UTF-8"?> <bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="diagram_Process_1752746854617" targetNamespace="http://bpmn.io/schema/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="Process_1752746854617" name="业务流程_1752746854617" isExecutable="true" camunda:versionTag="管理员审批"> <bpmn2:startEvent id="Event_1h8qi8n" name="开始" camunda:formKey="key_1938481912687386626"> <bpmn2:outgoing>Flow_1hr3h7v</bpmn2:outgoing> </bpmn2:startEvent> <bpmn2:userTask id="Activity_173wnf8" name="人事审批" camunda:formKey="key_1938481912687386626" camunda:assignee="" camunda:candidateGroups="ROLE1"> <bpmn2:incoming>Flow_1hr3h7v</bpmn2:incoming> <bpmn2:outgoing>Flow_0s4l0de</bpmn2:outgoing> <bpmn2:outgoing>Flow_0tdukrq</bpmn2:outgoing> </bpmn2:userTask> <bpmn2:sequenceFlow id="Flow_1hr3h7v" sourceRef="Event_1h8qi8n" targetRef="Activity_173wnf8" /> <bpmn2:userTask id="Activity_01dir8d" name="管理员审批" camunda:formKey="key_1938481912687386626" camunda:assignee="" camunda:candidateGroups="ROLE1"> <bpmn2:incoming>Flow_0s4l0de</bpmn2:incoming> <bpmn2:outgoing>Flow_0psqmf5</bpmn2:outgoing> </bpmn2:userTask> <bpmn2:sequenceFlow id="Flow_0s4l0de" sourceRef="Activity_173wnf8" targetRef="Activity_01dir8d" /> <bpmn2:intermediateThrowEvent id="Event_07aol93" name="结束"> <bpmn2:incoming>Flow_0psqmf5</bpmn2:incoming> </bpmn2:intermediateThrowEvent> <bpmn2:sequenceFlow id="Flow_0psqmf5" sourceRef="Activity_01dir8d" targetRef="Event_07aol93" /> <bpmn2:subProcess id="Activity_1lxz6ev"> <bpmn2:incoming>Flow_0tdukrq</bpmn2:incoming> <bpmn2:startEvent id="Event_0s73u7j" name="子流程开始" camunda:formKey="key_1938481912687386626"> <bpmn2:outgoing>Flow_1fna0x0</bpmn2:outgoing> </bpmn2:startEvent> <bpmn2:userTask id="Activity_08b5oss" name="财务审批" camunda:formKey="key_1938481912687386626" camunda:assignee="" camunda:candidateGroups="ROLE1"> <bpmn2:incoming>Flow_1fna0x0</bpmn2:incoming> <bpmn2:outgoing>Flow_0hd36jk</bpmn2:outgoing> </bpmn2:userTask> <bpmn2:sequenceFlow id="Flow_1fna0x0" sourceRef="Event_0s73u7j" targetRef="Activity_08b5oss" /> <bpmn2:endEvent id="Event_11g0gdt" name="子流程结束"> <bpmn2:incoming>Flow_0hd36jk</bpmn2:incoming> </bpmn2:endEvent> <bpmn2:sequenceFlow id="Flow_0hd36jk" sourceRef="Activity_08b5oss" targetRef="Event_11g0gdt" /> </bpmn2:subProcess> <bpmn2:sequenceFlow id="Flow_0tdukrq" sourceRef="Activity_173wnf8" targetRef="Activity_1lxz6ev" /> </bpmn2:process> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1752746854617"> <bpmndi:BPMNEdge id="Flow_0tdukrq_di" bpmnElement="Flow_0tdukrq"> <di:waypoint x="360" y="260" /> <di:waypoint x="360" y="500" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="Flow_0psqmf5_di" bpmnElement="Flow_0psqmf5"> <di:waypoint x="570" y="220" /> <di:waypoint x="632" y="220" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="Flow_0s4l0de_di" bpmnElement="Flow_0s4l0de"> <di:waypoint x="410" y="220" /> <di:waypoint x="470" y="220" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="Flow_1hr3h7v_di" bpmnElement="Flow_1hr3h7v"> <di:waypoint x="258" y="220" /> <di:waypoint x="310" y="220" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="Event_1h8qi8n_di" bpmnElement="Event_1h8qi8n"> <dc:Bounds x="222" y="202" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="229" y="245" width="23" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Activity_173wnf8_di" bpmnElement="Activity_173wnf8"> <dc:Bounds x="310" y="180" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Activity_01dir8d_di" bpmnElement="Activity_01dir8d"> <dc:Bounds x="470" y="180" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Event_07aol93_di" bpmnElement="Event_07aol93"> <dc:Bounds x="632" y="202" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="639" y="245" width="23" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Activity_1lxz6ev_di" bpmnElement="Activity_1lxz6ev" isExpanded="true"> <dc:Bounds x="280" y="500" width="350" height="200" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="Flow_0hd36jk_di" bpmnElement="Flow_0hd36jk"> <di:waypoint x="510" y="600" /> <di:waypoint x="572" y="600" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="Flow_1fna0x0_di" bpmnElement="Flow_1fna0x0"> <di:waypoint x="356" y="600" /> <di:waypoint x="410" y="600" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="Event_0s73u7j_di" bpmnElement="Event_0s73u7j"> <dc:Bounds x="320" y="582" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="310" y="625" width="56" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Activity_08b5oss_di" bpmnElement="Activity_08b5oss"> <dc:Bounds x="410" y="560" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Event_11g0gdt_di" bpmnElement="Event_11g0gdt"> <dc:Bounds x="572" y="582" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="562" y="625" width="56" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn2:definitions> 这个是我的xml TaskQuery taskQuery = taskService.createTaskQuery() .active() //.includeProcessVariables() .or() .taskAssignee(TaskUtils.getUserId()) // 分配给当前用户的任务 .taskCandidateUser(TaskUtils.getUserId()) // 当前用户是候选人的任务 .taskCandidateGroupIn(TaskUtils.getCandidateGroup()) .endOr() .orderByTaskCreateTime().desc();我需要注入什么数据值才能获取我的数据呢?
最新发布
07-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值