QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#275940#3147. Collecting Stamps 2KKT89100 ✓1ms3944kbC++171.2kb2023-12-05 12:41:262023-12-05 12:41:27

Judging History

你现在查看的是最新测评结果

  • [2023-12-05 12:41:27]
  • 评测
  • 测评结果:100
  • 用时:1ms
  • 内存:3944kb
  • [2023-12-05 12:41:26]
  • 提交

answer

#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cassert>
#include <chrono>
#include <random>
#include <set>
#include <utility>
#include <array>
#include <bitset>
#include <unordered_set>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}
inline double time() {
    return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    string s; cin >> s;
    ll res = 0;
    ll jres = 0, ores = 0, ires = 0;
    ll jcnt = 0, icnt = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] == 'I') icnt += 1;
    }
    for (int i = 0; i < n; ++i) {
        if (s[i] == 'J') jcnt += 1;
        else if (s[i] == 'I') icnt -= 1;
        else {
            jres += icnt;
            ires += jcnt;
            res += icnt*jcnt;
        }
        ores = max(ores, icnt*jcnt);
    }
    cout << res+max({jres,ores,ires}) << endl;
}

详细

Subtask #1:

score: 30
Accepted

Test #1:

score: 30
Accepted
time: 0ms
memory: 3592kb

input:

199
JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII

output:

296274

result:

ok single line: '296274'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

199
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ

output:

0

result:

ok single line: '0'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

196
JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ

output:

0

result:

ok single line: '0'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

195
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

output:

0

result:

ok single line: '0'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

200
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII

output:

0

result:

ok single line: '0'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

198
IOIJOIJJOIOJIJJJJOJJJIJJJIOJIIJOOJOOOJIOJJIIOIIJJJIOJJJJIIJJIIOIIIJJIIJIOOOIJJJIOJJJJOIOJIJJJJIOOOIOIOJIJOJOOJOOJJJIIJJJIJOIOIIJIIJOIOOIIIJOJIIJJOOOOOIOOIOOJJOIIJOIOIIJOJJIOOIOJOIOOJJJIJOOJJJOOIJOIO

output:

50462

result:

ok single line: '50462'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

196
OOOIJIOJJJIOIOIIOOIJJJIOJOOJOOOJIJIOOIIOJJIOJIJOOIJOIIOOJIOOOIJIIJIOJOOIOOJOJIOOJIJOJIIIOIJOIIOIIOIIOOJIOOIIJIIIIJIIIJOJOOOIJOIOOOIOIJIJOJJOIJJJIJJOJIOIIIJIIOIOOIOJIOJIIOOIIIJIOIIIJJIJOJJJIOIOJIJI

output:

53607

result:

ok single line: '53607'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

198
IIJOJOIIOOOIOOJJOOJIJJOJIOIIOIIOIIIOOOJJOIJOJOOOIOIJOOIJJJJOIIIJOJOOOOJOIJIJJJJIJIOIJIOOOOOJOJIIJIOIJIJIOOJIJIIOJJJJIIJOJJIIIOOJJIOJIIJJJIOJJOJIIOIOIJJJOJOOOIOOOIOIIOOJIJOIJIJOOJOIOOOIIOOIOIJOJOIJOO

output:

42457

result:

ok single line: '42457'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

196
OOIOOJJIIIIOIOJIJJOOOJIOJIIJJIJIIIOOIIIOIJOJJOOOIIIIIJIIJOJOJJIJOOIJOJJIJOOJIJOOIIIJIIIJIOIOOOJOOIJOIJIIIJIJJOOIIJIJJOIOJIIIOJIJJOJJOOIJIIOIOJIJIOJJJIJJOOOJIJIOJIOJJOOOIOOOJIOIIJJIOJJJOIJJIJOJOIII

output:

39175

result:

ok single line: '39175'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

199
IJJJJOIJJOOIJIOIOJIIIJOIJIIJOJOOJIOJOOOIIIOOJJIIOIOOJOIIOIJJIIIOJOIJOIIOJIJJIJIOJJOOIIOOOJJJOIOJOOIJJJOIOJIOIOOIIIIOJIJJJOIJIOIJJJJJJOJIJIJOIIOIJIOIOOOIJOJJOJOOJIOIJOOOJJJJOOOOIOJJOOOJJOIOIIIOJIIJIJJ

