Code Submission Evaluation System Login

HIIT Open 2016

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

Tasks | Messages | Scoreboard | Statistics


CSES - HIIT Open 2016 - Results
History
2016-05-28 15:58:34
2016-05-28 15:55:32
2016-05-28 15:50:32
2016-05-28 15:48:36
2016-05-28 15:45:52
2016-05-28 15:44:10
2016-05-28 15:43:37
2016-05-28 15:41:36
Task:Fixed points
Sender:Ace of Spades
Submission time:2016-05-28 15:58:34
Language:C++
Status:READY
Result:RUNTIME ERROR

Test results

testverdicttime (s)
#1RUNTIME ERROR0.18 / 2.00details

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[6*N][MN];
short sumX[6*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 < 6*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[i][j] += a[k][j];
                            sumX[i][j] += x[k][j];
                            //          cout<<k<<' ';
                        }
                    }
                    //   cout<<'\n';
                    //cout<<sumX[i][j]<<' '<<sumA[i][j]<<' '<<"asdfa\n";
                }
            }
            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[i][j] += a[k][j];
                            sumX[i][j] += x[k][j];
                        }
                    }
                    //   cout<<'\n';
                    //cout<<sumX[i][j]<<' '<<sumA[i][j]<<' '<<"asdfa\n";
                }
                for(int j = 0; j < n; ++j) {
                    sumA[i][j] %= MOD;
                    sumX[i][j] %= MOD;
                }
            }
            //cout<<'\n';
            for(int j = 0; j < n; ++j) {
                int q = 0;
                int w = sumX[i][j];
                for(int k = 0; k < n; ++k) {
                    q += sumA[i][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: RUNTIME ERROR

input
100000
12865169357617740396 294321893...
831904078916359713 11466315592...
6921592336775223078 9122334070...
11783514864392029648 731086206...
16038473086596104392 399772886...
11220436795761414158 183636224...
9831208666940590924 6199653141...
3008006406588978734 8542342758...
8806276471340559996 1759810962...
14858934906749697779 623252486...
8887947201929630416 1304485523...
1064862187779621711 1614629992...
175385380115342380 11467901965...
9904210650663368099 2753434509...
7467992903201134853 2563754046...
17012398567278112765 297384557...
2330668681791045455 1083545194...
1289338035848410484 1432702261...
6336351106292187034 1512844704...
...
view   save

correct output
5903494652862419412
-
13008184152928659765
9415006529485574473
16201136572240455608
4275758200857590923
15980002737330675438
122276335941320026
16599195303334207475
-
8258022697473447401
-
16072581248587124502
-
-
-
-
10470899042856771225
11683963684866055538
-
...
view   save

user output
(no output)
view   save