Submission #1164440

#TimeUsernameProblemLanguageResultExecution timeMemory
1164440SmuggingSpunPrisoner Challenge (IOI22_prison)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "prison.h"
using namespace std;
vector<vector<int>>devise_strategy(int n){
    vector<vector<int>>s(27, vector<int>(n + 1));
    s[0][0] = 0;
    for(int i = 1; i <= n; i++){
        s[0][i] = ((i & 4096) ? 2 : 1);
    }    
    for(int i = 1; i < 27; i++){
        bool on = (i & 1) ^ 1;
        int bit = 12 - ((i - 1) >> 1);
        if(bit & 1){
            s[i][0] = 0;
            for(int j = 1; j <= n; j++){
                if(1 << bit & j){
                    s[i][j] = (on ? i + 2 : -2);
                }
                else{
                    s[i][j] = (on ? i + 2 : -1);
                }
            }
        }
        else{
            s[i][0] = 1;
            for(int j = 1; j <= n; j++){
                if(1 << bit & j){
                    s[i][j] = (on ? i + 2 : -1)
                }
                else{
                    s[i][j] = (on ? -2 : i + 2);
                }
            }
        }
    }
    return s;
}   

Compilation message (stderr)

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:28:48: error: expected ';' before '}' token
   28 |                     s[i][j] = (on ? i + 2 : -1)
      |                                                ^
      |                                                ;
   29 |                 }
      |                 ~