## VM7WC '16 #1 Silver - Project Feng: Multiple Statements

View as PDF

Points: 5
Time limit: 1.0s
Memory limit: 62M

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Logic is not taught in Canadian math classes anymore, and Leo sets out to fix that by adding this logic question to Project Feng.

Leo will give you , () statements, like so:

Exactly of these statements are true.

Exactly of these statements are true.

Exactly of these statements are true.

...

Exactly of these statements are true.

for all . Leo tells you that some of these statements are true, and others are false. He then asks you, how many of these statements are true?

#### Input Specification

The first line will contain the positive integer . The next lines each contain a single positive integer, the sequence to .

#### Output Specification

Output a single nonnegative integer, the number of statements that are true. If there are multiple correct answers, output the greatest. If there are no possible answers, output Paradox!.

#### Sample Input 1

4
0
1
2
3

#### Sample Output 1

1

#### Sample Input 2

4
4
4
4
4

#### Sample Output 2

4

#### Sample Input 3

1
0

#### Sample Output 3

Paradox!

#### Explanation for Sample 3

This is an Epimenides paradox. If the statement is true, then it must be false. It the statement is false, then it must be true.

• commented on Aug. 14, 2019, 8:20 p.m.

I've completed every test case except for 4, 6, 12. Can someone explain how 0 can be an answer?

• commented on Sept. 23, 2017, 9:06 p.m. edited

Hello World! What the heck is going on?!! I tried my code with A TON OF TEST CASES MYSELF, but it doesn't work. Maybe I'm stupid but I am genuinely confused! my code: n = int(raw_input()) a = [] for i in range(0, n): a.append(int(raw_input())) m = 0 for i in range(0, n + 1): if i == a.count(i): m = i if m != 0: print m else: print "Paradox!" python2

• commented on Sept. 23, 2017, 9:28 p.m.

Output a single nonnegative integer

• commented on Sept. 22, 2017, 9:25 p.m. edit 3

help I'm always getting 4, 6, and 12 wrong and I don't know why. I think my code is right... Also should 4 1 2 2 4 print 2 or 4?

• commented on Sept. 22, 2017, 10:06 p.m. edit 2

Same question

• commented on Sept. 22, 2017, 9:52 p.m. edited

That test case should print 2. I think your program needs to differentiate between a paradox and 0.

• commented on Sept. 23, 2017, 10:20 a.m.

It does, I don't know why it doesn't work!!!

• commented on Jan. 13, 2016, 1:36 p.m.

call me dumb but i seriously dont know how its defining either a number is true of false.

• commented on Jan. 13, 2016, 7:16 p.m.

Are you talking about the paradox case?

• commented on Jan. 14, 2016, 10:41 a.m.

no in general. i dont understand the problem as a whole. how do i know if a number is true?

• commented on Jan. 8, 2016, 1:46 p.m. edited

I’m pretty sure that there is probably some error with my program, but by any chance are there any A values which are greater than N (in the test cases)?

• commented on Jan. 9, 2016, 6:41 p.m. edited

No, you're right. Sorry for not picking up this earlier, most solutions don't depend on the limit of .

Problem statement fixed.

• commented on Jan. 7, 2016, 4:04 p.m.

You can print out zero.

• commented on Jan. 7, 2016, 4:17 p.m.

Fixed.

• commented on Jan. 8, 2016, 8:52 p.m.

Not according to my screen

• commented on Jan. 7, 2016, 4:07 p.m.

Can confirm - if you print 0, you get some test cases correct.