QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#404620#8225. 最小值之和staring#Compile Error//C++141.1kb2024-05-04 10:44:192024-05-04 10:44:21

Judging History

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

  • [2024-05-04 10:44:21]
  • 评测
  • [2024-05-04 10:44:19]
  • 提交

answer

#include <bits[表情]dc++.h>

using namespace std;

inline int read()
{
	int x=0;bool f=0;char ch=getchar();
	while(ch<'0' || ch>'9') {if(ch=='-') f=1;ch=getchar();}
	while(ch>='0' && ch<='9') x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return f?-x:x;
}

#define x first
#define y second
#define pb push_back
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)

typedef pair<int,int> PII;
typedef long long LL;
typedef unsigned long long ull;
const int N=85;

int n;
int a[N],d[N][N];
int f[N];

bool check() {
	rep(i,1,n-1) {
		d[i][i]=a[i];
		rep(j,i+1,n-1) d[i][j]=min(d[i][j-1],a[j]);
	}
	rep(i,1,n) {
		int sum=0;
		rep(j,1,i-1) sum+=d[j][i-1];
		rep(j,i,n-1) sum+=d[i][j];
		// cout<<f[i]<<' '<<sum<<endl;
		if(sum!=f[i]) return false;
	}
	puts("Yes");
	rep(i,1,n-1) printf("%d ",a[i]);
	return true;
}

bool dfs(int u) {
	if(u>=n) return check();
	rep(i,0,19) {a[u]=i; if(dfs(u+1)) return true;}
	return false;
}

int main()
{
	n=read();
	rep(i,1,n) f[i]=read();
	if(!dfs(1)) puts("No");
	
	return 0;
}

详细

answer.code:1:10: fatal error: bits[表情]dc++.h: No such file or directory
    1 | #include <bits[表情]dc++.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.