제출 #1355078

#제출 시각아이디문제언어결과실행 시간메모리
1355078sanoChess Rush (CEOI20_chessrush)C++20
컴파일 에러
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;
    }
}

컴파일 시 표준 에러 (stderr) 메시지

chessrush.cpp:9:32: error: 'std::vector<std::vector<long long int> > c(std::vector<std::vector<long long int> >&, std::vector<std::vector<long long int> >&)' redeclared as different kind of entity
    9 | P<P<l>> c(P<P<l>>& a, P<P<l>>&b){
      |                                ^
chessrush.cpp:8:6: note: previous declaration 'long long int c'
    8 | l r, c, q, x, y;
      |      ^
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:21:24: error: 'c' cannot be used as a function
   21 |     F(i, 31) m[i+1] = c(m[i], m[i]);
      |                       ~^~~~~~~~~~~~
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]);
      |                                        ^~~
chessrush.cpp:24:46: error: 'c' cannot be used as a function
   24 |     F(i, 32) if(r & (1<<i)) z = c(zac, mat[i]);
      |                                              ^