output:

46389

result:

ok single line: '46389'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

195
JOOOJOOOOOOOJJJOOOOOOOJOOOOOJOOOOOOOOOJOJOJOJOOOJOOOOOOOJJJOOOJOOOOOOOOJOOOOOJOOJOOOJOOOOOOOOOJJJOOOOOJOJJOOOOOJOOOOOOOOJOOOOOJOOOOOJOJOOOOOOOOOJJOOOOOJOOOOJOOOOJOJOOJJOJJOOOJOJOOOJOOOOOOOJOJJOOJ

output:

3230

result:

ok single line: '3230'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3684kb

input:

197
JOIOIOJIIOOIIJIIIJOIIJIIIIJIIOOJIIIOIOIIIIIIIIIIJIJIIOOIJJIIIJJIJIIIIIOOIOIIIOIOIOIJJIJJIOOIIOOIIJIJIIOIIOIOIIIOIOIJIIIOIOIIIJOIJJJOIIIIIOOJIJJIIJIIIIIOIIOIIIJIOOOIIIIIIOOIIOIIIIOIIIIIOIOIIOIIOOIJI

output:

36722

result:

ok single line: '36722'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

195
JIJJIIJJJJJIIJIIJJIJJIJJJIIJIJJJJIIJJIIJIJJJJJJIJIJJJJJIJIJJJIJJIJIJJJJIIJJIIJJIJJJIJIIIIJJJJIJIIJIJIJJJIJJIJIIJJJJIJJJJJJIIIJJIJJIJIIJJJJIJJIJJIIJIJJJJJJIJJJJIIIJJIJJIJJJJIJJIIJIJJJIIIJJIJIJIJIJ

output:

2376

result:

ok single line: '2376'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

196
JJJIJJOIOJIOOIIJJIJJJIIIIIIJOJIIIJOOJJJJIIOIIOIOJJIJIJIOOOJOIIJJOIIJOIIJIJIJOJJIIIJJJIIJIJIJOJOIJIJIJJJJOIIOIIJJIJIOJJIJJJIOJIIOJJIOJIIJIOIJJJOOIIOIIJIIOJIOOJOOIIJIOOIJJIIJJJJOIIIIIIIIJJJJIJIOIIII

output:

49524

result:

ok single line: '49524'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3684kb

input:

196
JJJJJIIJJIJJJJJJJJJJIJJJJJJIJIIJJIJIJIJJJJJJJJJJJJJJJJJJJJJJIJJIJJJJJJJJJIIJJJIJJJJIJJIJJIJJIJJJJJJJJJJJJJJJJJJJJJJIJJIJIJJJJJJJJJIIIJIJIIJJJJJJIJJJJJIIIJJJJIIJIJJJJJJIJJJJJIIJJJJJJIJJIJJJJIJJJIII

output:

2400

result:

ok single line: '2400'

Subtask #2:

score: 20
Accepted

Dependency #1:

100%
Accepted

Test #16:

score: 20
Accepted
time: 0ms
memory: 3624kb

input:

2999
JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ...

output:

1000000000

result:

ok single line: '1000000000'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

2998
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...

output:

0

result:

ok single line: '0'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3684kb

input:

3000
JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ...

output:

0

result:

ok single line: '0'

Test #19:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

2996
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO...

output:

0

result:

ok single line: '0'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3680kb

input:

2995
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...

output:

0

result:

ok single line: '0'

Test #21:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

2997
OJJIIIIOJJIJOJJIJJIIJIOOJIOIIJOOOIJJOIOIIIOIIJOJOOOIIOIJIOIIJJIOOJJIOOJOIIOIJJIIJJIJJIOIOIJIOIJOIOJOOJJOOOJIIJIJJIOOOJJOOOJJOOOOIJOIIIJJIIIIOIJIJJOJJJOJIIOJJJOIIOIOJOJOJIJIIIOIIOOOIJOJOOJIIIOIJIOJJOIIJOIOOJOIIOJOJJJIOIOJJIIJIOOIOJIOOIJOIJOOIIJJOJIJJOJIIJIIIJIJOJOOJJJOOJIIOOOOOOIIOJOOJOJOJOOOIJO...

output:

161325684

result:

ok single line: '161325684'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

