QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#772185#8334. GeneGaze#Compile Error//C++141.4kb2024-11-22 17:21:452024-11-22 17:21:45

Judging History

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

  • [2024-11-22 17:21:45]
  • 评测
  • [2024-11-22 17:21:45]
  • 提交

answer

#include<bits/stdc++.h>
#define rep(a,b,c) for(int c(a);c<=(b);++c)
#define drep(a,b,c) for(int c(a);c>=(b);--c)
#define grep(b,c) for(int c(head[b]);c;c=nxt[c])
using namespace std;
inline int read()
{
	int res=0;char ch=getchar();while(ch<'0'||ch>'9')ch=getchar();
	while(ch<='9'&&ch>='0')res=res*10+(ch^48),ch=getchar();return res;
}
unsigned seed=9473573;
inline unsigned rnd()
{
	seed^=seed<<19;
	seed^=seed>>13;
	seed^=seed<<7;
	return seed;
}
typedef unsigned long long ull;
int n,Q,m,K,p[60010];char s[310][60010],t[60010];
string c[310];
void solve() {
	srand(time(0));
	for(int i = 1; i <= n; ++i) {
		cin >> c[i];
	}
	string t;
	for(int i = 1; i <= Q; ++i) {
		int ans = 0;
		cin >> t;
		for(int j = 1; j <= n; ++j) {
			int ti = m / 20, tot = 0;
			while(ti) {
				ti -= 1;
				int x = rand() % m;
				if(t[x] == c[j][x]) continue;
				ans -= 1;
				break;
			}
			ans += 1;
		}
		cout << ans << endl;
	}
}
int main()
{
	
	n=read();Q=read();m=read();K=read();
	
	if(m <= 50000) {
		rep(1,n,i){scanf("%s",s[i]+1);}
		while(Q--)
		{
		scanf("%s",t+1);
		rep(1,m,i)p[i]=i,swap(p[i],p[rnd()%i+1]);
		int ans=0;rep(1,n,i)
		{
			int res=0;bool flag=true;
			rep(1,min(m,3000),j)
			{
				if(s[i][p[j]]==t[p[j]])continue;
				if((++res)>K){flag=false;break;}
			}c
			ans+=flag;
		}
		printf("%d\n",ans);
	}
		return 0;
	}
	else {
		solve();
	}
}

Details

answer.code: In function ‘int main()’:
answer.code:63:27: error: expected ‘;’ before ‘ans’
   63 |                         }c
      |                           ^
      |                           ;
   64 |                         ans+=flag;
      |                         ~~~
answer.code:51:33: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   51 |                 rep(1,n,i){scanf("%s",s[i]+1);}
      |                            ~~~~~^~~~~~~~~~~~~
answer.code:54:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   54 |                 scanf("%s",t+1);
      |                 ~~~~~^~~~~~~~~~