What is your IPProblem code: DSPCXI01 |
All submissions for this problem are available.
The IP Address Class defines the number of networks and IP addresses that are available to an organization for use. An IP Address is comprised of 32 bits (4 octets) of information. The IP address is working with two pieces of information: the network ID and the host ID. Based on the number of network and hosts the IP Addresses have been divided into different classes – A, B, C, D & E.
Currently the NetTech team is conducting its certification course at BIT Mesra. Ayush Kedia is a first year student and has little knowledge of networking. However the test is coming up and he needs your help to top the list. He has a list of IPs which has to be classified based on the IP Addresses. Your job is to write a program that will print the class of the given IP Address.
Problem Setter: Vishal Gupta
Input:
The input contains a series of IP addresses, each beginning in a new line.
Output:
For each IP Address print the class of the IP Address each in a single line. Print ‘Invalid’ for any invalid entry.
Input: 192.168.102.11 10.87.78.0 189.09.89.98 225.78.98.89 25.98.268.09 0.0.0.0
Output: Class C Class A Class B Class D Invalid Invalid
| Author: | ganesha |
| Date Added: | 19-02-2011 |
| Time Limit: | 1 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC |
Comments

Fetching successful submissions

please visit
please visit http://dreamsparkyatra.mstc-india.com/whatisyourip.html to view the problem statement.
@gupta 0.0.0.0 is consider
@gupta
0.0.0.0 is consider to be valid address
correct me if i m wrong
plz clarify...what are
plz clarify...what are classes and how do we have to assign classes...??.....
your redirecting us from here to the site ...is troubling....plz do the required.....
Please explain the output
Please explain the output
@ALL: We haven't explained
@ALL: We haven't explained the output because it is expected that you know, and in case you don't know you can use wikipedia, infosys campus connect,google, bing, yahoo etc.
@idontknow: I am pretty sure that 0.0.0.0 is invalid. And there are few other cases.
how many inputs????
how many inputs????
Yes plz calrify on the number
Yes plz calrify on the number of inputs?
please clarify ..how many
please clarify ..how many inputs ...???
@admin/any_user: plz provide
@admin/any_user:
plz provide the data for ip address classes used.....because different sites provide different data....and there is no point in trying to find the correct data (this being a programming / algorithmic contest)...
plz...do provide the required...
@admin: plz do atleast reply
@admin:
plz do atleast reply to my previous post......
@anish7766 plz...provide the
@anish7766
plz...provide the data u used for classification...'coz admin is not replying....
Whats with the problem
Whats with the problem statement given in the dreamsparkyatra link?It doesnt make sense.What is the input format?When should we terminate the input?
@Amritpal: I am not sure
@Amritpal: I am not sure about your TLE. But the Output should not take more than 1 sec(that's the limit). It takes 0.1 sec for my program.
@Anish: Guessing the boundary
@Anish: Guessing the boundary inputs and special cases is part of the programming contest. The only authentic source you can rely are on Network Certifications Books/Ebooks/Websites from CISCO/Microsot or Internet Engineering Task Force IETF.
@ALL: Since you people are
@ALL: Since you people are having so much trouble to figure it out and this is just a practice contest, I am giving you the exact details of this question:
Class A : 1.0.0.0 - 127.255.255.255
Class B : 128.0.0.0 - 191.255.255.255
Class C : 192.0.0.0 - 223.255.255.255
Class D : 224.0.0.0 - 239.255.255.255
Class E : 240.0.0.0 - 255.255.255.254
Any other input range is 'Invalid'
@Vishal: AFAIK 127.*.*.* is
@Vishal:
AFAIK 127.*.*.* is not considered class A ip
hey...plz tell the limits
hey...plz tell the limits yaar.. this is amazing..i have designed the program..but dont know the limits..
@Egor: You are right, I am
@Egor: You are right, I am right too. But different Networking Authorites go for different classifications. Some go with 127 as Class A others do not. However, this does not make any difference since, we haven't used any input from that range!
@Rocker: what do you mean by
@Rocker: what do you mean by limits? The Input ends with EOF; and I have mentioned classes, even quoted examples. I once again mention that Input File may contain invalid inputs. Please refer to the General Instructions and Announcements in the Contest Page.
There are people from diff Universities who have correctly solved this question - so don't you think fault somewhere lies within your code?
hey.. wat are the number of
hey.. wat are the number of test cases!!??
@abdul i/p ends with EOF
@abdul i/p ends with EOF
i dont understand the Input
i dont understand the Input format ...??? can i read a file?? ....
@Devraj: You seriously Need
@Devraj: You seriously Need to Work on your input taking strategies. Refer any ACM-ICPC site.
Please register your self at
Please register your self at http://dreamsparkyatra.mstc-india.com/dspc2011register.html to recieve notices, e-certificates etc.
Solutions and i/p o/p files
Solutions and i/p o/p files will be mailed only to contestants who have registered at http://dreamsparkyatra.mstc-india.com/dspc2011register.html by 2nd March.