Welcome to my blog. You can post whatever you like!

The blog post is using markdown, and here is a simple guide. Markdown Guide

LOGIN TO POST A BLOG

code test

Satori

Author: Satori

Posted: 2017-05-01 18:42:56

Category: solution test

Views: 190 Comments: 0

``` from copy import deepcopy N = 5 time_consuming = [ [10, 8, 20, 4, 8], [4, 10, 6, 12, 5], [22, 13, 4, 10, 8], [2, 16, 25, 8, 2], [6, 8, 13, 11, 16], ] resource_consuming = [ [ [2, 0, 2, 1, 0], [0, 1, 0, 2, 5], [1, 0, 2, 0, 0], [0, 0, 0, 3, 5], [0, 2, 0, 0, 2], ], [ [0, 2, 1, 0, 0], [2, 0, 2, 0, 0], [1, 0, 0, 2, 5], [0, 1, 0, 0, 2], [0, 0, 0, 3, 0], ], [ [1, 0, 0, 0, 0], [2, 2, 0, 0, 0], [0, 0, 2, 3, 0], [0, 0, 0, 1, 4], [1, 0, 0, 1, 3], ], [ [0, 0, 0, 1, 2], [2, 3, 0, 0, 0], [1, 0, 2, 0, 0], [0, 2, 0, 3, 0], [0, 3, 0, 0, 6], ], [ [0, 1, 0, 0, 2], [0, 0, 0, 4, 0], [0, 0, 0, 0, 3], [2, 0, 3, 1, 0], [1, 3, 0, 0, 0], ], ] resource = [3, 4, 3, 4, 6] dependency = [ [None, None, None, None, None], [[0], [0], [0], [0], None], [None, [1], [0], None, [0]], [[2], [1], [1, 2], [1, 2], [1]], [1, 3], [2, 3], [3], [3], [2, 3], ] all_task_queues = [] def get_resouce_consume(queue): consume = [0 for x in range(N)] for ind, queue_id in enumerate(queue): consume_table = resource_consuming[ind] for task in queue_id: consume_column = consume_table[task] for con_ind, con in enumerate(consume_column): consume[con_ind] += con return consume def get_time_consume(queue): time_consume = [0 for x in range(N)] for ind, queue_id in enumerate(queue): for task in queue_id: con = time_consuming[ind][task] time_consume[ind] += con return max(time_consume) def judge_exceed_resource(queue_id): for ind, x in enumerate(get_resouce_consume(queue_id)): if x > resource[ind]: return False return True def judge_timing(queue_id): def get_all_task_queues(cur_task_id, queue): # all tasks are assigned, return the result if cur_task_id == N: all_task_queues.append(deepcopy(queue)) else: for queue_id in queue: queue_id.append(cur_task_id) get_all_task_queues(cur_task_id + 1, queue) queue_id.pop() def clean_all_task_queues(): global all_task_queues all_task_queues = list(filter(judge_exceed_resource, all_task_queues)) # format: [queue, time] def get_min_time_queue(): min_queue = min(all_task_queues, key=lambda x: get_time_consume(x)) return [min_queue, get_time_consume(min_queue)] if __name__ == "__main__": queue = [[] for d in range(N)] get_all_task_queues(0, queue) clean_all_task_queues() for ind, task_queue in enumerate(all_task_queues): print(ind, task_queue) print(get_min_time_queue()) ```

Read More

TEST

naruto

Author: naruto

Posted: 2017-04-30 12:03:58

Category: TEST

Views: 148 Comments: 0

![enter image description here][1] ![enter image description here][2] [1]: https://chongliu.me/static/mysite/images/bg-img.jpg [2]: https://chongliu.me/static/mysite/images/bg-img.js

Read More

TEST

naruto

Author: naruto

Posted: 2017-04-30 09:36:04

Category: asdf

Views: 193 Comments: 1

![` [enter image description here][1] `][1] [1]: https://%3Cimg%20src=%22http://url.to.file.which/not.exist%22%20onerror=alert%28document.cookie%29;%3E

Read More

Markdown使用说明

Satori

Author: Satori

Posted: 2017-04-28 14:04:00

Category: 指南

Views: 489 Comments: 2

# 书写markdown技巧 ### 1. 对于不习惯使用markdown的人,只需了解以下技巧就行了 - 要分行?多打一个换行符(回车) - \\ \`  \# \| \> \* 等符号打不出来?再这些符号前面加`\`试试 - 想打空格?输入` `(英文空格),` `(中文空格) ### 2.对于想钻研markdown书写语法的人,这里有[专业的文档][1] ### 3.这里提供一些常见技巧 |格式|输入示例|输出示例|备注| |:-:|:-:|:-:|:-:| |标题|`# 标题`||#号个数决定标题等级,越少越高。这个例子的输出示例就是这篇文档的各个标题| |加粗|`**加粗**`|**加粗**|在要加粗的文字左右加两个*就行了| |倾斜|`*倾斜*`|*倾斜*|在要倾斜的文字左右加一个*就行了| |倾斜加粗|`***倾斜加粗***`|***倾斜加粗***|再要倾斜加粗的文字左右加三个*就行了| |引用|`> 引用`||输出示例不展示了| |代码|` ``代码`` `|``代码``|用一个反引号也可以| ### 4.图片 格式: ![xxx][n]   \[n\]:  yyy 其中xxx为图片描述,当图片打不开显示的提示文字 yyy是图片网址地址 ``` ![markdown 图片][2] [2]: https://wpshout.com/media/2017/04/1200px-Markdown-mark.svg1_.png ``` ![markdown 图片][2] [2]: https://wpshout.com/media/2017/04/1200px-Markdown-mark.svg1_.png ### 5.文字链接 格式: [xxx][n]   \[n\]:  yyy 其中xxx为要链接的文字 yyy是文字所链接的网址 ``` [专业的markdown文档][1] [1]: https://daringfireball.net/projects/markdown/ ``` [专业的markdown文档][1] [1]: https://daringfireball.net/projects/markdown/ [2]: https://wpshout.com/media/2017/04/1200px-Markdown-mark.svg1_.png ### 6.表 语法: ``` |表头1|表头2|表头3| |:------|-------:|:------:| |内容1|内容2|内容3| |内容4|内容5|内容6| |左对齐|右对齐|居中| ``` |表头1|表头2|表头3| |:------|-------:|:------:| |内容1|内容2|内容3| |内容4|内容5|内容6| |左对齐|右对齐|居中| ### 7.代码块 语法: \`\`\` 代码写在这里 \`\`\`

Read More

test

Satori

Author: Satori

Posted: 2017-04-27 23:06:13

Category: test

Views: 151 Comments: 2

123 ---------- ***132*** df df df df df df df fd df

Read More

test

Satori

Author: Satori

Posted: 2017-04-27 19:08:37

Views: 155 Comments: 0

``` int a; int b; ```

Read More

test

Satori

Author: Satori

Posted: 2017-04-27 11:32:04

Views: 128 Comments: 0

``` 1234567 ```

Read More

test

Satori

Author: Satori

Posted: 2017-04-27 11:26:44

Category: test

Views: 165 Comments: 0

<script>alert("123456");</script>

Read More

test

Satori

Author: Satori

Posted: 2017-04-27 11:25:54

Views: 122 Comments: 1

233 <script>alert("123456");</script>

Read More

test

Satori

Author: Satori

Posted: 2017-04-27 11:23:41

Views: 139 Comments: 0

<script>alert("123");</script>

Read More