Hanoi University of Technology
Students: LE XUAN HAI.
Test Overview
Bai1: Scoring
In the oral exam students must answer questions in turn by the teacher.if the correct answer the teacher marked with letters "c" (correct), if he answers incorrectly marked with "n" (no correct). When students answer teacher will make it more difficult question next question before, but if he gives the wrong answer new questions as easy to implement but hon.sau, The response of each student is recognized by a string of characters "c" and "n". Student test results are calculated as follows: for each answer Xai students receive 0 points, also if the student answers correctly receives a score by the number of consecutive correct answers from the longest answer this earlier.
For example, if the test results of students is: "ccnncnnccc" the student's score is:
1 +2 +0 +0 +1 +0 +0 +1 +2 +3 = 10
Requirements: for string recorded the response of the pupil (with length not exceeding 1000 characters), make the point that students have achieved.
Data from text file into a single line SCORE.INP include matching this record the response of the students.
Results: Burn SCORE.OUT a text file containing only the scores that students have achieved.
For example SCORE.INP: CCNNCNNCCC
SCORE.OUT 10
Lesson 2: checkpoints
A rectangular sea area is divided into m row plots are numbered from 1 to m from top to bottom and n columns are numbered from 1 to n from left to phai.lo located at the intersection of row p column q to be called a plot with coordinates (p, q). for the protection of oil rigs at sea who have arranged a number of checkpoints in several lots located in any lo.tram guards have the ability to control lots and 8 lots quanh.mot around the hole in the sea area is considered safe if it is being controlled by at least one guard station.
Requirements: for kicks size of the sea and locations of lots shall be located radar.xac total loss of safety.
Data from text file into a format SAFE.INP as follows:
• The first recorded two integers m, n (m> = 1, n <= 300) respectively of the cave, the number of columns of the sea.
• The first two positive integer k is the number of checkpoints to be arranged.
• The first line I k of the next line contains two positive integers p, q are the coordinates of the plot hung I.
Results: Write a text file SAE.OUT a positive integer is the total number of lots safe.
Eg
SAFE.INP | SAFE.OUT |
8 8 4 1 1 2 4 4 1 4 3 | 23 |
No comments:
Post a Comment