[Buổi 21][Xử lý chuỗi][HW] Bài 2: Đếm từ khác nhau


LÀM BÀI

Points: 100
Time limit: 1.0s
Memory limit: 256M

Author:
Problem types
Allowed languages
C++

Đếm từ khác nhau

Bối cảnh

Một dòng text cần đếm số từ khác nhau, không phân biệt hoa/thường.

Whitespace liên tiếp không tạo token.

Yêu cầu

  1. Tokenize.
  2. Lowercase.
  3. Insert vào set.
  4. In size của set.

Input

Một dòng.

Output

Một số nguyên.

Ràng buộc

0 ≤ |line| ≤ 3000.

Ví dụ 1

Input

A a B b a

Output

2

Giải thích

Chỉ có hai từ khác nhau a và b.

Ví dụ 2

Input

one two three

Output

3

Giải thích

Có ba từ one, two, three.

Thông tin học tập

  • Module: M06
  • Buổi: B21
  • Loại bài: HOMEWORK
  • Độ khó: Easy
  • Concepts: stringstream, set, normalization
  • Giới hạn kiến thức: B01-B21
  • Time limit: 1 second(s)
  • Memory limit: 256 MB
  • Point: 100

Comments

There are no comments at the moment.

Zalo