Submission #774129

#TimeUsernameProblemLanguageResultExecution timeMemory
774129jasminPrisoner Challenge (IOI22_prison)C++17
Compilation error
0 ms0 KiB
#include "prison.h"
#include<bits/stdc++.h>
using namespace std;

const int L=13;

std::vector<std::vector<int>> devise_strategy(int n) {

    vector<vector<int> > ans(n+1, vector<int> (n+1, -1));
    for(int a=0; a<=n; a++){

        if(a&(1<<L)){
            ans[0][a]=2
        }
        else{
            ans[0][a]=1;
        }
    }
    
    for(int x=1; x<=n; x++){
        
        int i=L-(x-1)/4;
        int bit=(x-1)%2;

        if(x%4<=2){ // from A => look at B now

            ans[x][0]=1;
            for(int b=1; b<=n; b++){

                int mom=b&(1<<i);

                if(bit==0 && mom==1){
                    ans[x][b]=-1;
                }
                else if(bit==1 && mom==0){
                    ans[x][b]=-2;
                }
                else{
                    ans[x][b] = (L-i +1)*4 + 1;
                    if(mom==1) ans[x][]++;
                }
            }

        }
        else{ //from B, look at A now

            ans[x][0]=0;
            for(int a=1; a<=n; a++){

                int mom = a&(1<<i);

                ans[x][a] = (L-i)*4 + 1;
                if(mom==1) ans[x][a]++;
            }
        }
    }

    return ans;
}

Compilation message (stderr)

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:13:24: error: expected ';' before '}' token
   13 |             ans[0][a]=2
      |                        ^
      |                        ;
   14 |         }
      |         ~               
prison.cpp:40:39: error: expected primary-expression before ']' token
   40 |                     if(mom==1) ans[x][]++;
      |                                       ^