2999
IIOOIOIIIOJJJJOIJIOJOJIOOJIJIJOIJOIIJOIIIOJOOOJIIOOIIJIIJOOOOJOIJIJIOIIJIOIIOJJIJJJOJJJOJOIOOJIIOIOOOJIIIJJOOOOJOOIIJIJOJJIIOOIIOOJJIIJJJJJOIIIJIOJOIIIOIIJIJOOJOJOIOJJIIIOOOJJIJIJIOJIJOIIOOOOOOOOOOIJIJOJIOOJJJIJIOJOOOOIIJOIJJJJIOIJIOOIOJJJOIIIIIIOOIOIIJIOJOOJJOJIOJJJIJJOJOIJOJOOJJOJJIIOOJOIJJJJ...

output:

175008735

result:

ok single line: '175008735'

Test #23:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

2997
JJJIJOJJIOOJJIJIOJOIOOJOIIOOOIIOOIIJJIIIIOJIIOOOIOJJIOJJIOIOJJOOIOJJJIJIIJOIJJJOIJIOJIOJIIJOIJJIJOJJIOJOJIOOOIOIOJJIOJIIJIIIJOJJJOJJOJOIJOOOOIOIJJJOOOIJOOIJOJOIIJOOJOJIOIOJOIOJOOOIJJJOOOJIIIJIJJJOJJJIOIIIOIIIIOJJJJJIOIOOIJOOOIJOIIJJJJIIJIJIJJIIJJOJOIIJJIIIOJOOJIIJOIOOJJOOIOOOIOOIIIIJJOIIIOIIJJO...

output:

174313000

result:

ok single line: '174313000'

Test #24:

score: 0
Accepted
time: 0ms
memory: 3844kb

input:

2997
JOJOOJJJOIJIOIOJOIJIIOIJIJOJJOIIIJOJOOOJJOIIJIOOIJJIIJOOIOIJOOJJOOIIOJIIOOJIJOIOIIJOOOIOJJOJJJIIOIOOOOIIJIJIIOOJJOOIOIIJIJOOIJOJOJOIIOOIOOIJOJIOIJOOJJIJOIIJJJJJIIOJIIIJJOJIOJJJJOIIIIJOOJIOOIIOJIJOIIIIJJJOOOJOIIOOOIOOIJJOIIOJIOIJIJOJOIIJJOOJJIJJJJIOIIIOOIIOOOJIJJJOJIIJOJIOIJIOIIJIJIOJIJOJJOIJIOI...

output:

159921583

result:

ok single line: '159921583'

Test #25:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

2997
JOJJOJIOJIIOIJJJJJIJIJOOOJJIOOOOIOJIOJJIIJJIJIJOOOJJIOIJJIOJIOIOOOOOOOOOOIJIJOOIIOJIOIJOIOIOIOJOIJOIJJIJOIJJIJOOIIOIOOJOOIOJOIOIOJIJOJOOJOOJOOJJJIJOIIOJOJJJJJOIIJIJIIJJIIJOIOIJJIOOOOIOIJIOOOIJIOOIOJOIIJJOIOIIOJOIOOIOOOJIIOJOOJJJIIIIIJOOJIJOIIJJOOOJIIOIJJOOOIIOIOOOOOJOOJIJIJIIIJOOJIIOIJIOIIIOOOJ...

output:

158672920

result:

ok single line: '158672920'

Test #26:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

2996
OOIOIOIOOOOIOIOIIOIIIOOIIOIIIIOOOIIIOOOIOIIOOIIIOIOOIOIIOIOIOOIIOIIOOIIOIIIOIOOIIIOIOIIIIIIOOOIIOIIOIOIOIOIIOIOOOIOOIIIIOIIOOIOIOIOOOIIIIIIIIIOIOIIOIIIIOIOOIOOIOIOIIIOIIOOOIIIIIOOIOIOOIIIOIIIOOOIIOIIIOOOOIIIOIIIOOIIIIOOIOIIIIIOIOIIOOOIIIOOIIIOOIOOIOOIIOIIIOOIIIOOIIOOIIIIIIOOOOIOOIOOOIIOIIIIOOIO...

output:

1085454

result:

ok single line: '1085454'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3824kb

input:

