Professional Documents
Culture Documents
• Second
• Third
• Fourth
• Fifth
• Sixth
Attempt No 1
Problem 1: Susan' GCD
Input:
The first line of the input file contains a number
representing the
number of lines to follow. Each line consists of two
numbers A and B
(0 <= A <= 40000 and A <= B < 10^250).
Output:
Print for each pair (A,B) in the input one integer
representing the
GCD of A and B.
Example:
Input:
2
2 6
10 11
Output:
2
1
Filename:
Submit
Attempt No 1
language of computers.
For example the words '01', '110', and '0010' are prime,
while the words
prime words which you can form from exactly x 1s and y 0s.
Input:
Output:
Example:
Input:
2 2
Output:
Filename:
Submit
Attempt No 1
Problem 3: NSA Servers Efficiency
Input:
The first line of input contains a single integer, N, the
number of test
cases.
N test cases follow.
Each test case description will start with a line that
contains an integer
L --
the number of lines that describe a decision tree. The next
L lines will
contain
a decision tree in the format described above. The line
after that will
contain
A -- the number of servers. The next A lines will each
contain the
description of
one server in the following format.
server n attribute1 attribute2 ... attributen
Output:
For each test case, output one line containing "Case #x:"
followed by
exactly A
lines, one per server, in the same order as they appear in
the input.
Each line
should contain the efficiency of server. Answers that are
precise to
within an
absolute or relative error of 10-6 will be considered
correct.
Limits
1 ≤ N ≤ 100
All weights will be between 0 and 1, inclusive.
All weights will consist of only digits with at most one
decimal point.
The weights will not start or end with a decimal point.
The weights will not have more than one 0 before a decimal
point.
All servers and attributes will consist of between 1 and 10
lower case
English
letters.
All server names within a test case will be distinct.
All attribute names for a single server will be distinct.
Each of the L lines in a decision tree definition will have
at most 80
characters,
not including the endlines.
Small dataset
1 ≤ L ≤ 10
1 ≤ A ≤ 10
0 ≤ n ≤ 5
Large dataset
1 ≤ L ≤ 100
1 ≤ A ≤ 100
0 ≤ n ≤ 100
Example:
Input:
1
7
(0.084016 pj
(0.680189 hd
(0.465482)
(0.912155)
)
(0.066448)
)
8
yad 0
ljxslm 2 hd pj
yuufr 2 hd pj
qqdtg 0
vkmqyd 1 hd
tubm 2 hd pj
ddm 2 hd pj
okwes 1 hd
Output:
Case #1:
0.00558270
0.02660079
0.02660079
0.00558270
0.00558270
0.02660079
0.02660079
0.00558270
Filename:
Submit
Attempt No 1
Problem 4: TRANSLTR At Work !!
every new permutation as they went. The hope was that even
codes within
thinkably colossal pass-
Input:
Input will consist of multiple input sets. Each set will
consist of a
single line of at most 5000 digits representing a valid
encryption
(for example, no line will begin with a 0). There will be
no spaces
between the digits. An input line of ‘0’ will terminate the
input and
should not be processed.
Output:
For each input set, output the number of possible decoding
for the input
string. All answers will be within the range of a 64 bit
signed integer.
Example:
Input:
25114
1111111111
3333333333
0
Output:
6
89
1
Filename:
Submit
Attempt No 1
Problem 5: Hacking NSA security
Output:
For each test case, output all the m-length security gates
starting
from k in sl .
Example:
Input:
1
1 2 2
Output:
))
Filename:
Submit
Attempt No 1
Problem 6: National SecurityAgency Selection Test
Input:
The first line of input contains an integer T, the number
of test
cases in the input. T lines follow, one for each test case,
each
containing a single integer N.
Output:
For each test case, output
Case #X: K
where X is the test case number, starting from 1, and K is
the next
integer in the list.
Limits
Small dataset
1 ≤ T ≤ 50
1 ≤ N ≤ 106
Large dataset
1 ≤ T ≤ 500
1 ≤ N ≤ 1020
Examples:
Input:
1
118, 181, 811
Output:
Case #1: 1018
Filename:
Submit
No 1 : 0
No 2 : 0
No 3 : 0
No 4 : 0
No 5 : 0
No 6 : 0
Total Marks : 0
Reply Forward
Reply
|
Ambuj ---------- Forwarded message ---------- From: Ambuj pandey 5:24 PM (9
pandey <talk2ap001@gmail.... minutes ago)
to Apaar
- Show quoted text -
• First
• Second
• Third
• Fourth
• Fifth
• Sixth
Attempt No 1
Problem 1: Susan' GCD
Input:
The first line of the input file contains a number
representing the
number of lines to follow. Each line consists of two
numbers A and B
(0 <= A <= 40000 and A <= B < 10^250).
Output:
Print for each pair (A,B) in the input one integer
representing the
GCD of A and B.
Example:
Input:
2
2 6
10 11
Output:
2
1
Filename:
Submit
Attempt No 1
language of computers.
Computers use only 2 alphabet symbol 1 and 0 to make
words. A given word
For example the words '01', '110', and '0010' are prime,
while the words
prime words which you can form from exactly x 1s and y 0s.
Input:
Output:
Example:
Input:
2 2
Output:
Filename:
Submit
Attempt No 1
Problem 3: NSA Servers Efficiency
Input:
The first line of input contains a single integer, N, the
number of test
cases.
N test cases follow.
Each test case description will start with a line that
contains an integer
L --
the number of lines that describe a decision tree. The next
L lines will
contain
a decision tree in the format described above. The line
after that will
contain
A -- the number of servers. The next A lines will each
contain the
description of
one server in the following format.
server n attribute1 attribute2 ... attributen
Output:
For each test case, output one line containing "Case #x:"
followed by
exactly A
lines, one per server, in the same order as they appear in
the input.
Each line
should contain the efficiency of server. Answers that are
precise to
within an
absolute or relative error of 10-6 will be considered
correct.
Limits
1 ≤ N ≤ 100
All weights will be between 0 and 1, inclusive.
All weights will consist of only digits with at most one
decimal point.
The weights will not start or end with a decimal point.
The weights will not have more than one 0 before a decimal
point.
All servers and attributes will consist of between 1 and 10
lower case
English
letters.
All server names within a test case will be distinct.
All attribute names for a single server will be distinct.
Each of the L lines in a decision tree definition will have
at most 80
characters,
not including the endlines.
Small dataset
1 ≤ L ≤ 10
1 ≤ A ≤ 10
0 ≤ n ≤ 5
Large dataset
1 ≤ L ≤ 100
1 ≤ A ≤ 100
0 ≤ n ≤ 100
Example:
Input:
1
7
(0.084016 pj
(0.680189 hd
(0.465482)
(0.912155)
)
(0.066448)
)
8
yad 0
ljxslm 2 hd pj
yuufr 2 hd pj
qqdtg 0
vkmqyd 1 hd
tubm 2 hd pj
ddm 2 hd pj
okwes 1 hd
Output:
Case #1:
0.00558270
0.02660079
0.02660079
0.00558270
0.00558270
0.02660079
0.02660079
0.00558270
Filename:
Submit
Attempt No 1
Problem 4: TRANSLTR At Work !!
every new permutation as they went. The hope was that even
codes within
thinkably colossal pass-
Input:
Input will consist of multiple input sets. Each set will
consist of a
single line of at most 5000 digits representing a valid
encryption
(for example, no line will begin with a 0). There will be
no spaces
between the digits. An input line of ‘0’ will terminate the
input and
should not be processed.
Output:
For each input set, output the number of possible decoding
for the input
string. All answers will be within the range of a 64 bit
signed integer.
Example:
Input:
25114
1111111111
3333333333
0
Output:
6
89
1
Filename:
Submit
Attempt No 1
Problem 5: Hacking NSA security
Strathmore has been caught wanting by Ernie Tankoda, as
Strathmore has
run the Digital Fortress, a junk of malicious code from
Tankoda. All
the gates are being broken one-by-one and only a few have
been left.
Input:
The first line specifies the number of test cases t.
For each test case, two integers: 1<=k<=109, 1<=l<=109,
1<=m<=40000.
Output:
For each test case, output all the m-length security gates
starting
from k in sl .
Example:
Input:
1
1 2 2
Output:
))
Filename:
Submit
Attempt No 1
Problem 6: National SecurityAgency Selection Test
Input:
The first line of input contains an integer T, the number
of test
cases in the input. T lines follow, one for each test case,
each
containing a single integer N.
Output:
For each test case, output
Case #X: K
where X is the test case number, starting from 1, and K is
the next
integer in the list.
Limits
Small dataset
1 ≤ T ≤ 50
1 ≤ N ≤ 106
Large dataset
1 ≤ T ≤ 500
1 ≤ N ≤ 1020
Examples:
Input:
1
118, 181, 811
Output:
Case #1: 1018
Filename:
Submit
No 1 : 0
No 2 : 0
No 3 : 0
No 4 : 0
No 5 : 0
No 6 : 0
Total Marks : 0
Reply
to me
Delivery to the following recipient failed permanently:
undisputed.don@gmail.com
Return-Path: <talk2ap001@gmail.com>
Received-SPF: pass (google.com: domain of talk2ap001@gmail.com designates
10.229.90.68 as permitted sender) client-ip=10.229.90.68;
Authentication-Results: mr.google.com; spf=pass (google.com: domain of
talk2ap001@gmail.com designates 10.229.90.68 as permitted sender)
smtp.mail=talk2ap001@gmail.com; dkim=pass header.i=talk2ap001@gmail.com
Received: from mr.google.com ([10.229.90.68])