# HIIT Open 2016

 Start: 2016-05-28 11:00:00 End: 2016-05-28 16:00:00

CSES - HIIT Open 2016 - Results
History
2016-05-28 15:59:52
2016-05-28 15:57:07
2016-05-28 15:56:35
2016-05-28 15:55:48
2016-05-28 15:54:36
2016-05-28 15:36:38
2016-05-28 15:35:23
2016-05-28 15:34:29
2016-05-28 15:21:25

## Test results

 test verdict time (s) #1 ACCEPTED 0.06 / 3.00 details #2 WRONG ANSWER 0.54 / 3.00 details #3 WRONG ANSWER 1.47 / 3.00 details #4 ACCEPTED 1.35 / 3.00 details #5 WRONG ANSWER 1.79 / 3.00 details #6 WRONG ANSWER 1.79 / 3.00 details #7 ACCEPTED 1.30 / 3.00 details #8 ACCEPTED 1.30 / 3.00 details #9 ACCEPTED 1.31 / 3.00 details #10 WRONG ANSWER 1.80 / 3.00 details

## Code

```#include<bits/stdc++.h>

using namespace std;
const int MN = 5555;
const int MOD = 64;
const int N = 13;
short a[MN][MN];
short x[MN][MN];
short sumA[3*N][MN];
short sumX[3*N][MN];
bool lol[MN];

int main(void) {
cin.tie(0);
ios_base::sync_with_stdio(false);
cout << fixed << setprecision(12);
int tt;
cin>>tt;
for(int xx = 0; xx < tt; ++xx) {
/*
memset(a, 0, sizeof a);
memset(x, 0, sizeof x);
memset(sumA, 0, sizeof sumA);
memset(sumX, 0, sizeof sumX);
*/
int n;
cin>>n;
for(int i = 0; i < n; ++i) {
for(int j = 0; j < n; ++j) {
a[i][j] = 0;
x[i][j] = 0;
}
}
for(int i = 0; i < 3*N; ++i) {
for(int j = 0; j < n; ++j) {
sumA[i][j] = 0;
sumX[i][j] = 0;
}
}
for(int i = 0; i < n; ++i ) {
for(int j = 0; j < n; ++j) {
char q = 0;
cin>>q;
if(q >= 'A' && q <= 'Z') {
a[i][j] = q - 'A';
}
if(q >= 'a' && q <= 'z') {
a[i][j] = q - 'a'+26;
}
if(q >= '0' && q <= '9') {
a[i][j] = q-'0'+52;
}
if(q == '+') a[i][j] = 62;
if(q == '/') a[i][j] = 63;
//    cout<<a[i][j]<<' ';
}
//cout<<'\n';
}
//cout<<'\n';
for(int i = 0; i < n; ++i ) {
for(int j = 0; j < n; ++j) {
char q = 0;
cin>>q;
if(q >= 'A' && q <= 'Z') {
x[i][j] = q - 'A';
}
if(q >= 'a' && q <= 'z') {
x[i][j] = q - 'a'+26;
}
if(q >= '0' && q <= '9') {
x[i][j] = q-'0'+52;
}
if(q == '+') x[i][j] = 62;
if(q == '/') x[i][j] = 63;
//   cout<<x[i][j]<<' ';
}
//cout<<'\n';
}
//cout<<'\n';
int q = 1;
for(int i = 0; i < 6*N; ++i, q *= 2) {
/*
for(int k = 0; k < n; ++k) {
if((k>>i)%2 == 0) {
cout<<k<<' ';
}
cout<<'\n';
}
continue;
*/
if(i < N) {

for(int k = 0; k < n; ++k) {
if((k>>i)%2 == 0) {
for(int j = 0; j < n; ++j) {
sumA[0][j] += a[k][j];
sumX[0][j] += x[k][j];
//          cout<<k<<' ';
}
}
//   cout<<'\n';
//cout<<sumX[i][j]<<' '<<sumA[i][j]<<' '<<"asdfa\n";
}
for(int j = 0; j < n; ++j) {
sumA[0][j] %= MOD;
sumX[0][j] %= MOD;
}
}
else {
for(int j = 0; j < n; ++j) {
lol[j] = rand()%2;
}
for(int k = 0; k < n; ++k) {
if(lol[k]) {
for(int j = 0; j < n; ++j) {
sumA[0][j] += a[k][j];
sumX[0][j] += x[k][j];
}
}
//   cout<<'\n';
//cout<<sumX[i][j]<<' '<<sumA[i][j]<<' '<<"asdfa\n";
}
for(int j = 0; j < n; ++j) {
sumA[0][j] %= MOD;
sumX[0][j] %= MOD;
}
}
//cout<<'\n';
for(int j = 0; j < n; ++j) {
int q = 0;
int w = sumX[0][j];
for(int k = 0; k < n; ++k) {
q += sumA[0][k] * a[j][k];
}
q %= MOD;
w %= MOD;
// cout<<q<<' '<<w<<'\n';
if(q != w) {
goto ohi;
}
}
}
cout<<1<<'\n';
continue;
ohi:;
cout<<0<<'\n';

}

return 0;
}
```

