QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 64 MB مجموع النقاط: 100

#23768. JOI och IOI

الإحصائيات

Problem

Skriv ett program som räknar på hur många ställen i en given sträng som $3$ på varandra följande tecken bildar JOI respektive IOI. Strängen består endast av stora engelska bokstäver. Till exempel, i strängen JOIOIOI som visas i figuren nedan förekommer JOI på $1$ ställe och IOI på $2$ ställen.

sample

Indata

Indatan består av $1$ rad och innehåller $1$ sträng med högst $10000$ stora engelska bokstäver.

Utdata

Utdatan består av $2$ rader: skriv ut antalet hittade JOI på rad $1$ och antalet hittade IOI på rad $2$.

Exempel på indata och utdata

Indataexempel 1

JOIJOI

Utdataexempel 1

2
0

Indataexempel 2

JOIOIOIOI

Utdataexempel 2

1
3

Indataexempel 3

JOIOIJOINXNXJIOIOIOJ

Utdataexempel 3

2
3

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.