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. frequentism-and-bayesianism-chs

    frequentism-and-bayesianism-chs 频率主义和贝叶斯主义——一个实用的介绍 此notebook最初出现在博客Pythonic Perambulations的文章.BSD l ...

  2. [工作积累] JNI native 函数签名

    对于一个Java 类 class MyClass { ... public native boolean nativeMyFunc(long param); } 一般来说native对应的声明是这样: ...

  3. 一个奇怪的网络故障 默认网关为0.0.0.0(Windows)

    用IPCONFIG命令看到的情况是这样: Windows IP 配置 以太网适配器 本地连接 : 连接特定的 DNS 后缀 . . . . . . . : 本地链接 IPv6 地址. . . . . ...

  4. Mysql 操作

    MySQL命令行导出数据库:1,进入MySQL目录下的bin文件夹:cd MySQL中到bin文件夹的目录如我输入的命令行:cd C:\Program Files\MySQL\MySQL Server ...

  5. this的使用、继承、super

    1.this的使用 1)可以用于区分局部变量 Person(int age,string name) { this.age=age; this.name=name; } 2)构造方法中,用this调用 ...

  6. php string转换为int

    本身 var_dump : string(3) "002" 本身 is_numeric : bool(true) 本身 转换为数字 : int(2) 本身 转换为数字变量 : in ...

  7. VulToEs

    VulntoES https://github.com/ChrisRimondi/VulntoES

  8. 快速排序 Quick Sort

    自己写的代码,记录一下.分别记录了两种partition的方法. public class QuickSort { public static void quickSort(int[] nums, i ...

  9. hdu2022(water~~)海选女主角

    http://acm.hdu.edu.cn/showproblem.php?pid=2022 二B了,没读题直接错了两次....郁闷 #include <iostream> #includ ...

  10. SSH开发实践part2:双向1-N连接配置

    1 OK,上一篇已经介绍了项目开发的前期准备工作,具体内容可以参考:http://www.cnblogs.com/souvenir/p/3783686.html 按照开发步骤,我们现在已经可以开始进行 ...