## Test details

### Test 1

Verdict: ACCEPTED

input
```500 12 N49lyQuAZh1l PwNJA+wuTBr+ HO09lJg8kbup yDfjEETO9FbY Aplqi5vnLc98 0/hYfkOFcZVV /ckgzeISmwGl br2MOJZnYtrh fEUiVy4Miasn 0u09RS8s83nZ gQjEE8dDfIk7 g8si6nOeea01 XCc/9qK8WGTj CK39fpfbB/4q c3GYFr/oDwzG /9Yf5gOIARp8 9fF53gW9SfQF qprggzi/g4br ...```
view   save

correct output
```0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 0 0 1 1 ...```
view   save

user output
```0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 0 0 1 1 ...```
view   save

### Test 2

input
```3 666 OvHf9jpB0RViia/ZD3gRQ7o1FELYh3... L5gSvHpMnBJLnEP2owz8yZ7PgwI62l...```
view   save

correct output
```0 0 1```
view   save

user output
```0 0 0```
view   save

### Test 3

input
```2 517 RWVknnH+hL6AfeKFbOu6OuAJL9dvLw... FM2IGsbyia33qivbugYG85wbElidVu...```
view   save

correct output
```0 1```
view   save

user output
```0 0```
view   save

### Test 4

Verdict: ACCEPTED

input
```1 5000 QP9pS1MOq6eDDKGQh//TrJUIvbM53a...```
view   save

correct output
`0`
view   save

user output
`0`
view   save

### Test 5

input
```1 5000 RSX7ZuQE6A94s8s+9oP1uCDHRkmZ+7...```
view   save

correct output
`1`
view   save

user output
`0`
view   save

### Test 6

input
```1 5000 b0V0j4vQ8CeiJrcUk2yssPF1B9EEDb...```
view   save

correct output
`1`
view   save

user output
`0`
view   save

### Test 7

Verdict: ACCEPTED

input
```1 5000 VLdpW71f4Cdr+xdCRlwmAnNfMjqwMU...```
view   save

correct output
`0`
view   save

user output
`0`
view   save

### Test 8

Verdict: ACCEPTED

input
```1 5000 kBZaGETPWmyNR4NCvCPbJnvq2+JBfP...```
view   save

correct output
`0`
view   save

user output
`0`
view   save

### Test 9

Verdict: ACCEPTED

input
```1 5000 PES9AhJn+FZBVO5gqRLYbavSvaDUfU...```
view   save

correct output
`0`
view   save

user output
`0`
view   save

### Test 10

```1 5000 EoXwgdrAtKtV4M7jn0jAkNwkJX+be9...```
`1`
`0`