oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

letters Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

letters.html

Problem Description

Ranald the cat is reading his Geography notes and he got bored. He takes his highlighter and decides to highlight letters, in alphabetical order, A to Z.

One example is: Absolute cat does fishing, hill jack lame nope quick rest you vista while fax you zebra.

Task Description

Given the paragraph (with spaces and punctuations) on a single line, output the total number of different ways Ranald can highlight the letters from A to Z.

Input

The answer will be able to fit into a 64-bit unsigned integer.

For 50% of the testcases, the length of the string will be not more than 1000.

For 75% of the testcases, the length of the string will be not more than 40000.

For 100% of the testcases, the length of the string will not be more than 1000000.

Output

Output a single integer, which denotes the number of different ways Ranald can highlight the letters from A to Z.

Sample Input 1

abcdefgHiJklmnoPqRstUvwxYz

Sample Output 1

1

Sample Input 2

ababcdefghijklmnopqrstuvwxyz

Sample Output 2

3

Explanation for Sample Output 2

ababcdefghijklmnopqrstuvwxyz
ababcdefghijklmnopqrstuvwxyz
ababcdefghijklmnopqrstuvwxyz

Tags

Dynamic Programming

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
110041s32MBAverage
2021s32MBAverage

Judge Compile Command

g++-8 ans.cpp -o letters -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.