QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#309384#8025. FibonacciPetroTarnavskyi#Compile Error//C++201.4kb2024-01-20 16:59:322024-01-20 16:59:32

Judging History

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

  • [2024-01-20 16:59:32]
  • 评测
  • [2024-01-20 16:59:32]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;

const int mod = 1e9 + 7;

int add(int a, int b)
{
	return a + b < mod ? a + b : a + b - mod;
}

const int N = 30;
int dp[N][2][2];
int x, y;

int f(int len, int ex, int ey)
{
	if (len == N)
		return 1;
	if (dp[len][ex][ey] != -1)
		return dp[len][ex][ey];
	dp[len][ex][ey] = 0;
	int btx = ((x >> (N - len - 1) & 1);
	int bty = ((y >> (N - len - 1) & 1);
	FOR (bx, 0, 2)
	{
		if (ex && bx > btx)
			continue;
		int nex = ex && bx == btx;
		FOR (by, 0, 2)
		{
			if (ey && by > bty)
				continue;
			if (ey == ex && ey == 1)
				continue;
			int ney = ey && by == bty;
			add(dp[len][ex][ey], f(len + 1, nex, ney));
		}
	}
	return dp[len][ex][ey];
}

void solve()
{
	FOR (i, 0, N) FOR (j, 0, 2) FOR (k, 0, 2) dp[i][j][k] = -1;
	
	cin >> x >> y;
	int res = 0;
	FOR (i, 0, )
	
}

int main()
{
	ios::sync_with_stdio(0); 
	cin.tie(0);
	cout << fixed << setprecision(15);
	
	int t;
	cin >> t;
	while (t--)
	{
		solve();
	}
	
	return 0;
}

詳細信息

answer.code: In function ‘int f(int, int, int)’:
answer.code:37:44: error: expected ‘)’ before ‘;’ token
   37 |         int btx = ((x >> (N - len - 1) & 1);
      |                   ~                        ^
      |                                            )
answer.code:38:44: error: expected ‘)’ before ‘;’ token
   38 |         int bty = ((y >> (N - len - 1) & 1);
      |                   ~                        ^
      |                                            )
answer.code: In function ‘void solve()’:
answer.code:5:45: error: expected primary-expression before ‘)’ token
    5 | #define FOR(i, a, b) for(int i = (a); i < (b); i++)
      |                                             ^
answer.code:63:9: note: in expansion of macro ‘FOR’
   63 |         FOR (i, 0, )
      |         ^~~
answer.code:65:1: error: expected primary-expression before ‘}’ token
   65 | }
      | ^