Submission #1355079

#TimeUsernameProblemLanguageResultExecution timeMemory
1355079sanoChess Rush (CEOI20_chessrush)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#define P vector
#define F(i, n) for(l i = 0; i < n; i++)
#define l long long
#define mod 1000000007
#define all(x) x.begin(), x.end()
using namespace std;
l r, c, q, x, y; 
P<P<l>> C(P<P<l>>& a, P<P<l>>&b){
    P<P<l>> v(c, P<l>(c, 0));
    F(i, c) F(j, c) F(k, c) v[i][j] = (v[i][j] + a[i][k] * b[k][j]) % mod;
    return v;
}
signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> r >> c >> q; r--;
    P<P<l>> m[32];
    F(i, 32) m[i].assign(c, P<l>(c, 0));
    F(i, c) F(k, 2) if((j+k-1) >= 0 && (j-k+1) < n) m[0][i][j] = 1;
    F(i, 31) m[i+1] = C(m[i], m[i]);
    P<P<l>> z(c, P<l>(c, 0));
    F(i, c) z[i][i] = 1;
    F(i, 32) if(r & (1<<i)) z = C(zac, mat[i]);
    F(i, q){
        char t; cin >> t >> x >> y;
        cout << r << ' ' << z[x][y] << endl;
    }
}

Compilation message (stderr)

chessrush.cpp: In function 'int main()':
chessrush.cpp:20:25: error: 'j' was not declared in this scope
   20 |     F(i, c) F(k, 2) if((j+k-1) >= 0 && (j-k+1) < n) m[0][i][j] = 1;
      |                         ^
chessrush.cpp:20:50: error: 'n' was not declared in this scope
   20 |     F(i, c) F(k, 2) if((j+k-1) >= 0 && (j-k+1) < n) m[0][i][j] = 1;
      |                                                  ^
chessrush.cpp:24:35: error: 'zac' was not declared in this scope
   24 |     F(i, 32) if(r & (1<<i)) z = C(zac, mat[i]);
      |                                   ^~~
chessrush.cpp:24:40: error: 'mat' was not declared in this scope
   24 |     F(i, 32) if(r & (1<<i)) z = C(zac, mat[i]);
      |                                        ^~~