Valentine's Day '18 J3 - Are they cute?

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 3.0s
PyPy 2 1.4s
PyPy 3 1.4s
Memory limit: 64M
PyPy 2 128M
PyPy 3 128M

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

Carol and Cactus think that everything is cute. However, cuteness, like everything is all relative.

For someone to be relatively cute, they must be cuter than more than half of the people present. You are seeking out potential partners, and you must be able to identify the cute people! Given the N values of cuteness (not in Carol numbers), decide if each person is cute.


1 \le N \le 10^4

1 \le K_i \le 10^6

2 \le |S_i| \le 10

Input Specification

The first line will contain N, the number of people.

The following N lines will contain a string S_i and K_i, the name of the ith person and their cuteness.

The name of the person will consist of one uppercase letter followed by only lowercase letters.

Output Specification

For each person output:

  • {Name} is cute! <3 if that person is cute.
  • {Name} is not cute. </3 if that person is not cute.

Sample Input

Carol 100
Allan 5
Cactus 1000
William 1

Sample Output

Carol is not cute. </3
Allan is not cute. </3
Cactus is cute! <3
William is not cute. </3

Sample Input

Tristan 888
Peibae 503
Clive 444
Royi 231
Dordor 564
Stacy 43
Chad 54

Sample Output

Tristan is cute! <3
Peibae is cute! <3
Clive is not cute. </3
Royi is not cute. </3
Dordor is cute! <3
Stacy is not cute. </3
Chad is not cute. </3


While the first five people are all quite cute, only Tristan, Peibae and Dordor are cuter than 4 or more people.


  • 1
    discoverMe  commented on Oct. 15, 2019, 12:21 a.m. edited

    The problem statement says

    The name of the person will consist of one uppercase letter followed by only lowercase letters.

    Yet in the first sample input, one of the names is AllanXu.

    edit: oops wrong account