文件名称:baidu1
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:507.3kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
百度编程题
.食物链Descr iption 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 X Y",表示X吃Y。 此人对N个动物,用上述两种说法,一句接一句地说出K句话,这K句话有的是真的,有的是假的。当一句话满足下列三条之一时,这句话就是假话,否则就是真话。 1) 当前的话与前面的某些真的话冲突,就是假话; 2) 当前的话中X或Y比N大,就是假话; 3) 当前的话表示X吃X,就是假话。 你的任务是根据给定的N(1 <= N <= 50,000)和K句话(0 <= K <= 100,000),输出假话的总数。 Input 第一行是两个整数N和K,以一个空格分隔。 以下K行每行是三个正整数 D,X,Y,两数之间用一个空格隔开,其中D表示说法的种类。 若D=1,则表示X和Y是同类。 若D=2,则表示X吃Y。 Output 只有一个整数,表示假话的数目。 Sample Input 100 7 1 101 1 2 1 2 2 2 3 2 3 3 1 1 3 2 3 1 1 5 5 Sample Output 3-Baidu programming questions
There are three types of animals in the food chain Descr iption Animal Kingdom A, B, C, and three types of animal food chain constitutes an interesting ring. A eat B, B, to eat C, C eat A. The existing N animal, numbered 1-N. Each animal are A, B, C in a, but we do not know exactly what kind. Been used in two different ways to describe these the N animals constitute the food chain relationship: The first argument is the "XY" X and Y are similar. The second argument is that the "2 X Y", X eat Y. N animals, using the above two statements, one pick a say K words, K sentence some true, some false. When the sentence satisfies one of the following three words is a lie, otherwise, it is the truth. 1) words preceding Some true conflict, is lie 2) of the current, then X or Y is larger than N, that is, lies 3) The current then represents X eat X, is lie. Your task is the total number of (1 <= N <= 50,000), and K according to a given N words (0 <= K <= 10
.食物链Descr iption 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 X Y",表示X吃Y。 此人对N个动物,用上述两种说法,一句接一句地说出K句话,这K句话有的是真的,有的是假的。当一句话满足下列三条之一时,这句话就是假话,否则就是真话。 1) 当前的话与前面的某些真的话冲突,就是假话; 2) 当前的话中X或Y比N大,就是假话; 3) 当前的话表示X吃X,就是假话。 你的任务是根据给定的N(1 <= N <= 50,000)和K句话(0 <= K <= 100,000),输出假话的总数。 Input 第一行是两个整数N和K,以一个空格分隔。 以下K行每行是三个正整数 D,X,Y,两数之间用一个空格隔开,其中D表示说法的种类。 若D=1,则表示X和Y是同类。 若D=2,则表示X吃Y。 Output 只有一个整数,表示假话的数目。 Sample Input 100 7 1 101 1 2 1 2 2 2 3 2 3 3 1 1 3 2 3 1 1 5 5 Sample Output 3-Baidu programming questions
There are three types of animals in the food chain Descr iption Animal Kingdom A, B, C, and three types of animal food chain constitutes an interesting ring. A eat B, B, to eat C, C eat A. The existing N animal, numbered 1-N. Each animal are A, B, C in a, but we do not know exactly what kind. Been used in two different ways to describe these the N animals constitute the food chain relationship: The first argument is the "XY" X and Y are similar. The second argument is that the "2 X Y", X eat Y. N animals, using the above two statements, one pick a say K words, K sentence some true, some false. When the sentence satisfies one of the following three words is a lie, otherwise, it is the truth. 1) words preceding Some true conflict, is lie 2) of the current, then X or Y is larger than N, that is, lies 3) The current then represents X eat X, is lie. Your task is the total number of (1 <= N <= 50,000), and K according to a given N words (0 <= K <= 10
(系统自动生成,下载前可以参看下载内容)
下载文件列表
baidu1/
baidu1/Debug/
baidu1/Debug/baidu1.exe
baidu1/Debug/baidu1.ilk
baidu1/Debug/baidu1.pch
baidu1/Debug/baidu1.pdb
baidu1/Debug/main.exe
baidu1/Debug/main.ilk
baidu1/Debug/main.obj
baidu1/Debug/main.pch
baidu1/Debug/main.pdb
baidu1/Debug/vc60.idb
baidu1/Debug/vc60.pdb
baidu1/baidu1.dsp
baidu1/baidu1.dsw
baidu1/baidu1.ncb
baidu1/baidu1.opt
baidu1/baidu1.plg
baidu1/main.cpp
baidu1/main.dsp
baidu1/main.dsw
baidu1/main.ncb
baidu1/main.opt
baidu1/main.plg
baidu1/main.zip
baidu1/Debug/
baidu1/Debug/baidu1.exe
baidu1/Debug/baidu1.ilk
baidu1/Debug/baidu1.pch
baidu1/Debug/baidu1.pdb
baidu1/Debug/main.exe
baidu1/Debug/main.ilk
baidu1/Debug/main.obj
baidu1/Debug/main.pch
baidu1/Debug/main.pdb
baidu1/Debug/vc60.idb
baidu1/Debug/vc60.pdb
baidu1/baidu1.dsp
baidu1/baidu1.dsw
baidu1/baidu1.ncb
baidu1/baidu1.opt
baidu1/baidu1.plg
baidu1/main.cpp
baidu1/main.dsp
baidu1/main.dsw
baidu1/main.ncb
baidu1/main.opt
baidu1/main.plg
baidu1/main.zip
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.