QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#246138#2833. Hamiltonnameless_story#Compile Error//C991.3kb2023-11-10 16:29:232023-11-10 16:29:24

Judging History

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

  • [2023-11-10 16:29:24]
  • 评测
  • [2023-11-10 16:29:23]
  • 提交

answer

#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
template<class T1,class T2> bool cmin(T1 &x,const T2 &y) { if (y<x) { x=y; return 1; }return 0; }
template<class T1,class T2> bool cmax(T1 &x,const T2 &y) { if (x<y) { x=y; return 1; }return 0; }
#define all(x) (x).begin(),(x).end()
int f[51][51][51][51],w[51];
void upd(int &x,int y) { x=(x+y)%mod; }
void solve(int n)
{
	vector<int> a(n+1);
	for (int i=1; i<=n; ++i) cin>>a[i];
	memset(f,0,sizeof f);
	for (int len=1; len<=n; ++len)
	{
		for (int l=1; l<=n; ++l)
		{
			int r=l+len-1;
			for (int i=l; i<=r; ++i)
			{
				memset(w,0,sizeof w);
				for (int k=i+1; k<=r; ++k)
				{
					if (a[k]>a[i]) continue;
					for (int j=1; j<=a[k]; ++j)
					{
						upd(w[j],f[i+1][r][k][j]);
					}
				}
				for (int j=1; j<=n; ++j) ++w[j];
				for (int j=1; j<=a[l]; ++j)
				{
					for (int k=l; k<i; ++k)
					{
						if (a[k]<j) continue;
						if (a[k]>a[i]) continue;
						upd(f[l][r][i][j],f[l][i-1][k][j]*w[a[k]+1]);
					}
				}
			}
		}
	}
	int ans=0;
	for (int i=1; i<=n; ++i)
	{
		for (int j=1; j<=a[i]; ++j)
		{
			upd(ans,f[1][n][i][j]);
		}
	}
	cout<<ans<<'\n';
}
int main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	int n;
	while (cin>>n)
	{
		solve(n);
	}
}

Details

answer.code:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include"bits/stdc++.h"
      |         ^~~~~~~~~~~~~~~
compilation terminated.