bitset的用途挺多的,是一个比较骚的常数优化 一.很多位数的二进制数 poj 2443 http://poj.org/problem?id=2443 直接开个1万位的二进制数,求交就行了. 有关集合求并交的时候可以考虑biset优化 #include<bitset> #include<cstdio> #define REP(i, a, b) for(register int i = (a); i < (b); i++) #define _for(i, a, b) for(…
题目传送门 sol1:用bitset来维护,其实感觉挺暴力的,不怎么会用bitset,借着这道题学习一下. bitset暴力维护 #include "bits/stdc++.h" #define debug puts("what the fuck"); using namespace std; ; char s[MAXN]; bitset<> bs[][MAXN]; int main() { int n, m, q; scanf("%d%d&q…
Matrix multiplication Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Problem Description Given two matrices A and B of size n×n, find the product of them. bobo hates big integers. So you are only asked to find t…
GT and set Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description You are given N sets.The i−th set has Ai numbers. You should divide the sets into L parts. And each part should have at least one numbe…
自己写的一个SqlHelper,感觉使用起来挺方便的 using System; using System.Data; using System.Collections.Generic; using System.Configuration; using System.Text; using System.IO; using System.Data.SqlClient; namespace NdfDeviceNetC { public class SqlHelper { //数据库连接字符串 p…
题目链接 http://codeforces.com/gym/100917/problem/J Description standard input/outputStatements The jury of Berland regional olympiad in informatics does not trust to contest management systems, so the Berland regional programming contest is judged by th…