Got

bzoj 4860 [BeiJing2017]树的难题

南楼画角 提交于 2020-11-27 03:27:46
题面 https://www.lydsy.com/JudgeOnline/problem.php?id=4860 题解 点分治 设当前重心为v 假设已经把所有边按照出发点第一关键字, 颜色第二关键字排序 对于当前的v 我们顺次考虑他的出边 设当前出边(v,nw) 颜色 col 我们枚举nw的出边 对于一条nw的出边而言, 分为两种情况 1. 颜色与col相同 用线段树维护深度及对应的最值,查询到最大值即可 (v,nw)没有贡献 2. 颜色与col不同 用另一棵线段树维护深度以及与(当前节点的连向其父节点的边的颜色)不同的(连向子节点的边)所对应的子节点对应的子树之内的最值 加上col的权值 向上的时候 将线段树合并 Code 1 #include <cstdio> 2 #include <cctype> 3 #include <algorithm> 4 const int maxn= 400010 ,inf= 2000000010 ; 5 int ans,n,x,y,z,i,m,l,r,c[maxn* 3 ],cnt; 6 inline int max( int a, int b){ 7 return a>b? a:b; 8 } 9 inline void up( int &a, const int & b){ 10 if (a<b)a= b; 11 } 12 inline int

C

China☆狼群 提交于 2020-11-26 08:06:57
Problem description «One dragon. Two dragon. Three dragon», — the princess was counting. She had trouble falling asleep, and she got bored of counting lambs when she was nine. However, just counting dragons was boring as well, so she entertained herself at best she could. Tonight she imagined that all dragons were here to steal her, and she was fighting them off. Every k -th dragon got punched in the face with a frying pan. Every l -th dragon got his tail shut into the balcony door. Every m -th dragon got his paws trampled with sharp heels. Finally, she threatened every n -th dragon to call

L1-Day16

核能气质少年 提交于 2020-11-21 07:47:51
1、To know everything is to know nothing. 【我的翻译】知道所有意味着什么都不知道。 【标准答案】样样皆通,样样稀松。 【对比分析】天呐,我这翻译也太直了吧。如果不和答案对照我还觉得自己翻译的不错呢。 【解题思路】 - 内部关系:描述关系 - 句子类型:不定式作主语与表语 - 句子时态:一般现在时 - 句子成分:To know everything不定式作主语 is系动词 to know nothing不定式作表语. 【拓展】everything与anything与something everything à pron. (1) each thing or all things每件事物; 所有事物: eg. I decided to tell her everything.我决定把一切都告诉她。 (2) all the things in your life, work etc一切〔指生活、工作等〕:eg. Everything's fine at the moment.目前一切都好。 (3) be / mean everything (to sb) to be the most important thing in someone's life(对某人来说)是/最重要的/意味着一切:eg. Money isn't everything

Pwn-level3

眉间皱痕 提交于 2020-11-21 06:15:19
题目 地址 借鉴 这类的题目类型为ret2libc 32位的程序,用IDA打开,read函数存在溢出 程序中没有找到system函数,也没找到/bin/sh,但是给了一个libc-2.19.so,我们需要读取某一个函数 got 表中的地址来计算 libc 的基址,最终计算system和/bin/sh内存地址 got表和plt表的关系 参考 思路: 1、让read函数溢出,然后用write函数泄露write函数本身的地址 2、利用函数在内存中的地址和libc文件中的偏移的差相等,来获取基址,通过基址来获取system和/bin/sh的地址 3、再次返回vulnerable_funcion函数,进行二次溢出获得shell 脚本如下 # -*- coding: UTF-8 -*- from pwn import * r =remote( " pwn2.jarvisoj.com " ,9879 ) elf =ELF( " ./level3 " ) writeplt =elf.plt[ " write " ] writegot =elf.got[ " write " ] func =elf.symbols[ " vulnerable_function " ] libc =ELF( " ./libc-2.19.so " ) writelibc =libc.symbols[ " write "

csaw-ctf-2016-quals:key

偶尔善良 提交于 2020-11-21 04:21:31
下载附件,为exe格式,查壳。 没有加壳,哈哈! 运行下试试。咦?一闪而过????? 拖入OD逐步运行下试试。 运行结束:what happen???? 问我?你问我,我也不知道。 既然没有加壳那就在IDA中打开看下: 主函数没有实质性代码,跟进sub_401100。 发现两处关键代码: 1、?W?h?a?t h?a?p?p?e?n? memset(&Dst, 0, 0xB8u); sub_401620(&Dst, v5, v6, v7, v8); LOBYTE(v53) = 3; if ( v32[*(_DWORD *)(Dst + 4 )] & 6 ) { v9 = sub_402A00(std::cerr, " ?W?h?a?t h?a?p?p?e?n? " , sub_402C50); std::basic_ostream < char ,std::char_traits< char >>:: operator << (v9, v10); exit( - 1 ); } 2、" =W=r=o=n=g=K=e=y=" OR "Congrats You got it!" if ( sub_4020C0(v12, v45, v13, v48) ) { v28 = sub_402A00(std::cout, " =W=r=o=n=g=K=e=y= " , sub_402C50); }