3000
JOJJIOOJJJIOOJJIJJOJJJJJIOIJIJJOIOJJIJJIJIOJJIIIIIOJIOIIOOIJIOIJJIJOJIIIIJJIOOOIJJJJJJIOOJJIOOOIOOJOIOJJJOJIIJJJJOIOIJOJIIJIIJOIJJJJIJIJIJJIIJJIJJJJJIJIIJOIJJOOOIOIJJJIIJOIJIIIIJJIIJIJIIJIJIOOIJIIJIOJOJJJOJJIOIJOIIIIIJJIIIIIJIIJJIJIJJOJJJIIJJIOIJJJIIOOJJIIOJIIIJOJJIOJJJIJJJJIOOJIIJOIJIIIIJJJIJJ...

output:

150169092

result:

ok single line: '150169092'

Test #28:

score: 0
Accepted
time: 0ms
memory: 3848kb

input:

2996
IIOOIIIIIIIIIJIIIJIIOOOOIIOIIIIJIIIIIIOIOIJIJJIIIOOJIOIIIIJIIIIOIIOIIIIIIIOIIIJIIIJIIOJIIJIIIIIOOJIIIJIJIIJJIIIIIIIOIJIIIJIOIIJIIOIIIJJOJIJIOIIIIOIIIOOIIIOIJJOIIJIOJJIJIJIIIJIIOIIOIIIJIIJJIOIJIIIOIIOIJJJIIIIIOIJIIIOIIIOIJIJIOOOIJOOJIOIIIOJIOIIIOIIIIIIIOJIOOIJIJOIIOIIJIOOIJIOIOOOJJIOIIJJIIIIOJII...

output:

108776729

result:

ok single line: '108776729'

Test #29:

score: 0
Accepted
time: 0ms
memory: 3680kb

input:

2995
IIJIIJIJIIIIIIJIJIIIJJIIIJIJIIIJIIJIJIJJIIIIJIIJJJIJIJJJIJIJJIIJIIJJJIJIIIIJJIIJIJIJJIIJIJJIIIIIJIJJJIIIJJIIIJJIIIIIJIIJIIIJIJIJIIJIIIIJJIJIIIIIIIIJIJJIIIJIJJIIJIIJIIIIJIIJJIIIIJIJIIIIJJJJIIIJJJIJJIJIIJIIIIIIJIIJIIJJIJIIIIJJIJIIJJIJIIIIIIIIJIJIJJJJJIIIIIIIJJJJIJIJIJIIJIIIIJJIJIIIJIJJJIJJIIIIJJI...

output:

540160

result:

ok single line: '540160'

Test #30:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

2995
IJJIJJJJJJJJJJJJJJJOOOOJOJJIJJJIOJOJIJJJJIJJJJOJJOJJJJIOIJJIJOOJJJOJJJJOJJJJJJOOJOJJJOOJJOJJIOJJOIJIOJJJJJJJIOIOIIOOJJJOOJOJJOJIIJJOJOOOJIJJIIOJOJJOOJJIJJOJJJJJIJIJJIJJJJJIJJJOJOJJIOOJIJOJJJJIJJJJIJIIIJJIJJJJJJJJJJJJIJJIJOJIJJOOJJOJOOJOIJJJJJJOJOJOJIJJJJJIIIOOJIJJJJJJJJIOJOJOJIJJJJIJJJIIJJIIJJJ...

output:

99381277

result:

ok single line: '99381277'

Subtask #3:

score: 50
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #31:

score: 50
Accepted
time: 1ms
memory: 3784kb

input:

99997
JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ...

output:

37034814848148

result:

ok single line: '37034814848148'

Test #32:

score: 0
Accepted
time: 1ms
memory: 3740kb

input:

99996
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...

output:

0

result:

ok single line: '0'

Test #33:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

99995
JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ...

output:

0

result:

ok single line: '0'

Test #34:

score: 0
Accepted
time: 1ms
memory: 3720kb

input:

99999
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO...

output:

0

result:

ok single line: '0'

Test #35:

score: 0
Accepted
time: 1ms
memory: 3900kb

input:

99998
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...

output:

0

result:

ok single line: '0'

Test #36:

score: 0
Accepted
time: 0ms
memory: 3924kb

input:

