QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#432268 | #7564. Game | pandapythoner | AC ✓ | 12390ms | 83216kb | C++20 | 11.8kb | 2024-06-07 01:40:11 | 2024-06-07 01:40:12 |
Judging History
answer
#include <bits/stdc++.h>
#define ll long long
#define flt double
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(i, n) for(int i = 0; i < (n); i += 1)
#define rep1(i, n) for(int i = 1; i < (n); i += 1)
using namespace std;
const ll inf = 1e18;
mt19937 rnd(234);
namespace fft {
typedef double dbl;
struct num {
dbl x, y;
num() { x = y = 0; }
num(dbl x_, dbl y_) : x(x_), y(y_) {}
};
inline num operator+(num a, num b) { return num(a.x + b.x, a.y + b.y); }
inline num operator-(num a, num b) { return num(a.x - b.x, a.y - b.y); }
inline num operator*(num a, num b) { return num(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x); }
inline num conj(num a) { return num(a.x, -a.y); }
int base = 1;
vector<num> roots = { {0, 0}, {1, 0} };
vector<int> rev = { 0, 1 };
const dbl PI = static_cast<dbl>(acosl(-1.0));
void ensure_base(int nbase) {
if (nbase <= base) {
return;
}
rev.resize(1 << nbase);
for (int i = 0; i < (1 << nbase); i++) {
rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (nbase - 1));
}
roots.resize(1 << nbase);
while (base < nbase) {
dbl angle = 2 * PI / (1 << (base + 1));
// num z(cos(angle), sin(angle));
for (int i = 1 << (base - 1); i < (1 << base); i++) {
roots[i << 1] = roots[i];
// roots[(i << 1) + 1] = roots[i] * z;
dbl angle_i = angle * (2 * i + 1 - (1 << base));
roots[(i << 1) + 1] = num(cos(angle_i), sin(angle_i));
}
base++;
}
}
void fft(vector<num>& a, int n = -1) {
if (n == -1) {
n = (int)a.size();
}
assert((n & (n - 1)) == 0);
int zeros = __builtin_ctz(n);
ensure_base(zeros);
int shift = base - zeros;
for (int i = 0; i < n; i++) {
if (i < (rev[i] >> shift)) {
swap(a[i], a[rev[i] >> shift]);
}
}
for (int k = 1; k < n; k <<= 1) {
for (int i = 0; i < n; i += 2 * k) {
for (int j = 0; j < k; j++) {
num z = a[i + j + k] * roots[j + k];
a[i + j + k] = a[i + j] - z;
a[i + j] = a[i + j] + z;
}
}
}
}
vector<num> fa, fb;
vector<int64_t> square(const vector<int>& a) {
if (a.empty()) {
return {};
}
int need = (int)a.size() + (int)a.size() - 1;
int nbase = 1;
while ((1 << nbase) < need) nbase++;
ensure_base(nbase);
int sz = 1 << nbase;
if ((sz >> 1) > (int)fa.size()) {
fa.resize(sz >> 1);
}
for (int i = 0; i < (sz >> 1); i++) {
int x = (2 * i < (int)a.size() ? a[2 * i] : 0);
int y = (2 * i + 1 < (int)a.size() ? a[2 * i + 1] : 0);
fa[i] = num(x, y);
}
fft(fa, sz >> 1);
num r(1.0 / (sz >> 1), 0.0);
for (int i = 0; i <= (sz >> 2); i++) {
int j = ((sz >> 1) - i) & ((sz >> 1) - 1);
num fe = (fa[i] + conj(fa[j])) * num(0.5, 0);
num fo = (fa[i] - conj(fa[j])) * num(0, -0.5);
num aux = fe * fe + fo * fo * roots[(sz >> 1) + i] * roots[(sz >> 1) + i];
num tmp = fe * fo;
fa[i] = r * (conj(aux) + num(0, 2) * conj(tmp));
fa[j] = r * (aux + num(0, 2) * tmp);
}
fft(fa, sz >> 1);
vector<int64_t> res(need);
for (int i = 0; i < need; i++) {
res[i] = llround(i % 2 == 0 ? fa[i >> 1].x : fa[i >> 1].y);
}
return res;
}
vector<int64_t> multiply(const vector<int>& a, const vector<int>& b) {
if (a.empty() || b.empty()) {
return {};
}
if (a == b) {
return square(a);
}
int need = (int)a.size() + (int)b.size() - 1;
int nbase = 1;
while ((1 << nbase) < need) nbase++;
ensure_base(nbase);
int sz = 1 << nbase;
if (sz > (int)fa.size()) {
fa.resize(sz);
}
for (int i = 0; i < sz; i++) {
int x = (i < (int)a.size() ? a[i] : 0);
int y = (i < (int)b.size() ? b[i] : 0);
fa[i] = num(x, y);
}
fft(fa, sz);
num r(0, -0.25 / (sz >> 1));
for (int i = 0; i <= (sz >> 1); i++) {
int j = (sz - i) & (sz - 1);
num z = (fa[j] * fa[j] - conj(fa[i] * fa[i])) * r;
fa[j] = (fa[i] * fa[i] - conj(fa[j] * fa[j])) * r;
fa[i] = z;
}
for (int i = 0; i < (sz >> 1); i++) {
num A0 = (fa[i] + fa[i + (sz >> 1)]) * num(0.5, 0);
num A1 = (fa[i] - fa[i + (sz >> 1)]) * num(0.5, 0) * roots[(sz >> 1) + i];
fa[i] = A0 + A1 * num(0, 1);
}
fft(fa, sz >> 1);
vector<int64_t> res(need);
for (int i = 0; i < need; i++) {
res[i] = llround(i % 2 == 0 ? fa[i >> 1].x : fa[i >> 1].y);
}
return res;
}
vector<int> multiply_mod(const vector<int>& a, const vector<int>& b, int m) {
if (a.empty() || b.empty()) {
return {};
}
int eq = (a.size() == b.size() && a == b);
int need = (int)a.size() + (int)b.size() - 1;
int nbase = 0;
while ((1 << nbase) < need) nbase++;
ensure_base(nbase);
int sz = 1 << nbase;
if (sz > (int)fa.size()) {
fa.resize(sz);
}
for (int i = 0; i < (int)a.size(); i++) {
int x = (a[i] % m + m) % m;
fa[i] = num(x & ((1 << 15) - 1), x >> 15);
}
fill(fa.begin() + a.size(), fa.begin() + sz, num{ 0, 0 });
fft(fa, sz);
if (sz > (int) fb.size()) {
fb.resize(sz);
}
if (eq) {
copy(fa.begin(), fa.begin() + sz, fb.begin());
} else {
for (int i = 0; i < (int)b.size(); i++) {
int x = (b[i] % m + m) % m;
fb[i] = num(x & ((1 << 15) - 1), x >> 15);
}
fill(fb.begin() + b.size(), fb.begin() + sz, num{ 0, 0 });
fft(fb, sz);
}
dbl ratio = 0.25 / sz;
num r2(0, -1);
num r3(ratio, 0);
num r4(0, -ratio);
num r5(0, 1);
for (int i = 0; i <= (sz >> 1); i++) {
int j = (sz - i) & (sz - 1);
num a1 = (fa[i] + conj(fa[j]));
num a2 = (fa[i] - conj(fa[j])) * r2;
num b1 = (fb[i] + conj(fb[j])) * r3;
num b2 = (fb[i] - conj(fb[j])) * r4;
if (i != j) {
num c1 = (fa[j] + conj(fa[i]));
num c2 = (fa[j] - conj(fa[i])) * r2;
num d1 = (fb[j] + conj(fb[i])) * r3;
num d2 = (fb[j] - conj(fb[i])) * r4;
fa[i] = c1 * d1 + c2 * d2 * r5;
fb[i] = c1 * d2 + c2 * d1;
}
fa[j] = a1 * b1 + a2 * b2 * r5;
fb[j] = a1 * b2 + a2 * b1;
}
fft(fa, sz);
fft(fb, sz);
vector<int> res(need);
for (int i = 0; i < need; i++) {
int64_t aa = llround(fa[i].x);
int64_t bb = llround(fb[i].x);
int64_t cc = llround(fa[i].y);
res[i] = static_cast<int>((aa + ((bb % m) << 15) + ((cc % m) << 30)) % m);
}
return res;
}
} // namespace fft
const ll mod = 998244353;
ll bin_pow(ll x, ll n) {
if (n == 0) {
return 1;
}
ll a = bin_pow(x, n / 2);
a = (a * a) % mod;
if (n & 1) {
a = (a * x) % mod;
}
return a;
}
ll rev(ll x) {
return bin_pow(x, mod - 2);
}
int n;
vector<string> a, resp;
int cnt[27][27][27][27][27];
int32_t main() {
if (1) {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
cin >> n;
a.resize(n);
resp.resize(n);
for (int i = 0; i < n; i += 1) {
cin >> a[i] >> resp[i];
}
vector<ll> sets(n + 1);
rep(mask, 32) {
memset(cnt, 0, sizeof(cnt));
auto get_lr = [&](int i, int j) {
int l = a[i][j] - 'A';
int r = l;
if (resp[i][j] == '>') {
l += 1;
r = 25;
} else if (resp[i][j] == '<') {
l = 0;
r -= 1;
}
if ((mask >> j) & 1) {
r -= 1;
}
if (l > r) {
l = 1;
r = 0;
}
return make_pair(l, r);
};
rep(i, n) {
auto [l0, r0] = get_lr(i, 0);
auto [l1, r1] = get_lr(i, 1);
auto [l2, r2] = get_lr(i, 2);
auto [l3, r3] = get_lr(i, 3);
auto [l4, r4] = get_lr(i, 4);
rep(x0, 2) rep(x1, 2) rep(x2, 2) rep(x3, 2) rep(x4, 2) {
auto t0 = vector<int>{ l0, r0 + 1 } [x0] ;
auto t1 = vector<int>{ l1, r1 + 1 } [x1] ;
auto t2 = vector<int>{ l2, r2 + 1 } [x2] ;
auto t3 = vector<int>{ l3, r3 + 1 } [x3] ;
auto t4 = vector<int>{ l4, r4 + 1 } [x4] ;
if ((x0 + x1 + x2 + x3 + x4) % 2 == 0) {
cnt[t0][t1][t2][t3][t4] += 1;
} else {
cnt[t0][t1][t2][t3][t4] -= 1;
}
}
}
rep1(x0, 27) rep(x1, 27) rep(x2, 27) rep(x3, 27) rep(x4, 27) {
cnt[x0][x1][x2][x3][x4] += (cnt[x0 - 1][x1][x2][x3][x4]);
}
rep(x0, 27) rep1(x1, 27) rep(x2, 27) rep(x3, 27) rep(x4, 27) {
cnt[x0][x1][x2][x3][x4] += (cnt[x0][x1 - 1][x2][x3][x4]);
}
rep(x0, 27) rep(x1, 27) rep1(x2, 27) rep(x3, 27) rep(x4, 27) {
cnt[x0][x1][x2][x3][x4] += (cnt[x0][x1][x2 - 1][x3][x4]);
}
rep(x0, 27) rep(x1, 27) rep(x2, 27) rep1(x3, 27) rep(x4, 27) {
cnt[x0][x1][x2][x3][x4] += (cnt[x0][x1][x2][x3 - 1][x4]);
}
rep(x0, 27) rep(x1, 27) rep(x2, 27) rep(x3, 27) rep1(x4, 27) {
cnt[x0][x1][x2][x3][x4] += (cnt[x0][x1][x2][x3][x4 - 1]);
}
int bits = ((mask >> 0) % 2 + (mask >> 1) % 2 + (mask >> 2) % 2 + (mask >> 3) % 2 + (mask >> 4) % 2);
if (bits % 2 == 0) {
rep(x0, 27) rep(x1, 27) rep(x2, 27) rep(x3, 27) rep(x4, 27) {
int val = cnt[x0][x1][x2][x3][x4];
assert(0 <= val and val <= n);
sets[val] += 1;
}
} else {
rep(x0, 27) rep(x1, 27) rep(x2, 27) rep(x3, 27) rep(x4, 27) {
int val = cnt[x0][x1][x2][x3][x4];
assert(0 <= val and val <= n);
sets[val] -= 1;
}
}
}
vector<ll> f(n + 1);
f[0] = 1;
for (int i = 1; i <= n; i += 1) {
f[i] = (f[i - 1] * i) % mod;
}
vector<int> aboba(n + 1);
for(int i = 0; i <= n; i += 1){
aboba[i] = rev(f[i]);
}
reverse(all(aboba));
vector<int> abiba(n + 1);
for(int x = 0; x <= n; x += 1){
abiba[x] = (sets[x] + mod) * f[x] % mod;
}
auto abobebra = fft::multiply_mod(aboba, abiba, mod);
vector<ll> good_count(n + 1);
for (int x = 0; x <= n; x += 1) {
good_count[x] = abobebra[n + x];
}
good_count[0] = 1;
for (int i = 0; i < n; i += 1) {
ll left = good_count[i] * (n - i) % mod;
ll right = good_count[i + 1];
ll value = (left + mod - right) % mod;
cout << value << " ";
}
cout << "\n";
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2557ms
memory: 59868kb
input:
2 FAKER >>>>> CHOVY =====
output:
0 2
result:
ok 2 number(s): "0 2"
Test #2:
score: 0
Accepted
time: 2561ms
memory: 59920kb
input:
3 BVHUQ ><>>< YJCEQ <<><< SXXWZ >>==>
output:
1 4 0
result:
ok 3 number(s): "1 4 0"
Test #3:
score: 0
Accepted
time: 2646ms
memory: 59872kb
input:
8 IFSXA >><<= ZAKDA <>=>= UZVAA <<<>= MTACA <>>>= RJKVA <><<= IOXOA >=<<= MRMHA ><<<= BYFWA ==<>=
output:
0 16 108 396 816 720 0 0
result:
ok 8 numbers
Test #4:
score: 0
Accepted
time: 2516ms
memory: 59860kb
input:
8 BRKPR ><=<> VUCTO <<=<= PTCDB <<=>> PHMGV <><>< FGWHD >><>> SUSFH <<<<> IOLDD <<<<> WJPXX <><<<
output:
0 14 120 444 744 360 0 0
result:
ok 8 numbers
Test #5:
score: 0
Accepted
time: 2596ms
memory: 60168kb
input:
10 UAVZE =>=<= QVGJB >==>> ZLHUS >>>=> PGZOO ==<>< LAKYL =<=<= IMQAQ <>>== OBWGV >>=<> KQSOR <<>>= KGFVD >=<== RFDGJ <>><>
output:
2 66 48 0 0 0 0 0 0 0
result:
ok 10 numbers
Test #6:
score: 0
Accepted
time: 2660ms
memory: 60164kb
input:
10 GOMVB >>>>< DSPSI =><== UKTNW <<>=< SKNLH >=<>< TNYRS =<<>< QZHXW <==>> NLWVU ><=>= WHBAI ><>>= QXDIC <=<>> JBUFE =>==<
output:
0 86 32 0 0 0 0 0 0 0
result:
ok 10 numbers
Test #7:
score: 0
Accepted
time: 2665ms
memory: 60164kb
input:
10 SBDSY >>>=> NSYAP <><>= PIFGA >=>=> URDJY <>>>< EDLLY =><<> ZLWTD >>>>= OTTLU <><=< HYKKZ ===<< VRBUB =<><> AXKEY <==<>
output:
2 60 90 42 0 0 0 0 0 0
result:
ok 10 numbers
Test #8:
score: 0
Accepted
time: 2404ms
memory: 59868kb
input:
10 CPIAM ><>>> FZBGT ><>>> EUFKN ><>=> OWUOO <<<<> RJOOA <>><> VOMTV <<><= FZAYC ><><> GOQML ><><> WZGOV <<><= AAAAA <<<<<
output:
1 9 72 504 3024 15120 60480 181440 362880 362880
result:
ok 10 numbers
Test #9:
score: 0
Accepted
time: 2437ms
memory: 60104kb
input:
10 MYAFR <<>=< UUOJK <<><> AWYJM ><=<> FOSPK ><><> TUUIA <<><> OJAMS <>><< BUEGG ><>>> PTDUK <<><> SBLYM <>><> SFAAX >>>==
output:
0 14 128 816 4344 19320 65520 146160 161280 0
result:
ok 10 numbers
Test #10:
score: 0
Accepted
time: 2342ms
memory: 59836kb
input:
10 QJQVM <>>>< NYNHE ><>>< WSBQB <<>>> ONXCP <<<>< CKICH >>>>< CQHZL >>><< SPKWY <<<<< FAXVS >><<< RVBOC <<><> TRPLG =>>==
output:
0 28 250 1146 2856 3000 0 0 0 0
result:
ok 10 numbers
Test #11:
score: 0
Accepted
time: 2414ms
memory: 59948kb
input:
10 PDOHN <>>>< YIBBD <>>>< VKHGC <><>> KLJOB ><>>> DIUHJ >>=>< AGDCK ><>>> FFXBK >><>< CHIEL ><>>> HGPXS >>><< GFHRX =>>=<
output:
0 38 230 822 2040 3480 2880 0 0 0
result:
ok 10 numbers
Test #12:
score: 0
Accepted
time: 2417ms
memory: 59828kb
input:
10 BWSGL ><<>> XEXGK <><>> OUHKP <>>=< ZWXCT <><>< VWAOX ><><< KXAHA ><>>> VVFUL ><<<> RHBTD >>><> FHBMB >>=<> JKVSX >==>>
output:
0 32 242 930 2424 5160 5760 0 0 0
result:
ok 10 numbers
Test #13:
score: 0
Accepted
time: 2444ms
memory: 59960kb
input:
10 TFXCY >><<< ALEDI ><>>> YBXWE <><<> YVCHH <<>>< JCYDR ><=>< GNURG ><<<< QFLEM <>>>> JUUHR ><><< LMDZE ><><< TEDEE >>=><
output:
0 46 268 564 144 0 0 0 0 0
result:
ok 10 numbers
Test #14:
score: 0
Accepted
time: 11189ms
memory: 83020kb
input:
100000 BNLGH >>=== QXYTZ >>=>> NRBRX <==== HSKHN <<>>> WPOWG >===> UXFEU =><>> GROWO =><>> VPKSO <><>< WKUQA ===>> KGKHU >=>>> YSIHF >=>>< TOSXN <=>=< HTCKZ =>=>= LIDLA >==>= MNVDK <<<=> WHGMQ ><>>= BRCSN ><<>> YLOEF <<==> IBVUP <><== JHWHE <==>> CBSKF >==>= OLGHJ <>><< OUDND =>==< AMFMU =<=== SDUHG...
output:
12144 412636794 259958531 471914400 521830768 776198196 987954473 677670949 929976028 435141791 915818255 77808332 373696275 860004456 815590598 827302790 334750217 297638785 684154009 734333884 468372005 941077614 669579770 347535008 712117434 881704206 973579427 385468207 664289497 158009373 53637...
result:
ok 100000 numbers
Test #15:
score: 0
Accepted
time: 11222ms
memory: 83208kb
input:
100000 YZHMP ><<== WTMOD <>><< RPZJR >=>=< AAJNC ===>= DIHKN =><>< ANVCM <<><= GLDOE <><=> KSNER <>>== WRKUF =<<>< ESGBH =><=< QTAKH <>=>< JGOSQ ><<<= MYSQR =>>== KLRPC =<=>< QRMKD ===== FCBZE >>>=< BNXDB =><=> NNRQD >==== BPVWI ==<=< KXEYZ ===>< IJMLR ==<>< ZGHZX =<=>< NDLJA <=<<< NOVNI ><<<< JKSRM...
output:
12223 400459039 28986202 438885749 273376351 163951784 446281085 40534769 335228183 96236785 880355311 987490628 488442137 827131227 536678086 420675015 209408414 489894579 26613846 266498745 429205709 284226414 110233883 328154083 561800066 269995982 113946391 76900398 905441256 821243833 20626991 ...
result:
ok 100000 numbers
Test #16:
score: 0
Accepted
time: 11001ms
memory: 83216kb
input:
100000 UNCSX <<==< FOYMG =<==< WQXDL <=<>= RKJSP <=>>= LAXXT ><<== IEMZF ==><= DFSET >=><= CWRSU <<>== XBCYM ><=>< YFAWT >><=< HTRNJ <<<>> ZWKMT ===>= QDLYL <<=<< JOFQE ==<>> SWETU <<><> MYVMS =<>=< DGRNR =<>>< CNXBA <<<>= WDWYZ =<>>> KPNNU >=>=< QTGOB ==<>< JCHUK ><=== MLTEW =<>=> DTMMV =<=>= BSPZQ...
output:
12256 398686308 110275411 25618548 98398475 75789291 450067286 554959802 735917475 608870282 245681817 893103261 540261582 229311537 936917938 470322306 441117213 243813087 255324265 12696724 854288754 806520692 86012500 328564694 878537022 839751145 915142745 18140745 125518575 342802686 947890980 ...
result:
ok 100000 numbers
Test #17:
score: 0
Accepted
time: 11412ms
memory: 82768kb
input:
100000 FNVIO ><<=< ISCUB ><><> GQCGY ><>>< IIREF ><>>> LAWQL >><<< VDQNS <>><< ZDJDH <>>>= KAYMX >><<< KQWNL ><<<< MWVRW ><<<< FETOJ >=><< LEEOT >=><< ZGJPH <<><= VDPHC <>>>> VJRWA <<><> SCRPJ <>><< JBQCF >>>>> YWVGU <<<>< XGWNB <<<<> BTAWV ><><< RSMBD <<>>> KFBJX ><><< GPSZZ ><><< WMSOJ <<><< QLXDF...
output:
1 99999 17256472 629188600 994653422 292821735 911451747 83353224 313471011 405421054 346258483 928805941 779780412 28863579 29385371 263188556 923438024 483744622 815893954 359620773 119778186 363999506 944722253 608984733 934576938 654424456 495668524 619666932 294467430 975718913 171023568 124035...
result:
ok 100000 numbers
Test #18:
score: 0
Accepted
time: 11459ms
memory: 82904kb
input:
100000 LMPEM >>>>< TOLDK >>>>< JRYKL >=<>< WRTSU ==<=< TZPGR <<<>< BHJXB >><<> RABOA <>><> TXPJU ><>>< YVFBJ <<=>< NHATH >>><< CNZDF >><>= VHJJY >>>>< DOUAS >><>< GMMQA >><<> AMKPR >>>>< IKAET >>>>< MFRKW <><<< SSMLJ <<<<< YAMZX <><<< CCXTO >><<< QNAAD <>>>> XDHLM <>>>< BKGQR >>>>< UXXOM ><<>< ANGIJ...
output:
0 933308107 299928578 143136372 376251907 975068160 721593698 753716245 898914068 490205891 886874629 146781702 587935621 279193639 699856836 561537033 880030199 518890130 56000918 362873285 264834282 611906519 200388605 960190510 691501587 606436430 881745603 751535317 348317466 237651997 812697060...
result:
ok 100000 numbers
Test #19:
score: 0
Accepted
time: 11936ms
memory: 82952kb
input:
100000 GKZXQ >><<< KHLZG <><<> XOPSL <><<< BAIDJ >><<< ARFUW >=<<< SRWMZ ><<>< IXTCI ><<>> CUFJQ ><<<< POBFV ><>>= XZCXW <<<<< NYEWD ><><> CWOQS ><<>> VILXN >><<> AYMDC ><<<> MBCPI >>>>> CFRWC >><<> CXNGB ><<<> QNFZL ><><> PIGHX <><<< UUKUR <<<<< TUDZQ ><><> GILEV >><>= EGTTE >><<> RSKCL ><<>> LYCDJ...
output:
0 166507515 459156293 304072419 460723604 974806918 569354203 431542442 512958995 436405304 696400930 642914783 541251712 836652606 565059619 514610302 346747578 937985955 592127812 100884846 134893017 448171682 583736771 651700927 454623153 163064670 98018215 70402567 66918097 107584460 749714113 1...
result:
ok 100000 numbers
Test #20:
score: 0
Accepted
time: 11855ms
memory: 82856kb
input:
100000 BILQU ><><< EBKTE >><<> NKHCI <<>>> GKVMX >><<< GIWIC ><<<> MAJDU >>=>< YULTQ <<><< KUVIK ><<>> FHYGI >><>> JOFAK >=>>> WHJPB <=><> MOSVM >=<<> MDBWH <>><> VLLQC <<><> YQTQA <<<<> VZJNK <<><= TNHBE <>>>> OHYMP >><<> FQAOU ><><< LNWSW >><<< VBFVF <>><> OMQUC >><<> HCIUP >>><> MMZQH >><<> YJZWL...
output:
0 38401793 447045659 902564881 855486954 858682963 916341122 319325485 19812241 668526803 143151417 331148639 425925192 804865129 333676787 704794449 910479352 696417420 82040052 29985024 973090487 9476047 487918272 830170804 447737654 497561219 593481691 928465739 179957021 384533495 178611683 4766...
result:
ok 100000 numbers
Test #21:
score: 0
Accepted
time: 11645ms
memory: 82944kb
input:
100000 KSHEU ><><< LUTYV ><<<< MXQOI ><<>> NNMHY ><><< NZIPQ ><><< XMKMH <><>> DDFVV >>><< TMRIN <<><< YDSBB ==<>> GEIFO >><>< JRWVV ><<<< LXVTF ><<>> KFCQQ >>><< TVKCO ><<>< OHAGB >>><= PEVCO ><<>< LYCEB ><>>> NNNTN ><<>< EYYBZ ><<>< MPCCW ><>>< HTJKP ><><< LQQDT ><<>< WBTLI >><>= JRYTE ><<>> POITD...
output:
0 964094440 836003257 708459847 871957496 654344326 948234133 953935212 104979316 364845725 665219506 642340940 870161743 128194009 326925049 353939789 704216254 589740748 620536805 305640004 484148956 831968196 6769193 754098116 546127667 437282971 570088555 466566847 739533250 638265014 473500063 ...
result:
ok 100000 numbers
Test #22:
score: 0
Accepted
time: 11755ms
memory: 82816kb
input:
100000 IMBCQ <<>>> SLSQD <<<=> AEBES >>>>< HTEYK ><><> BRSCG ><<>> LDIEX <<><< BMEJV ><<>< LCKFQ <><>> IPIDE =<>=> IPSKI ><>>> IYLZC =<><> EOQKE ><>>> EAOOD >>=<> XGZUO <><<= RAVYT <><<< EVMYK ><><> GWXYP <<<<> UEVNV <><=< AQQOY ><><< NRJDS <<<>= HCNOG <><>> SULRW <<><< FXNYW ><><< NEJQZ <><=< LYWGI...
output:
0 666826810 289231209 635258529 546720275 543561692 384443596 63424828 510070428 21542771 129058559 151021435 187384460 692633074 922852987 414682697 568116010 769155697 91852932 392144234 495241700 671207649 143169942 467816836 792533501 612880812 687987052 299606463 754344297 139546526 882788940 4...
result:
ok 100000 numbers
Test #23:
score: 0
Accepted
time: 12002ms
memory: 82772kb
input:
100000 FNFJC >=>>> JBTYS >>=<< QVCYB <<><> TTGOO <>>>> CNNNE >=<<= HCQEM >>><< KTESX ><><< RLPVL <>><> CQADI ><><< NCZRF <><<> NTWBK <><>> OJUNY <>><< MHIDY >>>>< LFECL >>>>< ENNVS >=<<< YYXYK <<<<> BALXT >>><> JVXBJ ><<>< PTDBE ><>>> RCFNT <>><> ZPWFG <<=>> MSVDA ><<<> YJXSV <><<< DOVKD ><<>> DXSPO...
output:
0 93009970 219804152 844567284 891926848 279947250 689135271 860615218 13010915 929722006 847603974 484303861 136418364 827768488 46032089 429102220 810639676 270957951 53183964 293737892 477650398 234505706 517796197 156812171 966975447 945982240 982711670 726121039 576777787 297259995 372223803 55...
result:
ok 100000 numbers
Test #24:
score: 0
Accepted
time: 12390ms
memory: 82828kb
input:
100000 TPOQJ <<<<> XUUDN <<<>< YFAGQ <>>>< VWSWT <<<<> GITXC <><<< AYRDP ><>>< ZOXOZ <=>>= OQEEJ >>>>> LMMFK <>>>< YQMTZ <>=<< BAWDI >><>> TQUIE <><>> LQFOZ ><<<= XYJNB ><>>> ANPKA ><<>> XNAGO <>>>> AARCV >>>=> IMBOU <>><< ECQGU =><>< EWFDL <<<>> AFWTZ >>><< FKLNJ =><>< CEPMR >><<= DPBFC ><><> YIHUM...
output:
0 731820826 161250844 5585597 470134782 556060811 257099719 111798459 512206035 622445488 559050664 46611111 378388720 149248369 900197806 243792137 756773235 70170364 529089164 538199381 933788591 643539872 670120393 985010776 935645389 262590905 309790899 412774006 752230002 629492948 403174711 17...
result:
ok 100000 numbers
Test #25:
score: 0
Accepted
time: 12342ms
memory: 83060kb
input:
100000 QBQZL <><<> DLOQX ><<<< QFGSH >>>>> GXSNZ ><<<< RDDUT <>>=< WXVWY <<<=< VCCQL <>>=> YSTQR <<>=< DFUIN =><>< GEGVJ <>><< SDHHM >><>> HQFRU >><>< ZHMPJ <<=>> TVMYN ><><< RCXHI <><>> CIYCA >><<> KVATT <<>>< GUWBK <<<>> EUUKP ><<>> BHKJW >><<< XAIMU <>><> LBYQV >><>= FKLSD >>><> VUQIB <<<<> ATMAS...
output:
0 646701422 310542475 455998428 727671893 716649694 854302830 116778947 413591563 630505272 957959940 707160196 798797072 884778819 315551957 165825483 211983439 44654126 489986563 445117918 290339951 363429453 357974679 236558197 5060958 200582726 105877545 962523756 472161796 650269082 123320504 8...
result:
ok 100000 numbers
Test #26:
score: 0
Accepted
time: 2676ms
memory: 60060kb
input:
1 ZZZZZ =>=>>
output:
1
result:
ok 1 number(s): "1"