QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#565945 | #8095. Lati@s | cocoa_chan | AC ✓ | 40ms | 10684kb | C++14 | 6.3kb | 2024-09-15 22:41:08 | 2024-09-15 22:41:08 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ll;
namespace nim {
using u16 = unsigned short;
using u32 = unsigned;
using u64 = unsigned long long;
// G16: primitive root in F_(2^16)
// G16\^3 = 2^15
constexpr u16 G16 = 10279U;
u16 expBuffer[4 * (1 << 16) + 4];
u16 *exp = expBuffer + (2 * (1 << 16) + 4), *exp3 = exp + 3, *exp6 = exp + 6;
int log[1 << 16];
u64 tabSq[4][1 << 16], tabSqrt[4][1 << 16], tabSolveQuad1[4][1 << 16];
// L: power of 2
// (a0 + 2^l a1) \* (b0 + 2^l b1)
// = (a0\*b0 \+ 2^(l-1)\*a1\*b1) + 2^l (a0\*b1 \+ a1\*b0 \+ a1\*b1)
template <int L> inline u64 mulSlow(u64 a, u64 b) {
static constexpr int l = L >> 1;
const u64 a0 = a & ((1ULL << l) - 1), a1 = a >> l;
const u64 b0 = b & ((1ULL << l) - 1), b1 = b >> l;
const u64 a0b0 = mulSlow<l>(a0, b0);
return (a0b0 ^ mulSlow<l>(1ULL << (l - 1), mulSlow<l>(a1, b1)))
| (a0b0 ^ mulSlow<l>(a0 ^ a1, b0 ^ b1)) << l;
}
template <> inline u64 mulSlow<1>(u64 a, u64 b) {
return a & b;
}
// 2^31 \* a
inline u32 mul31(u32 a) {
const u16 a0 = a, a1 = a >> 16;
const u16 a01 = a0 ^ a1;
return exp6[log[a1]] | (u32)exp3[log[a01]] << 16;
}
inline u16 mul(u16 a, u16 b) {
return exp[log[a] + log[b]];
}
inline u32 mul(u32 a, u32 b) {
const u16 a0 = a, a1 = a >> 16;
const u16 b0 = b, b1 = b >> 16;
const u16 a01 = a0 ^ a1;
const u16 b01 = b0 ^ b1;
const u16 a0b0 = mul(a0, b0);
return (a0b0 ^ exp3[log[a1] + log[b1]]) | (u32)(a0b0 ^ mul(a01, b01)) << 16;
}
inline u64 mul(u64 a, u64 b) {
const u32 a0 = a, a1 = a >> 32;
const u32 b0 = b, b1 = b >> 32;
const u32 a01 = a0 ^ a1;
const u32 b01 = b0 ^ b1;
const u32 a0b0 = mul(a0, b0);
return (a0b0 ^ mul31(mul(a1, b1))) | (u64)(a0b0 ^ mul(a01, b01)) << 32;
}
inline u16 sq(u16 a) {
return tabSq[0][a];
}
inline u32 sq(u32 a) {
const u16 a0 = a, a1 = a >> 16;
return tabSq[0][a0] ^ tabSq[1][a1];
}
inline u64 sq(u64 a) {
const u16 a0 = a, a1 = a >> 16, a2 = a >> 32, a3 = a >> 48;
return tabSq[0][a0] ^ tabSq[1][a1] ^ tabSq[2][a2] ^ tabSq[3][a3];
}
inline u16 sqrt(u16 a) {
return tabSqrt[0][a];
}
inline u32 sqrt(u32 a) {
const u16 a0 = a, a1 = a >> 16;
return tabSqrt[0][a0] ^ tabSqrt[1][a1];
}
inline u64 sqrt(u64 a) {
const u16 a0 = a, a1 = a >> 16, a2 = a >> 32, a3 = a >> 48;
return tabSqrt[0][a0] ^ tabSqrt[1][a1] ^ tabSqrt[2][a2] ^ tabSqrt[3][a3];
}
// (a0 + 2^l a1) \* (b0 + 2^l b1) = 1
// <=> [ a0 2^(l-1)\*a1 ] \* [ b0 ] = [ 1 ]
// [ a1 a0\+a1 ] [ b1 ] [ 0 ]
inline u16 inv(u16 a) {
assert(a);
return exp[((1 << 16) - 1) - log[a]];
}
inline u32 inv(u32 a) {
assert(a);
const u16 a0 = a, a1 = a >> 16;
const u16 a01 = a0 ^ a1;
const u16 d = inv((u16)(mul(a0, a01) ^ exp3[log[a1] + log[a1]]));
return mul(d, a01) | (u32)mul(d, a1) << 16;
}
inline u64 inv(u64 a) {
assert(a);
const u32 a0 = a, a1 = a >> 32;
const u32 a01 = a0 ^ a1;
const u32 d = inv(mul(a0, a01) ^ mul31(sq(a1)));
return mul(d, a01) | (u64)mul(d, a1) << 32;
}
// f(x) := x\^2 \+ x
// bsr(x\^2) = bsr(x)
// f: {even in [0, 2^L)} -> [0, 2^(L-1)): linear isom.
// f(x0 + 2^l x1) = (f(x0) \+ 2^(l-1)\*x1\^2) + 2^l f(x1)
template <int L> inline u64 solveQuad1Slow(u64 a) {
static constexpr int l = L >> 1;
assert(!(a >> (L - 1)));
const u64 a0 = a & ((1ULL << l) - 1), a1 = a >> l;
const u64 x1 = solveQuad1Slow<l>(a1);
const u64 b0 = a0 ^ mul(1ULL << (l - 1), sq(x1));
const u64 s = b0 >> (l - 1);
return solveQuad1Slow<l>(b0 ^ s << (l - 1)) | (x1 ^ s) << l;
}
template <> inline u64 solveQuad1Slow<1>(u64 a) {
assert(!a);
return 0;
}
// x\^2 \+ x \+ a = 0
// solutions: x, x \+ 1
inline u64 solveQuad1(u64 a) {
assert(!(a >> 63));
const u16 a0 = a, a1 = a >> 16, a2 = a >> 32, a3 = a >> 48;
return tabSolveQuad1[0][a0] ^ tabSolveQuad1[1][a1] ^ tabSolveQuad1[2][a2] ^ tabSolveQuad1[3][a3];
}
// x\^2 \+ a\*x \+ b = 0
// solutions: x, x \+ a
inline bool isSolvableQuad(u64 a, u64 b) {
return !(mul(inv(sq(a)), b) >> 63);
}
inline u64 solveQuad(u64 a, u64 b) {
return a ? mul(a, solveQuad1(mul(inv(sq(a)), b))) : sqrt(b);
}
struct Preparator {
Preparator() {
exp[0] = 1;
for (int i = 1; i < (1 << 16) - 1; ++i) exp[i] = mulSlow<16>(exp[i - 1], G16);
for (int i = (1 << 16) - 1; i < 2 * (1 << 16); ++i) exp[i] = exp[i - ((1 << 16) - 1)];
for (int i = 0; i < (1 << 16) - 1; ++i) log[exp[i]] = i;
log[0] = -(1 << 16) - 2;
for (int e = 0; e < 64; ++e) {
const u64 x = mul(1ULL << e, 1ULL << e);
for (int i = 0; i < 1 << (e & 15); ++i) tabSq[e >> 4][i | 1 << (e & 15)] = tabSq[e >> 4][i] ^ x;
}
for (int e = 0; e < 64; ++e) {
u64 x = 1ULL << e;
for (int j = 0; j < 63; ++j) x = sq(x);
for (int i = 0; i < 1 << (e & 15); ++i) tabSqrt[e >> 4][i | 1 << (e & 15)] = tabSqrt[e >> 4][i] ^ x;
}
for (int e = 0; e < 63; ++e) {
const u64 x = solveQuad1Slow<64>(1ULL << e);
for (int i = 0; i < 1 << (e & 15); ++i) tabSolveQuad1[e >> 4][i | 1 << (e & 15)] = tabSolveQuad1[e >> 4][i] ^ x;
}
}
} preparator;
} // namespace nim
ll n,m,i,j,k,l,r,x,y,z,w,s,t;
vector<vector<nim::u64>> a;
ll determinant()
{
ll i,j,k,x;
for(i=1;i<=n;i++)
{
x=-1;
for(j=i;j<=n;j++)
{
if(a[j][i]!=0)
{
x=j;
break;
}
}
if(x==-1)
return 0;
// printf("(%lld,%lld)\n",x,a[x][i]);
for(j=1;j<=n;j++)
{
swap(a[i][j],a[x][j]);
}
// printf("(%lld:%lld)\n",i,a[i][i]);
for(j=1;j<=n;j++)
{
if(j==i)
continue;
nim::u64 z=nim::mul(nim::inv(a[i][i]),a[j][i]);
for(k=1;k<=n;k++)
{
a[j][k]=a[j][k]^nim::mul(z,a[i][k]);
}
}
}
return 1;
}
int main()
{
scanf("%llu",&n);
a.resize(n+1);
for(i=1;i<=n;i++)
a[i].resize(n+1);
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
scanf("%llu",&x);
a[i][j]=x;
}
}
//printf("?");
if(determinant()!=0)
{
printf("First");
}
else
printf("Second");
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 10420kb
input:
3 0 1 2 1 2 3 1 2 1
output:
First
result:
ok Correct!
Test #2:
score: 0
Accepted
time: 0ms
memory: 10244kb
input:
2 1 2 2 3
output:
Second
result:
ok Correct!
Test #3:
score: 0
Accepted
time: 3ms
memory: 10204kb
input:
1 1
output:
First
result:
ok Correct!
Test #4:
score: 0
Accepted
time: 0ms
memory: 10280kb
input:
1 0
output:
Second
result:
ok Correct!
Test #5:
score: 0
Accepted
time: 3ms
memory: 10264kb
input:
1 10989383527054532353
output:
First
result:
ok Correct!
Test #6:
score: 0
Accepted
time: 0ms
memory: 10256kb
input:
2 1005615900205140029 1751816340545810590 9799519860537995223 8238669462598964242
output:
First
result:
ok Correct!
Test #7:
score: 0
Accepted
time: 6ms
memory: 10492kb
input:
2 14541323676997420853 9863599201339623558 7531150024641852914 12902197593218027764
output:
Second
result:
ok Correct!
Test #8:
score: 0
Accepted
time: 0ms
memory: 10220kb
input:
5 1 1 1 0 1 0 0 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 0 1 1
output:
First
result:
ok Correct!
Test #9:
score: 0
Accepted
time: 0ms
memory: 10364kb
input:
7 0 1 0 0 1 1 1 0 1 1 1 1 0 1 1 0 0 0 1 1 0 1 0 0 0 0 0 1 1 0 1 0 1 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 1
output:
First
result:
ok Correct!
Test #10:
score: 0
Accepted
time: 0ms
memory: 10248kb
input:
8 1 1 0 0 1 1 0 0 0 1 1 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0
output:
Second
result:
ok Correct!
Test #11:
score: 0
Accepted
time: 6ms
memory: 10324kb
input:
30 1 1 1 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 0 1 1 0 0 1 1 0 0 0 1 0 0 1 0 1 1 0 0 0 1 1 1 1 0 0 0 0 0 1 0 1 1 1 0 1 0 1 1 0 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 1 0 0 1 1 0 1 1 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1 1 1 1 1 0 1 1 1 1 0 0 0 0 0 1 1 1 0 0 1 0 1 0 1 1 1 1 1 0 1 0 1 1 0 1 1 1 1...
output:
Second
result:
ok Correct!
Test #12:
score: 0
Accepted
time: 24ms
memory: 10436kb
input:
150 0 0 1 1 0 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 1 0 1 0 1 0 1 0 0 0 0 1 1 0 1 0 0 1 1 0 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 1 1 0 1 1 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 1 1 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1 0 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 1 0 1 1 1 1 0 0 1 0 ...
output:
Second
result:
ok Correct!
Test #13:
score: 0
Accepted
time: 20ms
memory: 10684kb
input:
150 1 0 0 0 0 1 0 1 0 0 1 0 0 1 1 0 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 0 1 1 1 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 1 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 0 0 0 1 0 1 0 1 1 1 1 1 1 0 1 0 0 1 1 1 1 0 1 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 0 0 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 1 1 0 0 1 0 1 0 0 1 1 0 0 0 0 0 ...
output:
First
result:
ok Correct!
Test #14:
score: 0
Accepted
time: 3ms
memory: 10452kb
input:
6 1 0 3 3 1 0 0 2 3 0 1 3 1 1 3 1 3 3 3 0 0 3 2 0 3 1 3 1 3 0 1 2 3 0 1 0
output:
First
result:
ok Correct!
Test #15:
score: 0
Accepted
time: 0ms
memory: 10324kb
input:
10 2 2 1 1 0 0 0 2 0 2 0 3 3 0 3 1 1 3 1 0 2 0 2 1 1 0 3 3 3 3 0 3 3 1 1 0 1 3 1 1 1 3 3 1 3 0 2 2 3 0 3 2 3 0 0 1 3 0 2 0 3 2 1 0 1 2 1 0 2 0 1 0 3 0 1 2 2 2 0 0 0 1 3 0 3 1 1 1 0 2 1 3 1 3 0 2 0 2 3 2
output:
Second
result:
ok Correct!
Test #16:
score: 0
Accepted
time: 0ms
memory: 10256kb
input:
15 2 3 0 0 1 1 3 2 2 3 1 0 2 2 0 0 2 2 0 3 0 2 1 1 2 3 0 2 2 1 3 3 2 2 3 3 2 3 0 2 1 3 2 0 0 0 3 1 3 0 2 1 2 2 1 1 1 1 0 1 2 1 3 3 3 0 1 2 2 1 0 2 2 1 0 0 1 0 1 2 1 3 2 3 1 1 1 3 1 0 1 3 2 3 3 3 0 0 3 2 2 1 0 3 0 2 1 0 2 1 2 0 0 0 3 1 3 3 3 1 1 1 0 3 0 3 1 0 1 3 3 2 2 1 1 0 2 3 0 0 2 1 1 0 2 1 1 3 0...
output:
First
result:
ok Correct!
Test #17:
score: 0
Accepted
time: 6ms
memory: 10248kb
input:
15 3 3 2 3 1 3 2 1 3 0 1 2 0 3 3 3 1 0 3 2 0 1 0 3 3 0 1 3 3 3 3 3 0 2 1 2 3 3 0 3 0 1 3 0 2 3 2 1 0 2 1 1 2 1 0 0 1 2 2 1 3 2 2 2 3 3 3 0 0 2 1 0 2 1 3 3 0 3 3 3 1 2 3 1 0 3 2 0 1 3 1 3 1 1 2 2 2 3 0 0 3 0 2 1 3 0 3 2 0 2 3 1 0 3 1 1 1 2 0 2 1 1 0 2 1 1 0 2 0 1 1 1 2 1 0 0 0 1 2 1 1 0 1 0 2 2 1 3 0...
output:
Second
result:
ok Correct!
Test #18:
score: 0
Accepted
time: 28ms
memory: 10680kb
input:
150 3 3 3 1 1 0 3 0 1 3 1 3 1 2 2 0 2 1 1 0 2 3 3 0 0 0 0 2 2 0 0 1 2 3 1 0 2 3 0 0 2 0 0 2 1 0 2 3 2 0 0 2 3 0 2 2 2 3 1 3 0 2 2 0 3 2 2 2 3 2 2 2 2 2 0 3 1 3 3 3 3 3 2 2 1 3 1 1 1 2 0 0 0 3 2 0 3 3 0 1 2 0 1 2 1 1 2 3 3 2 2 3 2 3 2 0 2 0 2 1 2 1 2 1 2 3 0 0 0 2 3 3 3 0 0 2 1 1 2 2 0 3 3 3 1 0 0 2 ...
output:
First
result:
ok Correct!
Test #19:
score: 0
Accepted
time: 24ms
memory: 10440kb
input:
150 3 2 2 2 2 0 2 3 0 0 2 1 1 0 2 1 1 3 0 1 2 1 1 1 2 0 3 3 0 0 0 1 0 1 3 0 2 3 0 0 3 3 1 2 0 3 2 2 0 1 3 3 2 2 3 3 2 3 0 2 1 3 2 0 0 3 2 3 3 0 2 0 1 2 0 3 1 0 3 3 2 0 3 2 0 0 2 3 0 2 0 2 3 1 2 1 1 1 2 1 3 2 0 3 2 0 1 1 1 3 1 0 3 2 2 3 0 3 0 1 0 2 2 0 2 3 0 1 0 1 0 3 2 2 2 1 0 0 0 2 2 3 3 0 2 3 2 2 ...
output:
Second
result:
ok Correct!
Test #20:
score: 0
Accepted
time: 3ms
memory: 10240kb
input:
4 14933869218549439491 16585424476599992641 15693327091049873813 15139317284981887413 5644635431761418741 14363600218451174558 6500511401460815337 15234460955132412106 7854875224242569311 14203824351831169222 17947187586523928667 17369385516825714001 7529062658482685749 6980600883025721660 866820821...
output:
First
result:
ok Correct!
Test #21:
score: 0
Accepted
time: 5ms
memory: 10512kb
input:
6 1541940090421006634 5706980944228259629 3733156856506348515 11549906670735925984 3508919193506994963 12966245733830658096 16806498226151291947 7652725376596879919 10253139698466522875 5695783639911206394 856478020289437698 639981738440177442 1114326574664117727 10680210599297253080 755202771768002...
output:
Second
result:
ok Correct!
Test #22:
score: 0
Accepted
time: 3ms
memory: 10192kb
input:
12 3357756343863405978 16086943693092603804 6300230423993775623 7972667015010053163 16179760515164929398 9948861293977891122 306236932643409121 9220435304801264449 1286640295606273752 7350687443474213116 16154223169996790543 10517646207801577965 7424542710891251074 4384550633238372902 12969678828580...
output:
First
result:
ok Correct!
Test #23:
score: 0
Accepted
time: 3ms
memory: 10500kb
input:
13 9953705624019565478 1642510320265468085 4672511504386079306 18174598509365992760 13414653393975092944 2469051320651190720 3122286533861845469 10590394818949176522 15125046257771816999 7496919769199103511 2241705165090104491 11731906219134346173 11911485106014878064 967414319257420760 127564616926...
output:
Second
result:
ok Correct!
Test #24:
score: 0
Accepted
time: 5ms
memory: 10308kb
input:
15 14263804391085055871 10189097583290923183 11855991718278251314 14709798954883622630 7478731964282786531 12484144778314696545 3362971101013729002 7931518435767573296 7920950763928225578 3419158813068432120 10128015810289738429 8364332849928439513 14830128233536617204 1539799100212387588 1030312448...
output:
Second
result:
ok Correct!
Test #25:
score: 0
Accepted
time: 5ms
memory: 10568kb
input:
16 17359476782983281529 13082472111047927905 3150962834118022574 2600060412442128279 13694031871610209016 17565723700618907844 7891926568212661283 6946402817475122243 18038678885969164708 13221166522210591636 2985458790438500947 7829859654516566339 13762423062681684992 18091161409792617488 793780752...
output:
First
result:
ok Correct!
Test #26:
score: 0
Accepted
time: 3ms
memory: 10192kb
input:
17 5317947837576302827 9328152479550380761 16455976998496880794 7522481156725147818 7872180946998333413 17124726256921772241 14514438975446359959 16255109669227189895 9583599332557166552 5530888402065577708 3003394442948264235 13984686417310107290 11895155396020519251 7138614150759090659 31255312984...
output:
Second
result:
ok Correct!
Test #27:
score: 0
Accepted
time: 6ms
memory: 10468kb
input:
18 15399111227005505431 13038422771055042840 3475149860732507452 1249330319095171533 2241971710937880825 3349892092822803042 10427646873110937671 16269834369659997884 4256405874654164750 4820103298610498965 11274177702606438321 17096197564838891866 3736507591203397694 7128860710905751783 17072332102...
output:
First
result:
ok Correct!
Test #28:
score: 0
Accepted
time: 3ms
memory: 10480kb
input:
30 14333479346300569793 155468631658949628 10787742168282851920 16097566594533678045 12159591562584644478 13861310319025912935 8313876318277202607 4252271325020573170 7223384252288614932 3196524622111763849 11128748277973967137 8562224680505924636 9461785526471315626 14667497891322652607 60574426812...
output:
First
result:
ok Correct!
Test #29:
score: 0
Accepted
time: 10ms
memory: 10300kb
input:
70 14556674167334465063 8824345888529194640 12810176536470933801 3528198306054558224 17829225194625883641 4862672925370084742 10151979040623046761 4509929707338268910 17964651157020155758 14707151754130828670 10649554586486948534 11763141583292769016 16476282585787953076 17345561943741095840 1370364...
output:
Second
result:
ok Correct!
Test #30:
score: 0
Accepted
time: 17ms
memory: 10404kb
input:
100 727357525314754731 17753912689798219497 17806792077268193025 3352130942484431312 2826525390417635901 15817279169409766646 18374397388974452063 1415814498484392780 1367830964399943760 4790001893516129092 4890112977080693472 13717416443651253283 11212398728440477134 7447112388938555673 73661318761...
output:
First
result:
ok Correct!
Test #31:
score: 0
Accepted
time: 10ms
memory: 10272kb
input:
100 17616424876056926957 12244636854526326437 16944194434827537170 17778771039586826618 9530659087673548813 13327398927341946947 15716643788393813460 16661639490796950292 94659211517069026 17611115609592506026 1661268265431023417 13405446131331751409 6359441987137345542 4998989786179492964 511136858...
output:
Second
result:
ok Correct!
Test #32:
score: 0
Accepted
time: 28ms
memory: 10500kb
input:
150 1706057406669647091 11704037812347000532 10068697844314678391 9690408600618870280 10199841672184324395 6507148668818091288 11031970301644380586 5501176215142228468 4983084183741502070 15585960921844521065 8589311510391512930 14445933798799593513 16358392669667635115 10874595781213132725 16651127...
output:
First
result:
ok Correct!
Test #33:
score: 0
Accepted
time: 35ms
memory: 10372kb
input:
150 7074720456412159379 10427797975374692162 6767319908651571738 14951760499954625850 5420188790829123634 18282760689324927411 3493836092247239915 4682974561403010842 411710192250399434 1589767781600213370 6589200586669980674 3009517781702045667 7543818285451689643 6341505488897412490 15305271903792...
output:
Second
result:
ok Correct!
Test #34:
score: 0
Accepted
time: 32ms
memory: 10444kb
input:
149 12981218520292022322 17118152582804292464 13143624597199424200 6817016285268778242 14069603589786202297 4311895093344167851 11908714117717688863 3022444919573517785 3751890107211512164 5545167136318025519 6571993997078627222 8827443600700415316 7728155611947856368 13510918601964611508 3178102199...
output:
First
result:
ok Correct!
Test #35:
score: 0
Accepted
time: 30ms
memory: 10504kb
input:
150 2497278169385868152 12519019095475102259 14389208860142944856 6387588556399115675 4354656448593942876 10646475663242020495 18115021418992994164 7275429744576765101 449654471057595616 13863210573991920548 11542404396493580224 4557257389171890192 5725974424852380104 17881407820218081808 1113180548...
output:
Second
result:
ok Correct!
Test #36:
score: 0
Accepted
time: 27ms
memory: 10368kb
input:
148 2090569350258920513 2407620647973659627 6124069018497802809 5377095522976562267 11343165690016738446 793045358112871022 16110902882898400923 9506942977353091308 15146448387583269179 14436643794557298393 11226589200459867916 11071970814846745710 6436429612062631740 15069536461410752598 1203793615...
output:
Second
result:
ok Correct!
Test #37:
score: 0
Accepted
time: 31ms
memory: 10624kb
input:
150 2241422432359139338 11212552251766371654 15430818985852100153 14046154546749819699 13300076886603112492 887690890113007026 8315356748955059717 14188458510568166279 3447528667637864788 12668852321934003588 16496242145809558513 7002199028512325621 12419641868081268193 4079878516360745961 480117052...
output:
Second
result:
ok Correct!
Test #38:
score: 0
Accepted
time: 30ms
memory: 10676kb
input:
147 10539584310043371670 16010571978410744079 18248404707979037816 3119242757189147483 10088735436445501245 5941441811845914036 7025420663300833731 11244674810424095024 4433298945195541830 16244590658501665359 13905748275236439818 9542417396544578699 12097469154663787005 6414254558650343525 18126954...
output:
First
result:
ok Correct!
Test #39:
score: 0
Accepted
time: 32ms
memory: 10608kb
input:
150 11048395398327422492 7916194487845375725 3886209909035040504 18209464019475201423 7364322808345596521 1344259109061413619 13580138564594953131 13887196663416689346 4903188213106706750 5957978827196590140 7343719045768653691 713853119806058395 11243714173556453420 12966059946509381249 17733721857...
output:
Second
result:
ok Correct!
Test #40:
score: 0
Accepted
time: 2ms
memory: 10604kb
input:
150 13968069050140047450 9659594365670941524 7760645700694000718 15577389001710727331 11882101599718941220 15268677796313221420 14194658703282492970 503442274411188815 6485898544322381825 7043386789994603352 12450087917955879547 2762900132947383251 2822419057562937488 16709312909022089384 1274466701...
output:
Second
result:
ok Correct!
Test #41:
score: 0
Accepted
time: 0ms
memory: 10504kb
input:
150 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
Second
result:
ok Correct!
Test #42:
score: 0
Accepted
time: 36ms
memory: 10444kb
input:
150 13169337027640742077 9262415207617432931 7796382083372408116 7957939090914216174 16269440587227388345 17865424926666785952 1968726066454854829 8720323080775598369 1349395020579500324 719755557137287196 14151710172639424618 9666949310251306384 7844719774363909615 6817637633200089235 1291082391929...
output:
First
result:
ok Correct!
Test #43:
score: 0
Accepted
time: 36ms
memory: 10432kb
input:
150 8111157753565740318 10152410953114468784 13879090931174499177 3295196090459607021 3031795716368435372 11508128614771836296 11123269941909882609 7430736718254992339 2978751539665307776 14218609727159037974 13950698263684719309 8384843326759212643 6311024683427275930 12543452035100810366 164683114...
output:
First
result:
ok Correct!
Test #44:
score: 0
Accepted
time: 39ms
memory: 10432kb
input:
150 4938934632533264856 6426957136172658846 12923573490896316777 5363309051387249087 12278659569665919304 17861788930558764293 1814269540216531160 328913128370029956 11869459776139057275 2094129679767036977 12089637846851056066 13435812826237752449 6799656833551471970 858646883565458786 144955088604...
output:
First
result:
ok Correct!
Test #45:
score: 0
Accepted
time: 40ms
memory: 10412kb
input:
150 15102732216793916262 7095882557714985094 5649482543125556354 18217222307878362066 8846690799536086979 12192325218694817840 16550313867474638007 12774649455413208853 18252124320423259957 3380584039288016461 16340741990789826128 3612871344893631915 9094648818043179296 10214247325774411466 29266472...
output:
First
result:
ok Correct!
Test #46:
score: 0
Accepted
time: 36ms
memory: 10588kb
input:
150 14438901729169123372 10846544755752553210 16074160367945362872 11579270687270374126 7722707171066082720 13026512073984874348 9020637666395574756 9496979860421464945 6996728781855361362 10950547738797493029 6335550282817410126 2436125291043786675 4825046433780093146 3858934834148315783 8417713417...
output:
First
result:
ok Correct!
Test #47:
score: 0
Accepted
time: 40ms
memory: 10432kb
input:
150 3890208464314889708 11945633178381078007 201030236967379745 11152533509144263487 4253679062278765699 2527252888044322234 423007576007596235 2266500599213179088 3790451158503558670 4368617479478875665 6583253620004469158 388113606532202649 7110763211623954277 4194085704821729149 15990040796191392...
output:
First
result:
ok Correct!
Test #48:
score: 0
Accepted
time: 39ms
memory: 10436kb
input:
150 14582666267735623431 11691284772727245861 16857692973902150203 1854384935193683262 12706922785278153570 714550343616387267 169953832019569753 11691367755426014698 705176837110306108 17785334536924077209 13396336263171565828 14831464051147923621 10554148743324316927 5580368405461514716 1404788454...
output:
First
result:
ok Correct!
Test #49:
score: 0
Accepted
time: 32ms
memory: 10504kb
input:
150 14266110392968015313 18227436624115364430 14177589201524594556 17478030895530091955 1483454567088817427 7122988912572340126 11168794037560211134 2357737406538894673 9982416465747157027 13025063230482857596 5256306252677075788 4410708821885381777 15602027805103294945 8020410780152339246 154786006...
output:
First
result:
ok Correct!
Test #50:
score: 0
Accepted
time: 36ms
memory: 10428kb
input:
150 18421951652993237391 389905344648643435 8178620957196769511 12271895272549209014 10101549619767380024 8323113378944093734 554162368149442728 15865631887594871881 17879119598900412641 5804488192995460241 8429712671974055231 12330996865899762700 13795084353800228246 2643374341478763846 17066435679...
output:
First
result:
ok Correct!
Test #51:
score: 0
Accepted
time: 40ms
memory: 10444kb
input:
150 11081817905448188293 13138441346447600294 4040211881527910535 922981377116509630 16010069435166287802 16831132893558838964 7778870728309103866 5677810796559821188 9776784040885060576 12263735131763095196 6931512261132251360 11469137511947093467 4992980666570194648 8139479034558548931 11605918974...
output:
First
result:
ok Correct!
Test #52:
score: 0
Accepted
time: 29ms
memory: 10380kb
input:
150 17330589769381500567 11784665975181350300 12905899904666386763 10960449945403229936 10506256942036408872 9126047340440715584 15733396928633068436 8463760959741800476 8701849438995664088 1720706146501698545 2555586039008386852 6232631467501626509 481387380774952520 18225975108718017825 7222047595...
output:
Second
result:
ok Correct!
Test #53:
score: 0
Accepted
time: 39ms
memory: 10440kb
input:
150 9610251448524486754 1545406451600626215 16806603633988637132 4262567906450639390 13957160170892004260 6560013109124080562 16558773679624039068 8641598303708131738 12658053107385905808 3432413673305708738 9414273006825101369 259701665845192938 17169350762951133457 3026132619556172358 142791707081...
output:
Second
result:
ok Correct!
Test #54:
score: 0
Accepted
time: 31ms
memory: 10428kb
input:
150 16334025539595680211 12598597858399159615 2724679617893308182 9835476942754035183 3132471805020747438 5696045336072788850 894562335299816567 7535854795449741442 5441134187831290531 9221812243127174747 16985477287806747226 4558242365475057287 17059659295486705026 10986731716056276086 100466563673...
output:
Second
result:
ok Correct!
Test #55:
score: 0
Accepted
time: 40ms
memory: 10500kb
input:
150 2296594205449484236 3914346807494517436 6288378277680181827 12657496997050206137 15710829993019764039 12295297876318634549 15903028669293890626 7385081766538072880 5007821002850208235 8058864187192917041 7558607363496914158 17873142290688522684 12415416066037512931 17618240936548441529 116066073...
output:
Second
result:
ok Correct!
Test #56:
score: 0
Accepted
time: 36ms
memory: 10424kb
input:
150 9091579104285193508 4046309846534636420 17594568430224833141 12367113583075937337 1328705836346390212 138673610064068681 12123676338222053808 9778189328205557660 2889693919043515385 13814491880802858493 1316652879876193292 1578736546004007688 10667217563200745597 9774285087366379096 447609120583...
output:
Second
result:
ok Correct!
Test #57:
score: 0
Accepted
time: 36ms
memory: 10492kb
input:
150 17160373366980119756 1953000404700007977 6896202788449832808 12261556839271926472 17783308349485508553 689226271212464872 5069529696269927353 13332805516291645765 17723295558023287577 1758225699396814325 5819899983619456440 9365639113535218965 13843826958502649096 2542440836701710740 70377849282...
output:
Second
result:
ok Correct!
Test #58:
score: 0
Accepted
time: 35ms
memory: 10372kb
input:
150 3290216112179933230 13242465808315772686 2899285466728973115 4200559479417392483 2699570905967167294 4567721134240634980 11599869351117534303 1366303658647960436 11961203565516181849 10932656329847500561 12134510215844890468 10606435107395355670 12133660787389604961 11111645200528322867 40012523...
output:
Second
result:
ok Correct!
Test #59:
score: 0
Accepted
time: 38ms
memory: 10372kb
input:
150 4899722703792253443 2164773956642905606 15484220600344678065 14939738553629945511 7861138512500649744 8135474855520929564 5480706540383690657 5888557772156069816 10660089351403888129 14024520807365796617 2515815327539347130 9175592761793761832 1837156353424334747 3191185499711632026 100893964805...
output:
Second
result:
ok Correct!
Test #60:
score: 0
Accepted
time: 31ms
memory: 10408kb
input:
150 13898880212724379833 1484004004202700340 4317464397555534943 8255228781933882107 4552484908925237643 18055632865204277023 15350420013276487524 11262488240280206315 10614332957702990336 6081952358172954241 4306553983537663728 18027192947716287044 9068277163572050750 12441051321190227952 109310511...
output:
Second
result:
ok Correct!
Test #61:
score: 0
Accepted
time: 22ms
memory: 10416kb
input:
150 4701082853699155053 5232816141706304893 17771748814376486913 14639750343245054209 17682512524010052459 12747400591813956329 7411386733891962391 3736788999317972871 398542611779785211 2382354011971386367 9742274426633650585 9417229995098777755 10730644123554201316 15359681349806110071 22605051017...
output:
Second
result:
ok Correct!
Test #62:
score: 0
Accepted
time: 29ms
memory: 10424kb
input:
150 2653771834 2838199740 1583523600 3654251987 677667343 4012730583 3895684389 414839965 2537925789 2798848271 1547342389 1393017172 1662271656 1869428928 1666931330 451002686 1428134431 1837872778 2504191154 2659037409 3933871423 873957186 553886229 3582113193 1516462986 4292986413 2583840769 2620...
output:
First
result:
ok Correct!
Test #63:
score: 0
Accepted
time: 26ms
memory: 10432kb
input:
150 2785256157 665925291 1711727208 3516618896 1868475164 1083638021 4275991338 2192342556 3521014654 2196565913 1130052075 3939386530 1294024247 3811235247 3720525992 2379330453 4055480182 2953323347 1091464649 3467743017 1790768885 3564441549 2839487690 2923848119 3462692244 2534914419 1051960579 ...
output:
First
result:
ok Correct!
Test #64:
score: 0
Accepted
time: 33ms
memory: 10348kb
input:
150 848952003 770137113 1221465504 2916966864 3018921302 1104439866 3475396218 3243128060 541935588 3206526802 1547271407 2909636791 3071372345 3607899924 3453329256 3622654935 3204263608 3146570365 3400110545 1002104745 763923758 3451897363 2030952455 1530505867 3120874931 2776377395 3897647774 620...
output:
First
result:
ok Correct!
Test #65:
score: 0
Accepted
time: 29ms
memory: 10432kb
input:
150 2016340834 492337377 3055853262 746219865 2656707378 2327967682 2188697110 4009608950 3210245101 1109807213 1095869526 3003327313 2703778733 1034583370 1996731534 730729599 37491701 2773607132 1445160147 3831858168 1985957157 1826491763 4177335427 2499290257 1359945084 984853074 2882292827 12387...
output:
Second
result:
ok Correct!
Test #66:
score: 0
Accepted
time: 28ms
memory: 10504kb
input:
150 3070970961 995576527 594997902 2075690234 850170481 2924310068 1939548576 3668697377 140036581 3307065059 2067601056 2917351766 16601805 580274572 1775782933 1090012573 1376923373 3754700118 1412404509 2548228193 1521935849 416648579 1443617337 952010802 1792147027 2794432760 249978937 342551318...
output:
Second
result:
ok Correct!
Test #67:
score: 0
Accepted
time: 28ms
memory: 10488kb
input:
150 230566026 2854009337 4002962221 2042383704 1658127200 1641295726 3911971044 2486458474 1961027753 2965402494 2604697871 1415630462 1191226706 1547528008 2809547746 2414410345 1932216219 3585996636 2694684713 2738692829 945585264 2346836330 2460912448 1781606091 2398524728 1650486653 3854592650 3...
output:
Second
result:
ok Correct!
Test #68:
score: 0
Accepted
time: 6ms
memory: 10204kb
input:
1 18446744073709551615
output:
First
result:
ok Correct!