300816: CF156B. Suspects

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Suspects

题意翻译

一共有N个人,其中有一人为罪犯。 现在每个人说了N句话,内容是说谁是罪犯或 谁不是罪犯(也可以说自己)。其中有M句真话。 给定N和M以及N个数,设为a[1]~a[N] 如果a[i]>0,代表第i个人说第a[i]个人是罪犯,反之代表第i个人说第-a[i]个人不是罪犯。 输出有N行,如果第i个人说的一定是真话,输出"Truth"; 如果第i个人说的一定是假话,输出"Lie"; 如果第i个人说的可能是真话也可能是假话则输出"Not defined"。

题目描述

As Sherlock Holmes was investigating a crime, he identified $ n $ suspects. He knows for sure that exactly one of them committed the crime. To find out which one did it, the detective lines up the suspects and numbered them from $ 1 $ to $ n $ . After that, he asked each one: "Which one committed the crime?". Suspect number $ i $ answered either "The crime was committed by suspect number $ a_{i} $ ", or "Suspect number $ a_{i} $ didn't commit the crime". Also, the suspect could say so about himself ( $ a_{i}=i $ ). Sherlock Holmes understood for sure that exactly $ m $ answers were the truth and all other answers were a lie. Now help him understand this: which suspect lied and which one told the truth?

输入输出格式

输入格式


The first line contains two integers $ n $ and $ m $ ( $ 1<=n<=10^{5},0<=m<=n $ ) — the total number of suspects and the number of suspects who told the truth. Next $ n $ lines contain the suspects' answers. The $ i $ -th line contains either "+ $ a_{i} $ " (without the quotes), if the suspect number $ i $ says that the crime was committed by suspect number $ a_{i} $ , or "- $ a_{i} $ " (without the quotes), if the suspect number $ i $ says that the suspect number $ a_{i} $ didn't commit the crime ( $ a_{i} $ is an integer, $ 1<=a_{i}<=n $ ). It is guaranteed that at least one suspect exists, such that if he committed the crime, then exactly $ m $ people told the truth.

输出格式


Print $ n $ lines. Line number $ i $ should contain "Truth" if suspect number $ i $ has told the truth for sure. Print "Lie" if the suspect number $ i $ lied for sure and print "Not defined" if he could lie and could tell the truth, too, depending on who committed the crime.

输入输出样例

输入样例 #1

1 1
+1

输出样例 #1

Truth

输入样例 #2

3 2
-1
-2
-3

输出样例 #2

Not defined
Not defined
Not defined

输入样例 #3

4 1
+2
-3
+4
-1

输出样例 #3

Lie
Not defined
Lie
Not defined

说明

The first sample has the single person and he confesses to the crime, and Sherlock Holmes knows that one person is telling the truth. That means that this person is telling the truth. In the second sample there are three suspects and each one denies his guilt. Sherlock Holmes knows that only two of them are telling the truth. Any one of them can be the criminal, so we don't know for any of them, whether this person is telling the truth or not. In the third sample the second and the fourth suspect defend the first and the third one. But only one is telling the truth, thus, the first or the third one is the criminal. Both of them can be criminals, so the second and the fourth one can either be lying or telling the truth. The first and the third one are lying for sure as they are blaming the second and the fourth one.

Input

题意翻译

一共有N个人,其中有一人为罪犯。 现在每个人说了N句话,内容是说谁是罪犯或 谁不是罪犯(也可以说自己)。其中有M句真话。 给定N和M以及N个数,设为a[1]~a[N] 如果a[i]>0,代表第i个人说第a[i]个人是罪犯,反之代表第i个人说第-a[i]个人不是罪犯。 输出有N行,如果第i个人说的一定是真话,输出"Truth"; 如果第i个人说的一定是假话,输出"Lie"; 如果第i个人说的可能是真话也可能是假话则输出"Not defined"。

加入题单

上一题 下一题 算法标签: