PDP-18 (2006) - Phase C' - 3 (practice) **

View as PDF

Submit solution

Points: 35 (partial)
Time limit: 5.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
C, C++, Java, Pascal, Python

PRACTICE EXERCISE

The Hellenic Society of Computer Scientists and IT Professionals (EPY) has been responsible for coordinating the internship program for students of Computer Engineering, Computer Science, and Telecommunications departments of Greek Universities since the Academic Year 2006-07. In the internship program, N students from the respective departments participated (4 \le N \le 1\,000). The available internship positions are M (N \le M \le 1\,500). Table P [I, J] has a value of 1 if student I is interested in position J and 0 otherwise.

You are asked to develop a program in one of the IOI languages that ensures internship for as many students as possible.

INPUT DATA

The file practice.in on the first line contains two numbers: the number N of interested students and the number M of available positions separated by a space. Each of the next N lines contains M digits 0 or 1, separated by a space, representing the declarations of students for the respective positions.

OUTPUT DATA

The file practice.out contains one line with N numbers, each number lying in the range [0 .. M]. The first number indicates the position that the first student will occupy, the second number the position that the second student will occupy, and so on. (A student with number 0 means that he did not find a position for his internship).

Example of Input - Output Data

STDIN (practice.in)

4 5
1 0 1 1 0
1 0 0 0 0
0 1 1 0 0
0 0 0 1 0

STDOUT (practice.out)

3 1 2 4

Maximum execution time for each test: 5 sec.


Comments

There are no comments at the moment.