QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#345878#3195. Within Arm's ReachPetroTarnavskyi#Compile Error//C++20897b2024-03-07 16:35:442024-03-07 16:35:50

Judging History

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

  • [2024-03-07 16:35:50]
  • 评测
  • [2024-03-07 16:35:44]
  • 提交

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;

__int128 fact[31];

vector<LL> ans;

void rec(int h, int cnt, int last, __int128 cur)
{
	if (cnt == 0)
	{
		ans.PB(cur);
		return;
	}
	FOR(x, 0, min(last, h) + 1)
		rec(h - x, cnt - 1, x, cur / fact[x]);
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	fact[0] = 1;
	FOR(i, 1, 31)
		fact[i] = fact[i - 1] * i;
	int d, h;
	cin >> d >> h;
	rec(h - 1, d, h - 1, fact[h - 1]);
	sort(ALL(ans));
	for (LL x : ans)
		cout << x << "\n";
	return 0;
	
}
dsfds

Details

answer.code:50:1: error: ‘dsfds’ does not name a type
   50 | dsfds
      | ^~~~~