上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 27 下一页
摘要: #include#includeusing namespace std;#define nc getcharint n,q;bitset S[10002];/*快速输入*/inline int red(){ int res=0,f=1;char ch=nc();... 阅读全文
posted @ 2018-10-15 20:37 Mercury_Lc 阅读(96) 评论(0) 推荐(0)
摘要: bitset定义与初始化bitset是STL提供的用于记录01串的容器也就是bitset的每个元素只能为0/1用bitset之前别忘了: #include1以下是正确的定义方式: bitset a; //第0~15位都是0bitset b(string("01001... 阅读全文
posted @ 2018-10-15 20:34 Mercury_Lc 阅读(162) 评论(0) 推荐(0)
摘要: & 与 (都是1时,结果才为1)表示按位与。&表示按位与操作,我们通常使用0x0f来与一个整数进行&运算,来获取该整数的最低4个bit位,例如,0x31 & 0x0f的结果为0x01。二进制与运算规则:1&1=1 1&0=0 0&0=0| 或 (只要有1,那么就... 阅读全文
posted @ 2018-10-15 20:19 Mercury_Lc 阅读(470) 评论(0) 推荐(0)
摘要: bitset存储二进制数位。bitset就像一个bool类型的数组一样,但是有空间优化—bitset中的一个元素一般只占1 bit,相当于一个char元素所占空间的八分之一。bitset中的每个元素都能单独被访问,例如对于一个叫做foo的bitset,表达式foo[3... 阅读全文
posted @ 2018-10-15 19:53 Mercury_Lc 阅读(139) 评论(0) 推荐(0)
摘要: K 正方形(SDUT 2444)import java.lang.reflect.Array;import java.util.*;public class Main { public static void main(String[] args) { S... 阅读全文
posted @ 2018-10-15 11:33 Mercury_Lc 阅读(125) 评论(0) 推荐(0)
摘要: G 织女的红线(SDUT 2240)import java.util.Scanner;import java.text.DecimalFormat;class Sum { double x1, y1, x2, y2; Sum(double n1, double ... 阅读全文
posted @ 2018-10-12 21:24 Mercury_Lc 阅读(119) 评论(0) 推荐(0)
摘要: #include using namespace std;int a[1000006];int b[1000006];int sta[100006];int main(){ int t,n,i,j,top; while(~scanf("%d",&t)) ... 阅读全文
posted @ 2018-10-12 21:06 Mercury_Lc 阅读(400) 评论(0) 推荐(0)
摘要: #include using namespace std;int a[1005];int main(){ int t,n,i,j; while(~scanf("%d",&t)) { while(t--) { ... 阅读全文
posted @ 2018-10-12 21:05 Mercury_Lc 阅读(256) 评论(0) 推荐(0)
摘要: 题解:把每一步计算的答案再存在栈里面,直到计算结束。 如果是操作数 那么直接入栈;如果是运算符,那么把栈里面最顶部的两个操作数拿出来进行运算,运算结果再放入到栈里面,计算完所有的(#之前的长度位len- 1)就可以了。#include using n... 阅读全文
posted @ 2018-10-12 21:03 Mercury_Lc 阅读(190) 评论(0) 推荐(0)
摘要: 题目链接#include using namespace std;typedef long long ll;int ok(char ch, char sh){ if(sh == '(')return 1; if((ch == '*' || ch == '/... 阅读全文
posted @ 2018-10-12 20:54 Mercury_Lc 阅读(197) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 27 下一页