AcademicJournal
SRM 235 · 2005-03-22 · by the_one_smiley
Problem Statement
In any field of research, there are many journals to which one can submit an article for publication. One criterion that is commonly used to choose between journals is the impact factor, a measure of the importance of a journal and the papers that are published there. The impact factor of a journal is defined as the average number of citations each paper in that journal receives from papers in other journals. Citations from papers in the same journal are not counted in order to prevent its editors from inflating their impact factor by preferentially accepting papers that cite other papers in their journal. Although impact factors are not a fair way to judge the quality of research, they do provide a quantitative method for comparing journals to each other.
Write a class AcademicJournal with a method rankByImpact that takes a
Notes
- Although it is not supposed to happen, it is possible for two papers to reference each other due to delays in the editing and publishing process.
- A sloppy author or editor of a paper might accidentally include multiple citations to another paper. In your calculation of the impact factors, count citations from one paper to another only once.
Constraints
- papers will contain between 1 and 50 elements, inclusive.
- Each element of papers will contain between 2 and 50 characters, inclusive.
- Each element of papers will be formatted as described in the problem statement.
- Each index will be between 0 and the number of papers - 1, inclusive.
- A paper will not contain a reference to itself.
{"A.", "B. 0", "C. 1 0 3", "C. 2"}
Returns: {"A", "B", "C" }
The one paper in journal A is cited two times, so A's impact factor is 2/1. The one paper in journal B is cited once, so B's impact factor is 1/1. The two papers in journal C only receive citations from each other. Since citations from a paper in the same journal do not count, C's impact factor is 0/2.
{"RESPECTED JOURNAL.", "MEDIOCRE JOURNAL. 0", "LOUSY JOURNAL. 0 1",
"RESPECTED JOURNAL.", "MEDIOCRE JOURNAL. 3", "LOUSY JOURNAL. 4 3 3 4",
"RESPECTED SPECIFIC JOURNAL.", "MEDIOCRE SPECIFIC JOURNAL. 6", "LOUSY SPECIFIC JOURNAL. 6 7"}
Returns: {"RESPECTED JOURNAL", "RESPECTED SPECIFIC JOURNAL", "MEDIOCRE JOURNAL", "MEDIOCRE SPECIFIC JOURNAL", "LOUSY JOURNAL", "LOUSY SPECIFIC JOURNAL" }
There is an impact factor tie between the SPECIFIC and non-specific versions of each tier of journal. Since the non-specific ones have more papers, they win the tiebreaker.
{"NO CITATIONS.", "COMPLETELY ORIGINAL."}
Returns: {"COMPLETELY ORIGINAL", "NO CITATIONS" }
If there is a tie in impact factor and number of papers, the journal with the lexicographically earlier name comes first.
{"CONTEMPORARY PHYSICS. 5 4 6 8 7 1 9",
"EUROPHYSICS LETTERS. 9",
"J PHYS CHEM REF D. 5 4 6 8 7 1 9",
"J PHYS SOC JAPAN. 5 4 6 8 7 1 9",
"PHYSICAL REVIEW LETTERS. 5 6 8 7 1 9",
"PHYSICS LETTERS B. 6 8 7 1 9",
"PHYSICS REPORTS. 8 7 1 9",
"PHYSICS TODAY. 1 9",
"REP PROGRESS PHYSICS. 7 1 9",
"REV MODERN PHYSICS."}
Returns: {"REV MODERN PHYSICS", "EUROPHYSICS LETTERS", "PHYSICS TODAY", "REP PROGRESS PHYSICS", "PHYSICS REPORTS", "PHYSICS LETTERS B", "PHYSICAL REVIEW LETTERS", "CONTEMPORARY PHYSICS", "J PHYS CHEM REF D", "J PHYS SOC JAPAN" }
{"WND RWBT . 10 15 10 39 31 30 15 25 5 13 14 17 3","WND RWBT . 17 37 15 36 7 0 40 28 32 11 44 44 31","CE A. 40 25 0 34 9 34 11 27 20 9 6 25 41 43 34","VRBLMONKT. 41 33 17 26 23 10 39 27 4 14 23 13","QOF AJJM K. 22 14 25 30 10 20 28 13 41 10 25 25","CE A. 28 33 11 36 2 33 16 15 41 44 32 29 20 19","VRBLMONKT. 33 5 8 11 38 19","QPB . 43 2 41 40 35 31 36 22 43 25 28 2 5 42 12"," C QSQYBWG. 28 10 23 16 14 36 18 10 18 7 19 10","CE A. 8","FIY XANJE. 5 24 14 12 7 12 19 6 39 41 8 38 16 3","VRBLMONKT. 8 7 24","FIY XANJE. 17 9 2 9 15 0 37 22 27 3 2 23 42 1 1","WND RWBT . 6 11 41 31 8 30 44 2 8 10 1 40 1 36","VRBLMONKT. 8 26 10 15 32 18 3 35 39 26 12 23 15","FIY XANJE. 14 43 44 3 41 23 34 12 0 10 5 42 44","QOF AJJM K. 4 1 24 43 39 1 4 39 17 35 3 33 32 6","WND RWBT . 18 5 30 39 36 36 33 15 14 33 10 5 38","QPB . 33 16 14 6 43 31 3 24 28 13 44 25 40 7 8","FCZ H. 4 29 8 28 31 5 17 10 14","VRBLMONKT. 30 12 25 10 31 18 31 31 35 22 31 12","U. 33 27 10 44 2","FIY XANJE. 19 14 24 3 40 32 1 7 9 14 40 42 32 4","U. 13 38 16 33 4 41 5 35 6 14 21 18 30 2 42 31","QPB . 41 2 30 28 30 19 32 18 5 30 12 22 10 20 2","CE A. 7 33","FCZ H. 3 1 10 16 42 39 6 44","QOF AJJM K. 0 31 31 39 6 35 38 25 8 33 3 35 13","VRBLMONKT. 41 42 6 11 44 1 36 7 3 24 33 36 22 7","R IB. 1 9 28 14 19 17 22 28 7 36 40 25 43 23 7"," C QSQYBWG.","FCZ H. 6 30 19 33 1 36 19 26 22 25 33 12 15 23","CE A. 13 19 14 5 4 29 43","WND RWBT . 44 43 6 13 36 31 0 30 20 12 19 23 15","U. 35 2 24 21 29 22 15 13 39 18 40 19 18 28 35","CE A. 42 27 16 23 36 18 38 39 23 40","CE A. 37 11 10 40 27 12 37 19 34 2 38 32 13 21","QPB . 24 26 35 0 27 13 6 25 19 8 13 16 5 2 9 11"," C QSQYBWG. 29 36 6 14 10 20 2 30 36 24","QPB . 43 40 8 18 36 1 27 43 5 21 25 23 24 42 18","U. 33 6 9 34 18","QOF AJJM K. 29 6 27 15 42 20 35 12 6 17 38 27 1","FIY XANJE. 12 22 35 9 44 29 29 28 10 30 19 22 3","VRBLMONKT. 11 18 19 31 7 17 6 11 11 2 20 13 12","QPB . 2 35 23 22 22 38 39 10 1 18 4 39 24 4 39"}
Returns: {"VRBLMONKT", " C QSQYBWG", "FIY XANJE", "CE A", "FCZ H", "WND RWBT ", "QOF AJJM K", "QPB ", "R IB", "U" }
Submissions are judged against all 54 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class AcademicJournal with a public method vector<string> rankByImpact(vector<string> papers) · 54 test cases · 2 s / 256 MB per case