UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#212302#3812. T2sublimetextCompile Error//C++935b2024-10-13 18:26:452024-10-13 19:40:01

answer

#include <bits/stdc++.h>
using namespace std;
#define LL __int128
#define ll long long
#define uLL __uint128_t
#define ull unsigned long long
#define REP(i, l, r) for(int i = l; i <= r; ++i)
#define PER(i, r, l) for(int i = r; i >= l; --i)
namespace ink {
	const int N = 1e5 + 5, mod=998244353;
	int n;
	int a[N],b[N];
	int main() {
		ios::sync_with_stdio(false);
		cin.tie(0), cout.tie(0);
		cin >> n;
		int maxa=0;
		REP(i, 1, n) {
			cin >> a[i];
			if(i>1)maxa=max(maxa, a[i]);
		}
		if(maxa*2<a[1]) {
			int m=1;
			REP(i,2,n)m=1ll*m*a[i]%mod;
			cout<<m<<'\n';
			return 0;
		}
		sort(a+1,a+1+n);
		int cnt=0;
		std::function<void(int) >dfs=[&](int u) {
			if(u>=n){
				int s=0;
				REP(i,1,n-1) s^=b[i];
				if(s<=a[n])++cnt;
				return;
			}
			REP(i,0,a[u]) {
				b[u]=i;
				dfs(u+1);
			}
		};
		dfs(1);
		cout<<cnt<<'\n';
		return 0;
	}
}

signed main() {return ink::main();}

详细

answer.code: In function 'int ink::main()':
answer.code:30:3: error: 'function' is not a member of 'std'
   std::function<void(int) >dfs=[&](int u) {\x0d
   ^
answer.code:30:17: error: expected primary-expression before 'void'
   std::function<void(int) >dfs=[&](int u) {\x0d
                 ^
answer.code:30:17: error: expected ';' before 'void'
answer.code:48:35: error: expected '}' at end of input
 signed main() {return ink::main();}
                                   ^
answer.code: At global scope:...