2447 - I2P(I)2021_Hu_lab7-A Scoreboard

Time

2021/12/20 20:31:00 2021/12/20 20:32:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
13375 Class 3-E
13394 Spider-verse

13375 - Class 3-E   

Description

Koro Sensei, the homeroom teacher of Class 3-E was prepared a list of new students that is sent to assasinate him. Tadaomi has to sort the names in alphabetical order make sure that the 10 Million Yen Bounty goes to the right person. 

Help Tadaomi program a name list.

Note that :

1. Upper case letter has higher priority than lowercase letter. (E.g. Kill > kill)

2. If there is a string with the same substring, the shorter string has higher priority. (E.g. assasination > assasinationtime)

 

You can use the following code :

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

char string[100001][105];

int cmp(const void *a,const void *b){

/* write your code here */

}

int main(){

int i = 0;

while(scanf("%s", string[i]) != EOF) i++;

qsort(/* fill in this blank */);

for(int j = 0; j < i; j++) printf("%s\n", string[j]);

}

Input

Input consists of several lines L, each of them is a string

0<L<100000

Length of string won't exceed 100

 

Output

Print out the strings in alphabetical order, one string per line

Sample Input  Download

Sample Output  Download

Tags




Discuss




13394 - Spider-verse   

Description

In the year 3021, there is over 1000 Spider-man movies made. Sadly because of lack of creativity, many of the movies have the same plot as others. You, an avid Spider-fan decides and a Computer Science major, wants to find out how many different Spider-man movies there are. In order to do that you must create a program to evaluate the number of different movies there are from a selection of Q Spider-man movies.

First thing you do is watch all the movies and grade them using a 10 character string. each character in the string corresponds to an attribute of the movie and can be graded by the characters '1', '0', or 'x'. '1' means that that attribute is good, '0' means its bad, while 'x' means its the best part of the movie.

Each movie will have at most one 'x'. (e.g. 101010101x, x111111111). 2 movies are considered the same if their attributes are exactly the same. Below are some examples:

  • 101010101x and 101010101x is the same movie
  • 101010101x and x111111111 is not the same movie
  • 10101010x1 and 101010101x is not the same movie

Now all you have to do is write a program to find all the different movies in the selection.

Input

An integer Q which represents the number of movies in a selection. (1 <= Q <= 10000 100000)

Q lines of 10 character string which consist of character '1', '0', and 'x'

 

note: there can only be at most one 'x' in each string

Output

The number of different movies in the selection followed by a newline

Sample Input  Download

Sample Output  Download

Tags




Discuss