The Fair Inc. administration decided to promote the best employees and dịch - The Fair Inc. administration decided to promote the best employees and Việt làm thế nào để nói

The Fair Inc. administration decide

The Fair Inc. administration decided to promote the best employees and limited the number of promotions to a fixed interval [A; B]. The directors compared the employees’ performance and their evaluations resulted in a consistent precedence relation among employees, which has to be respected by promotions. This means that, for every pair of employees x and y, if x outperformed y, then y may be promoted only if x is promoted.
In order to understand whether the data collected so far is enough for ensuring fairness, the executive chairman wants to know:
• How many employees will certainly be promoted in the interval endpoints (i.e., if the number of promotions is A and if the number of promotions is B).
• How many employees have no possibility of being promoted (even if the number of promotions is B). Consider the example depicted in the figure. There are seven employees and eight precedence rules. An arrow from an employee x to an employee y means that x outperformed y. The number of promotions is limited to the interval [3; 4]. Therefore:
• If there are only three promotions, the promoted employees must be: – either Anne, Bob and Greg, – or Anne, Eve and Greg.
In this case, two employees (Anne and Greg) will certainly be promoted. Notice that, with the current information, Bob and Eve may or may not win a promotion.
• If there are four promotions, the promoted employees have to be: – Anne, Bob, Eve and Greg.
So, with four promotions, four employees (Anne, Bob, Eve and Greg) will certainly be promoted and three employees (Cora, Dan and Fred) have no possibility of being promoted.
1 Task
Write a program that, given the interval of the number of promotions, the set of employees and the precedence relation among them, computes, for each of the interval endpoints, the number of employees that will certainly be promoted, and the number of employees that have no possibility of being promoted. The precedence relation is consistent in the sense that, if an 1 employee x outperformed an employee y, y did not outperform (directly or indirectly) x.
2 Input
The first line of the input has four space separated integers:A, B, E, and P. A and B are the interval endpoints, E is the number of employees and P is the number of precedence rules. Employees are identified by integers, ranging from 0 to E-1. Each of the following P lines contains two distinct space separated integers, x and y, which indicate that employee x outperformed employee y.
3 Constraints
1 ≤ A < B < E Interval endpoints.
2 ≤ E ≤ 5000 Number of employees.
1 ≤ P ≤ 20000 Number of precedence rules.
4 Output
The output consists of three lines. The first line contains the number of employees that will certainly be promoted if there are A promotions. The second line contains the number of employees that will certainly be promoted if there are B promotions. The third line contains the number of employees that have no possibility of being promoted (even if there are B promotions).
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
The Fair Inc. administration decided to promote the best employees and limited the number of promotions to a fixed interval [A; B]. The directors compared the employees’ performance and their evaluations resulted in a consistent precedence relation among employees, which has to be respected by promotions. This means that, for every pair of employees x and y, if x outperformed y, then y may be promoted only if x is promoted.In order to understand whether the data collected so far is enough for ensuring fairness, the executive chairman wants to know:• How many employees will certainly be promoted in the interval endpoints (i.e., if the number of promotions is A and if the number of promotions is B).• How many employees have no possibility of being promoted (even if the number of promotions is B). Consider the example depicted in the figure. There are seven employees and eight precedence rules. An arrow from an employee x to an employee y means that x outperformed y. The number of promotions is limited to the interval [3; 4]. Therefore:• If there are only three promotions, the promoted employees must be: – either Anne, Bob and Greg, – or Anne, Eve and Greg.In this case, two employees (Anne and Greg) will certainly be promoted. Notice that, with the current information, Bob and Eve may or may not win a promotion.• If there are four promotions, the promoted employees have to be: – Anne, Bob, Eve and Greg.So, with four promotions, four employees (Anne, Bob, Eve and Greg) will certainly be promoted and three employees (Cora, Dan and Fred) have no possibility of being promoted.1 TaskWrite a program that, given the interval of the number of promotions, the set of employees and the precedence relation among them, computes, for each of the interval endpoints, the number of employees that will certainly be promoted, and the number of employees that have no possibility of being promoted. The precedence relation is consistent in the sense that, if an 1 employee x outperformed an employee y, y did not outperform (directly or indirectly) x.2 InputThe first line of the input has four space separated integers:A, B, E, and P. A and B are the interval endpoints, E is the number of employees and P is the number of precedence rules. Employees are identified by integers, ranging from 0 to E-1. Each of the following P lines contains two distinct space separated integers, x and y, which indicate that employee x outperformed employee y. 3 Constraints1 ≤ A < B < E Interval endpoints.2 ≤ E ≤ 5000 Number of employees.1 ≤ P ≤ 20000 Number of precedence rules.4 OutputThe output consists of three lines. The first line contains the number of employees that will certainly be promoted if there are A promotions. The second line contains the number of employees that will certainly be promoted if there are B promotions. The third line contains the number of employees that have no possibility of being promoted (even if there are B promotions).
đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2024 I Love Translation. All reserved.

E-mail: