摘要: int cal(char *s){ return s[0]<<16 | s[1]<<8 | s[2]; } int main() { char s[3]; s[0]=0;s[1]=2;s[2]=0x9a; cout<<cal(s); } 为什么cal(s)= -102? 阅读全文
posted @ 2022-04-16 19:55 megadeth 阅读(20) 评论(0) 推荐(0) 编辑
摘要: #include<map> #include<set> #include<cmath> #include<stack> #include<queue> #include<cstdio> #include<string> #include<vector> #include<cstring> #incl 阅读全文
posted @ 2019-11-16 20:43 megadeth 阅读(147) 评论(0) 推荐(0) 编辑
摘要: #include<map> #include<set> #include<cmath> #include<stack> #include<queue> #include<cstdio> #include<string> #include<vector> #include<cstring> #incl 阅读全文
posted @ 2019-11-10 14:32 megadeth 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 链接:https://vjudge.net/problem/UVA 1601 题目大意 有一个大小h w的迷宫鬼屋,鬼屋中有障碍和鬼,万圣节过后鬼屋有n(n include include include include include include include include include 阅读全文
posted @ 2019-10-12 16:20 megadeth 阅读(104) 评论(0) 推荐(0) 编辑
摘要: void euler() { for(int i=2;i<maxn;i++){ if(!E[i]) for(int j=i;j<maxn;j+=i){ if(!E[j])E[j]=j; E[j]=E[j]/i*(i-1); } } } 欧拉函数 int euler(int n) { int ans= 阅读全文
posted @ 2019-10-04 10:07 megadeth 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Relocation 链接: POJ - 2923 题目大意: 给你两辆车,每辆车有额定载重c1,c2,再给你n件物品(n<=10)的重量wi,每次都用两辆车往返运输,求最小的次数. 思路:看到n的数量很小,先想到暴力,可以枚举每次装车的情况,判断是否成立.先对装车的情况进行状态压缩,0代表不装,1 阅读全文
posted @ 2019-08-15 22:31 megadeth 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 一: 1 #include<bits/stdc++.h> 2 #define INF 0x3f3f3f3f 3 #define MAXN 50000 4 #define ia (i+1)%2 5 #define ib i%2 6 typedef long long ll; 7 using names 阅读全文
posted @ 2019-08-13 09:40 megadeth 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 第23次理解了,一个讲的不错的博客:https://blog.csdn.net/starstar1992/article/details/54913261#commentBox char str[MAXN],s[MAXN]; int next[MAXN]; void get_next(char *s 阅读全文
posted @ 2019-08-11 09:42 megadeth 阅读(106) 评论(0) 推荐(0) 编辑
摘要: ```cpp include include include include include include include include include define INF 0x3f3f3f3f define MAXN 1000 define P 13331 ///可自定义大小 using n 阅读全文
posted @ 2019-08-10 19:41 megadeth 阅读(125) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-08-09 22:27 megadeth 阅读(7) 评论(0) 推荐(0) 编辑