QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#808442 | #84. Know your Aliens | LaVuna47# | AC ✓ | 1ms | 3852kb | C++17 | 2.3kb | 2024-12-10 20:50:27 | 2024-12-10 20:50:28 |
Judging History
answer
/** gnu specific **/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
/** contains everything I need in std **/
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(S) ((int)S.size())
#define FOR(i, st_, n) for(int i = st_; i < n; ++i)
#define RFOR(i, n, end_) for(int i = (n)-1; i >= end_; --i)
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef unsigned long long ull;
typedef long double LD;
typedef pair<ull, ull> pull;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
using namespace std;
#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif
vector<ll> getCoef(const vector<ll>& roots)
{
vector<ll> coefs = {1};
// Multiply (x - root) for each root
for (ll root : roots)
{
std::vector<ll> newCoefs(sz(coefs)+ 1, 0);
for (ll i = 0; i < sz(coefs); ++i)
{
newCoefs[i] += coefs[i]; // Current coefficient
newCoefs[i + 1] -= coefs[i] * root; // Contribution from -root
}
coefs = std::move(newCoefs);
}
return coefs;
}
int solve()
{
string s;
if(!(cin>>s))return 1;
int n=sz(s);
vector<ll> a;
FOR(i,0,n-1)
{
if(s[i]!=s[i+1])
a.pb(2*(i+1)+1);
}
if(sz(a)==0)
{
if(s[0]=='A')cout<<"0\n-1\n";
else cout << "0\n1\n";
return 0;
}
cout<<sz(a)<<'\n';
auto C = getCoef(a);
int k =sz(C);
for(auto item: C)
cout<<(((int(s[0]=='H') + k)%2==0) ? item : -item)<<" ";
cout<<'\n';
return 0;
}
int32_t main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int TET = 1e9;
//cin >> TET;
for (int i = 1; i <= TET; i++)
{
if (solve())
{
break;
}
#ifdef ONPC
cout << "__________________________" << endl;
#endif
}
#ifdef ONPC
cerr << endl << "finished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec" << endl;
#endif
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3812kb
input:
AHAHAHAHAHAHAHAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
16 -1 288 -38200 3094560 -171186652 6848858016 -204728792840 4657440696480 -81357378048518 1092842347300704 -11226645052106120 87056405155006560 -498090011547450204 2025608594653312992 -5498705533259238840 8855805158351474400 -6332659870762850625
result:
ok 2 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3684kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
5 -1 24203 -211366970 802534334470 -1244463802545429 505689101974870047
result:
ok 2 lines
Test #3:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
5 1 -13147 60912894 -114635142026 73241692943873 -13707304092268059
result:
ok 2 lines
Test #4:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
5 -1 22337 -178421426 607588242298 -790259356440813 197637578982677925
result:
ok 2 lines
Test #5:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
5 1 -20009 132370726 -330443533974 300804726549465 -56380159698933825
result:
ok 2 lines
Test #6:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
5 1 -20117 140230094 -436684625542 607866360457905 -293309922157642341
result:
ok 2 lines
Test #7:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
HHHHHAAHHHHHHHHHHAAAAHHAAAAAHHHHHHHHAAHAAAHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
11 -1 619 -170075 27311369 -2839558218 199961850606 -9687235073270 320960330387666 -7073267682216901 97781283589358935 -754194552945839775 2435703915741067125
result:
ok 2 lines
Test #8:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
AAAHHHHAAAAAAAAAAHHAHHHHHHHHHHAAAHAAAAHHAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
11 1 -575 146787 -21896349 2113129386 -137907506646 6174544978598 -188188763270746 3784950182806053 -47091337682476059 318537450345140775 -857853983028267225
result:
ok 2 lines
Test #9:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
AHHHHAAHHHHHHHAAAAAHHAAAAHHHHHHHHHHHHHHHAHHHHHAHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
12 -1 642 -182036 30009302 -3186606717 228177917812 -11210873006928 377125717188492 -8510810887417419 123451984434529962 -1064358669544119324 4690340667512993790 -7219569395164987575
result:
ok 2 lines
Test #10:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
HAAAAAAAHHAAHHHHHHAHHHHHHHHAAHAAAAAHHHHHHHAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
12 1 -572 145318 -21632436 2095621395 -138687423960 6400194177572 -206265837649384 4568116062228119 -66910559121944748 601202792041216470 -2832614555442516900 4569333067537363125
result:
ok 2 lines
Test #11:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
AAHAAAAAAAHHHHAHAHHAAHAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
12 -1 412 -76014 8289492 -593684139 29325609624 -1020151658996 25037796813608 -426874685352135 4875330273447564 -34848668150864190 137110324070808900 -221332391136982125
result:
ok 2 lines
Test #12:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
HAHAHAHAHAHAHAHAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
16 1 -288 38200 -3094560 171186652 -6848858016 204728792840 -4657440696480 81357378048518 -1092842347300704 11226645052106120 -87056405155006560 498090011547450204 -2025608594653312992 5498705533259238840 -8855805158351474400 6332659870762850625
result:
ok 2 lines
Test #13:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
AHHHAAAAHHHHHHAAHHHHAHHHHHHHAAAHHAAAAHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
12 -1 516 -118422 15931500 -1393715715 83110370856 -3442038889988 98914131973848 -1934769837109239 24700076433968148 -190359997337720070 761773315996034172 -1103965491468903525
result:
ok 2 lines
Test #14:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
HHHHHAAAAHAAAHHHHHHHAHHHHHHHHAAAAAAAHHAAAHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
11 -1 545 -130967 18271423 -1639888218 99139372410 -4107427386206 116275774635214 -2197450287405781 26322256574863445 -179244606237662427 523319284495570563
result:
ok 2 lines
Test #15:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
HHHAAHHHAAAHAAHAAAAAAHAAAAAHAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
12 1 -406 73652 -7881842 553216845 -26778587100 914626749488 -22153015666148 376479705223819 -4361592664337134 32544461435871900 -139613679328696650 258598646194494375
result:
ok 2 lines
Test #16:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
HAHHHHHHAAHAHHHHAAHHHAAAAAAAAAAAHHHHHHHAAHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
13 -1 527 -122750 16685530 -1472547099 88822846461 -3753656881556 111996157192540 -2343707643830695 33645246960464537 -317260844321113614 1817614202549829930 -5476692831742352925 6407858725259866875
result:
ok 2 lines
Test #17:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
HHAAHHAAHHAHAAAAHHHHHHHHHHAAAHHHHHHHHAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
13 -1 497 -109198 14003686 -1166325371 66460583155 -2660126253556 75583133332964 -1521687000018343 21391697252011143 -203491363609522206 1235080019474489430 -4260068761477816125 6248246040514603125
result:
ok 2 lines
Test #18:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
5 -1 17887 -110979990 309313202570 -394757054298089 185667364278415383
result:
ok 2 lines
Test #19:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
5 1 -28339 291134110 -1306956880954 2463270011976289 -1614617709637625875
result:
ok 2 lines
Test #20:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
5 -1 18233 -117640374 319589640262 -333025402281545 110268904239050625
result:
ok 2 lines
Test #21:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
5 1 -15847 79316382 -158183043506 132746083770209 -38244039915422055
result:
ok 2 lines
Test #22:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
5 1 -19263 146339658 -546883073006 1002718799088885 -719300274816640275
result:
ok 2 lines
Test #23:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
4 -1 79984 -2399040086 31980803439824 -159872034396480105
result:
ok 2 lines
Test #24:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
5 -1 20119 -159693358 624396609378 -1201540069879569 910089555070847175
result:
ok 2 lines
Test #25:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
5 -1 22831 -197923526 787635011546 -1320933675894585 509740194941616375
result:
ok 2 lines
Test #26:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHAAAAAAAAAAAA...
output:
7 1 -2907 3512329 -2277324619 852148072075 -183277191421177 20911459348176747 -973433404230010465
result:
ok 2 lines
Test #27:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
6 1 -15236 88478785 -241828438520 308288139960379 -151735148008954244 6968120543061512835
result:
ok 2 lines
Test #28:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
5 -1 16787 -108429014 333421785826 -479587096064553 249046077002247819
result:
ok 2 lines
Test #29:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
HHHHHAAHHHHHHHHHHAAAAHHAAAAAHHHHHHHHAAHAAAHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
11 -1 619 -170075 27311369 -2839558218 199961850606 -9687235073270 320960330387666 -7073267682216901 97781283589358935 -754194552945839775 2435703915741067125
result:
ok 2 lines
Test #30:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
AAAHHHHAAAAAAAAAAHHAHHHHHHHHHHAAAHAAAAHHAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
11 1 -575 146787 -21896349 2113129386 -137907506646 6174544978598 -188188763270746 3784950182806053 -47091337682476059 318537450345140775 -857853983028267225
result:
ok 2 lines
Test #31:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
AHHHHAAHHHHHHHAAAAAHHAAAAHHHHHHHHHHHHHHHAHHHHHAHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
12 -1 642 -182036 30009302 -3186606717 228177917812 -11210873006928 377125717188492 -8510810887417419 123451984434529962 -1064358669544119324 4690340667512993790 -7219569395164987575
result:
ok 2 lines
Test #32:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
HAAAAAAAHHAAHHHHHHAHHHHHHHHAAHAAAAAHHHHHHHAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
12 1 -572 145318 -21632436 2095621395 -138687423960 6400194177572 -206265837649384 4568116062228119 -66910559121944748 601202792041216470 -2832614555442516900 4569333067537363125
result:
ok 2 lines
Test #33:
score: 0
Accepted
time: 0ms
memory: 3684kb
input:
AAHAAAAAAAHHHHAHAHHAAHAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
12 -1 412 -76014 8289492 -593684139 29325609624 -1020151658996 25037796813608 -426874685352135 4875330273447564 -34848668150864190 137110324070808900 -221332391136982125
result:
ok 2 lines
Test #34:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
4 1 -79984 2399040086 -31980803439824 159872034396480105
result:
ok 2 lines
Test #35:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
AHHHAAAAHHHHHHAAHHHHAHHHHHHHAAAHHAAAAHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
12 -1 516 -118422 15931500 -1393715715 83110370856 -3442038889988 98914131973848 -1934769837109239 24700076433968148 -190359997337720070 761773315996034172 -1103965491468903525
result:
ok 2 lines
Test #36:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
HHHHHAAAAHAAAHHHHHHHAHHHHHHHHAAAAAAAHHAAAHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
11 -1 545 -130967 18271423 -1639888218 99139372410 -4107427386206 116275774635214 -2197450287405781 26322256574863445 -179244606237662427 523319284495570563
result:
ok 2 lines
Test #37:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
HHHAAHHHAAAHAAHAAAAAAHAAAAAHAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
12 1 -406 73652 -7881842 553216845 -26778587100 914626749488 -22153015666148 376479705223819 -4361592664337134 32544461435871900 -139613679328696650 258598646194494375
result:
ok 2 lines
Test #38:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
HAHHHHHHAAHAHHHHAAHHHAAAAAAAAAAAHHHHHHHAAHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
13 -1 527 -122750 16685530 -1472547099 88822846461 -3753656881556 111996157192540 -2343707643830695 33645246960464537 -317260844321113614 1817614202549829930 -5476692831742352925 6407858725259866875
result:
ok 2 lines
Test #39:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
HHAAHHAAHHAHAAAAHHHHHHHHHHAAAHHHHHHHHAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
13 -1 497 -109198 14003686 -1166325371 66460583155 -2660126253556 75583133332964 -1521687000018343 21391697252011143 -203491363609522206 1235080019474489430 -4260068761477816125 6248246040514603125
result:
ok 2 lines
Test #40:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
0 -1
result:
ok 2 lines
Test #41:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
0 1
result:
ok 2 lines
Test #42:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
AH
output:
1 1 -3
result:
ok 2 lines
Test #43:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
HA
output:
1 -1 3
result:
ok 2 lines
Test #44:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
A
output:
0 -1
result:
ok 2 lines
Test #45:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
5 -1 17887 -110979990 309313202570 -394757054298089 185667364278415383
result:
ok 2 lines
Test #46:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
H
output:
0 1
result:
ok 2 lines
Test #47:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
HHH
output:
0 1
result:
ok 2 lines
Test #48:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
AHHA
output:
2 -1 10 -21
result:
ok 2 lines
Test #49:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
AHHHAH
output:
3 1 -23 159 -297
result:
ok 2 lines
Test #50:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
5 1 -28339 291134110 -1306956880954 2463270011976289 -1614617709637625875
result:
ok 2 lines
Test #51:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
5 -1 24037 -216441878 909790545422 -1765502876551017 1240157880821893005
result:
ok 2 lines
Test #52:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
5 -1 23311 -184195254 554795736554 -449984687763785 58819818552282375
result:
ok 2 lines
Test #53:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
output:
5 1 -14677 57762994 -90378805186 57449843838733 -12160779031194409
result:
ok 2 lines