4760

数组模拟就可以了 读的时候可以整数读入

 #include <iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stdlib.h>
#include<queue>
#include<cmath>
#include<vector>
using namespace std;
#define LL __int64
int len,maxz;
LL ip[][][],pp[];
int vis[],w[],di[],g;
char s[],s1[],s2[];
void init()
{
int i;
pp[] = ;
for(i = ; i < ; i++)
pp[i] = pp[i-]*;
}
void change(int a)
{
int x[],o=,i;
while(a)
{
x[++o] = a%;
a/=;
}
for(i = ; i <= -o ; i++)
di[++g] = ;
for(i = o ; i>= ; i--)
di[++g] = x[i];
}
LL swit(int k,int e)
{
int i;
LL sum=;
if(k==)
for(i = ; i <= g ; i++)
sum+=di[i]*pp[-i];
else
{
for(i = ; i <= e ; i++)
sum+=di[i]*pp[-i];
for(i = e+ ; i <= ; i++)
sum+=pp[-i];
}
return sum;
}
int main()
{
int m,n,i,j;init();
int a,b,c,d,e;
char cc;
while(scanf("%c",&cc)!=EOF)
{
if(cc=='E')
{
scanf("%d%d",&n,&m);
w[n] = m;
maxz = max(maxz,n);
for(i = ; i <= m ;i++)
{
getchar();
scanf("%d.%d.%d.%d/%d",&a,&b,&c,&d,&e);
g=;
change(a);change(b);change(c);change(d);
ip[n][i][] = swit(,);
ip[n][i][] = swit(,e);
}
}
else if(cc=='F')
{
scanf("%d.%d.%d.%d",&a,&b,&c,&d);
g=;
change(a);change(b);change(c);change(d);
LL fs1 = swit(,);
scanf("%d.%d.%d.%d",&a,&b,&c,&d);
g=;
change(a);change(b);change(c);change(d);
LL fs2 = swit(,);
int flag = ;
for(i = ; i <= maxz ; i++)
{
int f=,ff=;
if(vis[i]) continue;
for(j = ; j <= w[i] ; j++)
{
if(fs1>=ip[i][j][]&&fs1<=ip[i][j][])
f = ;
if(fs2>=ip[i][j][]&&fs2<=ip[i][j][])
ff = ;
}
if(ff&&f)
{
flag = ;
break;
}
}
if(flag)
printf("F\n");
else
printf("D\n");
}
else
{
scanf("%d",&n);
vis[n] = ;
}
gets(s);
}
return ;
}

hdu4760Good Firewall的更多相关文章

  1. Linux学习之八--关闭firewall防火墙安装iptables并配置

    CentOS 7之后默认使用的是firewall作为防火墙,这里改为iptables防火墙,并开启80端口.3306端口. 1.关闭firewall: systemctl stop firewalld ...

  2. Neutron 理解 (9): OpenStack 是如何实现 Neutron 网络 和 Nova虚机 防火墙的 [How Nova Implements Security Group and How Neutron Implements Virtual Firewall]

    学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...

  3. centos7 firewall 防火墙

    在部署dubbo-monitor 和dubbo-admin zookeeper时候,外部访问不了部署好的服务,因为端口问题 ,现在把端口操作总结一下 参考: http://www.cnblogs.co ...

  4. WAF(Web Appliction Firewall) Bypass Technology Research

    catalog . What is Firewall . Detecting the WAF . Different Types of Encoding Bypass . Bypass本质 1. Wh ...

  5. ModSecurity web application firewall (WAF) Research

    catalog . 引言 . OWASP ModSecurity Core Rule Set (CRS) Project . Installation mod_security for Apache ...

  6. centos7 关闭firewall安装iptables并配置

    一.配置防火墙,开启80端口.3306端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop fi ...

  7. CentOS7下Firewall防火墙配置用法详解

    官方文档地址: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide ...

  8. Good Firewall(字典树 HDU4760)

    Good Firewall Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...

  9. centos7 firewall 防火墙 命令

    为了架设ss在vultr上买了一个日本的vps 用的是centos7的系统 防火墙是 firewall 捣鼓了两天 在这里总结一下. 如果小伙伴也准备在vultr上买vps  在注册是 可以使用这个优 ...

随机推荐

  1. vector存入共享内存(了解)

    昨天在上篇blog里描写了如何把STL容器放到共享内存里去,不过由于好久不写blog,发觉词汇组织能力差了很多,不少想写的东西写的很零散,今天刚好翻看自己的书签,看到一篇挺老的文章,不过从共享内存到S ...

  2. Notes on the Dirichlet Distribution and Dirichlet Process

    Notes on the Dirichlet Distribution and Dirichlet Process In [3]: %matplotlib inline   Note: I wrote ...

  3. SQLite中的PRAGMA语句攻略

    原文地址:http://iihero.iteye.com/blog/1189633 PRAGMA语句是SQLITE数据的SQL扩展,是它独有的特性,主要用于修改SQLITE库或者内数据查询的操作.它采 ...

  4. MYSQL注入天书之stacked injection

    第三部分/page-3 Stacked injection Background-8 stacked injection Stacked injections:堆叠注入.从名词的含义就可以看到应该是一 ...

  5. Grid分组特性

    Ext.onReady(function () {                Ext.define('personInfo', {                    extend: 'Ext. ...

  6. PHP 使用 Redis

    PHP 使用 Redis 安装 开始在 PHP 中使用 Redis 前, 我们需要确保已经安装了 redis 服务及 PHP redis 驱动,且你的机器上能正常使用 PHP. 接下来让我们安装 PH ...

  7. leetcode majority number

    给定一组数,有一个数在这组数里的出现次数超过n/2次. 求出这是哪个数 https://leetcode.com/problems/majority-element/ 一开始考虑的方是将所有数转化为二 ...

  8. uva 11324

    Problem B: The Largest Clique Given a directed graph G, consider the following transformation. First ...

  9. Javascript 偏移量总结

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  10. java 以及 vs 的快捷键

    javactrl+shift+y 小写ctrl+shift+x 大写ctrl+shift+f 格式化代码 vsctrl+u 小写ctrl+shift+u 大写ctrl+k+f 格式化代码