99997
IOJIIIIOJJIOJJOJJIOOIOIOOOJJJJOOIOJIIJJIIOIOIJOOOJJIOJOJJIOIOOJIOOIOOJIJOOIJIIIJJIJIIOJOJJOOOIJJIOJIOOJOIJIIIOJOIJJOJOJJOIOJIIOOJJIIJIIIIOOJJOIJIOIJJOIIJJJJIIIJIIOIIJOOOOOIOJIOIOOJIIJIJOOIOIIIOJOOIOJIIIOOOJJJOIOJOOJJIIOJIOJJOOOOJOOOIIJIJJOOJIOOJOIIIOJIOIOOJJOIOJOJOJJJOOIJIIIOIJIIJIOIOIOOJJIIJJ...

output:

6067289506412

result:

ok single line: '6067289506412'

Test #37:

score: 0
Accepted
time: 1ms
memory: 3944kb

input:

99998
OIIJIOJOOOIJOOJIJJJOOOIIJOOJIIOJIOOJOOOJOIJOIIJIIIOOJOIIOIIJJOOOJJOIIIOOOIJIIJOOJOIIJJJIOOJIOIIJOIIOOJJIIOJJIIIOIOJOIIOIIOOIJJOJJIIJJIOOOJIJOJJIOIIJIOIIOOJJJIIIIIJIIOJIJIOJOOJIIJIJIOJOIOJOOJJOOOJOJJOJIOIIOJOIIJJJOIJOOIIOOJOJOIIIIJJIJIOOJJOIJJOOJOIIOOOOOOIJJOJJJOOIIOIIIIIOJIIJOJJJOIOJJOJIIJJOIO...

output:

6093100150992

result:

ok single line: '6093100150992'

Test #38:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

99995
OIOIIIJJJIIIOOOIIJIIJJJIOOIIOJJIJIIJIOIIIOIOOIJOIJJIJOJIJJJJOOOJIJIJJIIJJIOIOJJJJOOOOJJOIIOJOJIOJIOJIOJOOJJOOOOIOIOOOOIJOJOOOIJIOOJOOIJOOIJIJOOIIIJOOOIJOJOIJOIOJOOJJOOJOIOOJIIIJJIOIOOJOIJIIOOJOOJOIOIJIJOIJJOJOIIIJOJOIOOOIIJIJOJOOOJJJJOIJJOOIOIOOJIJIIJIOIIOOIOJOJOJJIJIOJOJIIJJJIOJOJOJIOJOIIIJJO...

output:

6148059693811

result:

ok single line: '6148059693811'

Test #39:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

99998
IJOOOOOOJIJIJIJIIJOJJJIOIOOJJOJIIOOIJJIOJIIIIOJIJJJOJOIJIOOJJOIIIOJJIIOIJOIOIJOJOJJOIIIJJJOOIOJJOIOOIOIIIIIIOJIJOJOOIJOIJIIJOOIOIJIIJOOJJJIOOOJIJOIJIOJJOIIOIJOIIJOJJIJJIOIOIOOIOOJIOIOIIJIIIOJOOJIJIOJIOIJIJIIIIJIJOJOJJIJIIJOJOIOOJOIOOIJIJOOIJIIJOJIJOOIJIOJJJOJOOJJJJJJOOIOOJIIJJJJOOOOOJIJIJOIIJI...

output:

6150789959888

result:

ok single line: '6150789959888'

Test #40:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

99998
JJOOJOJJJOIIIOOIIIJIJOIJOIIJJIIOIOOIOJJIJIIJJIOIOOJOIIJOIOIIIJJIIOOOJIIOOOJOOJIJOJJOOJOJIOIOJIJIIIJIIJJOIJIOJIOJJOIIIIIJJJOIIIIOOOIJIJOJIOJOJJIIIOIOJJOOOOOJIJIOIIJOIJJIIOIIIOJIOOIIJIJJJJOIJIJIIIOJIOIJJOIJIOJJIIIOIIOOJIJOJOIJIIOJIIOIOOIOOJJIOIOJOIJJIJJIIIJJJOIIOOIJJJJOJIIIIIJOIIJOIIIOOOIOOIIJIO...

output:

6192899610004

result:

ok single line: '6192899610004'

Test #41:

score: 0
Accepted
time: 1ms
memory: 3688kb

input:

