QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#690217#8339. Rooted TreeryxCompile Error//C++23644b2024-10-30 21:04:022024-10-30 21:04:03

Judging History

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

  • [2024-10-30 21:04:03]
  • 评测
  • [2024-10-30 21:04:02]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int mod = 1e9 + 9;
int quickpow(int x,int y){
	int res = 1;
	while(y){
		if(y&1) res = res * x % mod;
		x = x * x %mod;
		y>>=1;
	}
	return res;
}
signed main(){
	ios::sync_woth_stdio(false);cin.tie(0);cout.tie(0);
	int m,k;
	cin>>m>>k;
	int ans = 0;
	int n = 1,all = 0;
	for(int i=1;i<=k;i++){
		int e = all*quickpow(n,mod-2)%mod;
		ans = (ans + m*(e+1)%mod)%mod;
		int p = quickpow(n,mod-2);
		
		int temp = (n*all%mod+(m-1)*all%mod+n*m%mod) %mod;
		all = p * temp % mod;
		n=n-1+m;
	}
	cout<<ans<<endl;
	return 0;
	
}

Details

answer.code: In function ‘int main()’:
answer.code:16:14: error: ‘sync_woth_stdio’ is not a member of ‘std::ios’ {aka ‘std::basic_ios<char>’}
   16 |         ios::sync_woth_stdio(false);cin.tie(0);cout.tie(0);
      |              ^~~~~~~~~~~~~~~