First, the numbers are arranged in ascending order. If there is no leading zero and an odd number, the numbers are output directly. If there is a leading zero,-1 is output. In addition, if the ending number is an even number, find the first odd number from the back to the front, move the number behind it one time forward, and put the odd number to the end.
It is worth noting that when the input is 960, this method will obtain a number with a leading zero. Therefore, it is necessary to determine
which is satisfied above conditions, please output the biggest one. Otherwise, output "-1" instead. Sample input30 1 335 4 232 4 6 Sample Output301425-1 Source bestcoder round #11 (div. 2) algorithm analysis: giving you n numbers allows n numbers to form a qualified digital output. If the group does not come out, the output is-1. condition 1. an odd number. Condition 2. No leading 0. Condition 3. ensure the maximum number of items that meet the first two conditions! Algorithm Implementation:
First enumerate each number, see it before there are several smaller than it, calculate and for sum1, behind a few bigger than it, calculate and for sum2, the contribution of the answer for A[I]*SUM1*SUM2.After discretization, the tree array is available.is upside down, along one side, statistics OK, discrete is for size, order (easy to go heavy)1#include 2#include 3#include 4#include 5#include 6#include 7 #defineMoD 192608178 #defineN 3000079 #definell Long LongTen using namespacestd; One A in
Question link: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 5055
Problem descriptionrecently, Bob has been thinking about a math problem.
There are n digits, each digit is between 0 and 9. You need to use this n digits to constitute an integer.
This integer needs to satisfy the following conditions:
1. Must be an odd integer.
2. There is no leading zero.
3. Find the biggest one which is satisfied 1, 2.
Example:
There are three digits: 0, 1,
Topics Link: http://acm.hdu.edu.cn/showproblem.php?pid=5055Problem descriptionrecently, Bob had been thinking about a math problem.There is N Digits, each digit is between 0 and 9. You need to use this N Digits to constitute an Integer.This Integer needs to satisfy the following conditions:
1. Must is an odd Integer.
2. There is no leading zero.
3. Find the biggest one which is satisfied 1, 2.
Example:There is three digits:0, 1, 3. It can constitute six number of integers.
Bob and Math Problem
Time Limit: 2000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 401 accepted submission (s): 149Problem descriptionrecently, Bob has been thinking about a math problem.
There are n digits, each digit is between 0 and 9. You need to use this n digits to constitute an integer.
This integer needs to satisfy the following conditions:
1. Must be an odd integer.
2. There is no leading zero.
3. Find the biggest one which is
,so can live a long time, may wish to take the answer to **19260817**Sample InputExample 141 2 3 4Example Two106 8 4 1 3 0 7 5 9 2Sample OutputSample Output 150Sample Output 21737Sample explanationFor example 1There is an ordered column that satisfies the criteria{1,2,3}--6{1,2,4}--8{1,3,4}--12{2,3,4}--24Ans=6+8+12+24=50Data range30% of Data n60% of Data n100% of Data n0———————————————————————————we can consider the answer to the two-tuple question first.so consider a single I with I as the end
accessed through the extranet IP.To turn on NAT:Global (outside) 1 interfaceNat (inside) 1 192.168.3.0 255.255.255.0Do port mapping:static (inside,outside) TCP interface 192.168.3.222 3389 netmask 255.255.255.255To do access control for an external network port:Access-list outside_access Extended permit IP any anyAccess-group Outside_access in Interface OutsideThe above directive realizes, the external network user accesses the internal terminal through the public network IP, but the intranet u
One of the most important features for a firewall product is logging events. This blog will show you how to log management and analysis of the ASA, the principle and configuration of ASA transparent mode, and implement URL filtering using the iOS features of the ASA firewall.First, URL filteringWith the feature URL filtering of the
Cisco ASA Advanced Configuration first, to prevent IP Shard Attack 1 , Ip the principle of sharding; 2 , Ip security issues with sharding; 3 , Prevention Ip Shards. these three questions have been described in detail before and are not introduced here. For more information, please check the previous article:IP sharding principle and analysis. Second, URL Filter Use ASA Firewall IOS the characteristics URL
1. The targets of ASE and ASA are different.The Sybase Database Engine has three products:The ASA lightweight database server is suitable for mobile computing (PDA, mobile phones with operating systems, etc.), Embedded Computing (POS machines, routers, etc.), and working group-level OLTP environments, especially for mobile computing and Embedded ComputingASE enterprise and database server, suitable for ente
The global. Asa file is an optional file in which you can specify event scripts and declare objects with sessions and application scopes. Content of this file
It is used to store event information and objects globally used by applications. The file name must be global. Asa and must be stored in the Application
In the root directory. Each application can have only one global.
The global. Asa file is an optional file in which you can specify the event script and declare a session and ApplicationProgramScope object. Content of this fileIt is used to store event information and objects globally used by applications. The file name must be global. Asa and must be stored in the ApplicationIn the root directory. Each application can have only one global.
For many years, Cisco PIX has been a firewall established by Cisco. In May 2005, however, Cisco launched a new product, the Asa,adaptive security appliance, as an adaptive safety product. However, PIX is still available. I've heard a lot of people asking about the difference between the two product lines on a number of occasions. Let's take a look.
What is Cisco pix?
CISCO Pix is a dedicated hardware firewall. All versions of Cisco PIX have a 500-seri
For many years, Cisco PIX has been a firewall established by Cisco. In May 2005, however, Cisco launched a new product, the Asa,adaptive security appliance, as an adaptive safety product. However, PIX is still available. I've heard a lot of people asking about the difference between the two product lines on a number of occasions. Let's take a look.
What is Cisco pix?
CISCO Pix is a dedicated hardware firewall. All versions of Cisco PIX have a 500-se
ASA-防火墙-cisco
The role of the ASA firewall1, in the network to isolate dangerous traffic, no point.The principle of the ASA firewall1. Distinguish different areas by security level: internal area, external area, demilitarized zone.By default: High-level traffic can go to lower levels,Low-level traffic can not go to high-level,The same level of unb
Topics:Handing fragmented traffic:reassemble all the fragments of a packet to inspect the contentsPrioritizng Traffic:Controlling traffic bandwidth:traffic policing traffic shapingPackets coming into a ASA may be fragmented or whole. The same security policies that inspect whole packets aren ' t as effective when inspecting fragments. An ASA can be configuredTo intercept packet fragments, and virtually rea
Release date:Updated on: 2013-06-27
Affected Systems:Cisco Next-Generation FirewallDescription:--------------------------------------------------------------------------------CVE (CAN) ID: CVE-2013-3382Cisco ASA Next-Generation Firewall is a Next-Generation Firewall product. It is an additional service module that extends the ASA platform.The implementation of Cisco ASA
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.