QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#649909#9435. Welcome to NPCAPCxielirenCompile Error//C++141.6kb2024-10-18 11:27:412024-10-18 11:27:42

Judging History

你现在查看的是最新测评结果

  • [2024-10-18 11:27:42]
  • 评测
  • [2024-10-18 11:27:41]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
int read(){
	int s = 0, f = 1;char ch = getchar();
	while(!isdigit(ch)){if(ch == '-')f = -1;ch = getchar();}
	while(isdigit(ch)){s = s * 10 + ch - '0';ch = getchar();}
	return s * f;
}
void write(int x){
    if(x < 0){putchar('-'); x = -x;}
    if(x > 9) write(x / 10);
    putchar(x % 10 + '0');
}
const int MOD = 998244353;
int t, n, m;
struct Matrix{
	int c[50][50];
	Matrix operator * (const Matrix &zzz)const{
		Matrix tmp;
		memset(tmp.c, 0, sizeof(tmp.c));
		for(int i = 0;i < 49;i ++){
			for(int k = 0;k < 49;k ++){
				for(int j = 0;j < 49;j ++)
					tmp.c[i][j] = (tmp.c[i][j] + c[i][k] * zzz.c[k][j] % MOD) % MOD;
			}
		}
		return tmp;
	}
}c[50];
int g(int x, int y){
	return x * 7 + y;
}
int lowbit(int x){return x & -x;}
signed main(){
	for(int i = 1;i < 7;i ++){
		for(int j = 1;j < 7;j ++)
			c[0].c[g(i, j)][g(i, j)] = 50, c[0].c[g(i, j - 1)][g(i, j)] = c[0].c[g(i - 1, j)][g(i, j)] = 1;
	}
	for(int i = 1;i < 7;i ++)c[0].c[g(i - 1, 0)][g(i, 0)] = 1, c[0].c[g(i, 0)][g(i, 0)] = 51;
	for(int i = 1;i < 7;i ++)c[0].c[g(i - 1, 0)][g(0, i)] = 1, c[0].c[g(i, 0)][g(0, i)] = 51;
	c[0].c[0][0] = 50;//总-2 
	c[0].c[48][48] = 52;
	for(int i = 1;i <= 31;i ++)c[i] = c[i - 1] * c[i - 1];
	int t = read();
	while(t --){
		int n = read();
		if(n < 12){
			puts("0");
			continue;
		}
		Matrix g;
		memset(g.c, 0, sizeof(g.c));
		g.c[0][0] = 1;
		for(;n;n -= lowbit(n))
			int x = log2(lowbit(n));
			g = g * c[x];
		}
		printf("%lld\n", g.c[0][48] % MOD);
	}
	return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:57:35: error: ‘x’ was not declared in this scope
   57 |                         g = g * c[x];
      |                                   ^
answer.code:59:36: error: request for member ‘c’ in ‘g’, which is of non-class type ‘long long int(long long int, long long int)’
   59 |                 printf("%lld\n", g.c[0][48] % MOD);
      |                                    ^
answer.code: At global scope:
answer.code:61:9: error: expected unqualified-id before ‘return’
   61 |         return 0;
      |         ^~~~~~
answer.code:62:1: error: expected declaration before ‘}’ token
   62 | }
      | ^