99996
JIJJJJJJJIIJJIIJJJJJJOJJJJIIIJJIJJIIJJJJJJJJIIJJOJOOJJIOJJJJJJJJJIJOIIJJJJJJJJJOIIIJJIJJIIIJJJJJIJIIJIJJJIIJJOJIOJJJOJIIOIOJJIOJJJJJOJJOIJJJJJOJOJJIJJJIOOJJJOIJIJJJJOJJJJIJJOJJIIIJJJJOIJJOOOOJJOJJJJIJJJJJJJJOIJJJJOOOJJIOJIJOOJOJJOJJOOJJJIIJOJIIIJJIJJJJJOIOOJJJIJJIIOIJJJJOJJOIJJOOIJJJJIIJJIJJOJ...

output:

4050263249484

result:

ok single line: '4050263249484'

Test #42:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

99998
OOIIOIOOIIIOOOIOIOIIOIOIIOIOIIOOOOOOOOOIIIOIIIOOIOIOOOIOIOOIIIOOOIIIOOOIOOIOIOOIOOIOIOOOIIIOIIOOOOOOOIOIIIIIOOOOOIIOOOIIOOOOOIOIOOOOOOOIOOOOIOOOOOOOOOOOOOIOOOOOOOOOIOIOIOOOIOOOOOIOIOOOOOOOOOIOOIIOOIIOIIIOOOOOIOIOIOOIIIIIOOOOOIOOIOOIIOOOOOIIOOOIOIOIOOOOOOIOIIOOOOOOIOIIIOIIIIOIIOOOIOOIIIIOOOOIOO...

output:

1201668187

result:

ok single line: '1201668187'

Test #43:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

99999
IOIIOOIJIIIOIIIIOJIIJIIOOIJJOJJIOJJIOOOIOOIOIIOOIIIIOIIIIJOJIOIJIJOIOIJOIOIJOOIOOOIOIIOIOOIJJOIIOIOIIJIIOIIIIOIOJJOIIIOIIIIOIIIOIJOIIOIIOIJIJOIIJOOOIJIIJOJIOOIIJOOJIOIOIIOOJIOIOOOJJOJIJJJOJOOJIJOJIOIOJOIOOOJOIIIOJIOIJJJIOOOIIJOJOIOOJIIJJIIJIIJJJIOOIOOOJOOIOOIOIIOJJJIIJOJIIOIIOOOIJIOOOOIIIJIIOI...

output:

5410533620962

result:

ok single line: '5410533620962'

Test #44:

score: 0
Accepted
time: 1ms
memory: 3652kb

input:

99995
OOOJOOOOOIOOJOOJJJOOIOOOOOOJOIOJIIIOOOOIOJOOOOOIIOJOOOOIOIJOIOOOJJJOJIOIIIIOOOIJOOOOOOOOOOIOOOOJOJJJIOOIOOIOJOOOOOOIOJOIOJJOOIOOOOJIOOJIOIOIOOIOOOJOJOIOOOIOIOIIJOIOJOOOOOJIOOOJIOJIOOIOOOIOOOOJOOIOIOJOOIOOOJIIIOOOOJOOOJOIOJIOJOOJIIJOIOIIOIOOOOOJJIOIIOJOIOOJIJOJOOIIIOOJOOJOIOIOOJOOOIOOJJIOJOIJJI...

output:

3996130470613

result:

ok single line: '3996130470613'

Test #45:

score: 0
Accepted
time: 1ms
memory: 3720kb

input:

99999
IJIIJJIIIIIIJIIIIJIJIJIIIIIJIIIIJIIIIIJIIIIIIIJIJIIIIIIJIIJIJJJIIIIIJIIIIJIJIIIIIIIIJIIIIIJIIIIIIIIIIIIIIIIIJIIIJIIIIIIIIJIIIIIIIIIIJIIIIIIJIIIIJIIIIIIJJIJIIIIIIJIIIIIIIIIIIIIIJJIJJIJIIIIJIIIIIIIIIIIIIIIIIJIIIIIIJIIIIIIIIIIIJIIJIIJJIIJIIIJIIJIJIIJIIIJIIIIJIIIIIIIIIIIIIIIJIIJIIIIJIIIIIIIJIIIJII...

output:

399541516

result:

ok single line: '399541516'

Extra Test:

score: 0
Extra Test Passed