【pytorch报错解决】expected input to have 3 channels, but got 1 channels instead

大城市里の小女人 提交于 2020-11-11 15:08:51
遇到的问题 数据是png图像的时候,如果用PIL读取图像,获得的是单通道的,不是多通道的。虽然使用opencv读取图片可以获得三通道图像数据,如下: def __getitem__(self, idx): image_root = self.train_image_file_paths[idx] image_name = image_root.split(os.path.sep)[-1] image = cv.imread(image_root) if self.transform is not None: image = self.transform(image) label = ohe.encode(image_name.split('_')[0]) return image, label 但是会出现报错: TypeError: img should be PIL Image. Got <class 'numpy.ndarray'> File "c:/Users/pprp/Desktop/pytorch-captcha-recognition-master/captcha_train.py", line 77, in <module> main(args) File "c:/Users/pprp/Desktop/pytorch-captcha-recognition

护网杯2019 mergeheap --pwn

北战南征 提交于 2020-11-10 06:43:21
护网 又是签到 一天 这道题一开始 不懂得如何泄露 libc 信息,就蒙了 后来群里师傅也是刚刚好 做出 到这里 我就接着做了 。 先看下保护,发现 全开了 然后 就看下流程 大概 就是添加 chunk show 合并两个chunk 可利用的 洞就是 int merge() { int v1; // ST1C_4 signed int i; // [rsp+8h] [rbp-18h] int index1; // [rsp+Ch] [rbp-14h] int index2; // [rsp+10h] [rbp-10h] for ( i = 0 ; i <= 14 && ptr_array[i]; ++ i ) ; if ( i > 14 ) return puts( " full " ); printf( " idx1: " ); index1 = sub_B8B(); if ( index1 < 0 || index1 > 14 || ! ptr_array[index1] ) return puts( " invalid " ); printf( " idx2: " ); index2 = sub_B8B(); if ( index2 < 0 || index2 > 14 || ! ptr_array[index2] ) return puts( " invalid " );

【报错相关】TypeError: softmax() got an unexpected keyword argument 'axis'

好久不见. 提交于 2020-11-01 15:02:15
出现这个问题,有几种解决办法,可以调低一下keras的版本,比如: pip install keras==2.1 不过还有个更方便的方法,从错误可知softmax中不包含axis这个参数,那么把axis参数替换成dim就可以了。源代码是这样的: def softmax(x, axis=-1): """Softmax of a tensor. # Arguments x: A tensor or variable. axis: The dimension softmax would be performed on. The default is -1 which indicates the last dimension. # Returns A tensor. """ return tf.nn.softmax(x, axis=axis) 更改成这样: def softmax(x, axis=-1): """Softmax of a tensor. # Arguments x: A tensor or variable. axis: The dimension softmax would be performed on. The default is -1 which indicates the last dimension. # Returns A tensor. """

hillstone现场故障处理指导手册

こ雲淡風輕ζ 提交于 2020-10-28 11:54:40
hillstone 现场故障处理指导手册 目 录 1 Hillstone厂商联系方式... 4 2 进行用户环境调查... 5 3 故障处理基本思路... 6 3.1 检查设备工作是否正常... 6 3.1.1 查状态灯... 6 3.1.2 查能否管理... 7 3.1.3 口令丢失情况下的处理... 7 3.1.4 查故障现象... 7 3.2 查软件版本... 7 3.3 查设备周边情况,排除外围因素... 7 3.3.1 检测方法... 8 3.3.1.1 移除设备... 8 3.3.1.2 单独测试... 8 4 各类故障处理... 9 4.1 硬件故障... 9 4.1.1 扩展模块故障处理... 9 4.1.2 冷却系统故障处理... 9 4.1.3 电源系统故障处理... 9 4.1.4 Console配置系统故障处理... 9 4.2 不通... 10 4.2.1 二层及以下层... 10 4.2.1.1 物理链路... 10 4.2.1.2 数据链路... 11 4.2.1.3 Vlan. 14 4.2.1.4 ARP. 15 4.2.2 三层... 17 4.2.2.1 路由测试... 17 4.2.3 应用... 18 4.2.3.1 策略... 19 4.2.3.2 特殊应用... 20 4.2.4 设备测试License到期重启问题... 20 4.3

2005考研英语小作文

一笑奈何 提交于 2020-10-28 03:02:33
2005英语写作练习 开始准备写作背诵,早上听了下九宫格写作,准备现学现卖 Directions: Two months ago you got a job as an editor for the magazine Designs & Fashions. But now you find that the work is not what you expected. You decide to quit. Write a letter to your boss, Mr. Wang, telling, him your decision, stating your reason(s), and making an apology. Write your letter with no less than 100 words. Write it neatly on ANSWER SHEET 2. Do not sign your own name at the end of the letter; use "Li Ming" instead. You do not need to write the address. 练习选自王江涛高分写作(略有修改地默写) 方法来源九宫格写作 应用文( 辞职信+道歉信 ) 这是一篇小作文,字数控制100左右 何为九宫格:大体如下(要学会灵活变通使用)