No news site is unbiased, but some do a better job of trying to balance facts and opinions. The term fake news means “news articles that are intentionally and verifiably false” designed to manipulate people’s perceptions of real facts, events, and statements. (Quoted from https://www.cits.ucsb.edu/fake-news/what-is-fake-news)
To tell if a news media is more or less likely to be fake, you can keep an eye on several different sites to see how they report on the same important events. The algorithm works as the following:
- Select N news sites.
- For each important event, scan every site and represent each different opinion by a distinct integer.
- Define the likelihood of a site i being fake news by Fi=ni/N, where ni is the
number of sites that have different opinions than site i. - Find the news site(s) which is(are) the most likely to report fake news.
- Foreach news site, count the number of times it was the most likely to be fake, and find the one that is in most of the cases the most likely to be fake.
Input Specification:
Each input file contains one test case. For each case, the first line contains two positive numbers: N (≤104) which is the number of news sites, and M (≤100) which is the number of events. Then M lines follow, each describes the reports of the sites in the format:
R1 R2…RN
where Riis an integer in the range [−104,104], and reprensts the opinion of site i.
Output Specification:
For each test case, print in a line the index of the site which is in most of the cases the most likely to be fake. The answer is guaranteed to be unique.
4 6
4 2 7 7
1 1 1 3
2 9 9 5
-1 -1 -1 -1
-2 2 -2 2
1 1 3 4
4
Hint:The Fi’s for each event are the following:
Event 1: 3/4 3/4 2/4 2/4 --> 1 and 2 are the most likely
Event 2: 1/4 1/4 1/4 3/4 --> 4 is the most likely
Event 3: 3/4 2/4 2/4 3/4 --> 1 and 4 are the most likely
Event 4: 0 0 0 0 --> all are the most likely
Event 5: 2/4 2/4 2/4 2/4 --> all are the most likely
Event 6: 2/4 2/4 3/4 3/4 --> 3 and 4 are the most likely
Hence site 4 is the one since it has the highest likelihood for 5 times, while other sites only have 3 or 4 times.
#include#include
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)