QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#190136#6851. Cyclically IsomorphicyiweiWA 19ms82072kbC++14886b2023-09-28 12:56:212023-09-28 12:56:21

Judging History

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

  • [2023-09-28 12:56:21]
  • 评测
  • 测评结果:WA
  • 用时:19ms
  • 内存:82072kb
  • [2023-09-28 12:56:21]
  • 提交

answer

#include <cstdio>
#include <set>
#include <string>
#include <iostream>

const int N = 1e6 + 5, P = 131;

int n,m,q;

int read(){
	int v = 0,x = 1;
	char c = getchar();
	while ((c < '0' || c > '9') && c != '-') c = getchar();
	if (c == '-') c = getchar(), x = -1;
	while (c >= '0' && c <= '9') v = v * 10 + (c - '0'), c = getchar();
	return v * x;
}

std::set<std::string> s[N];

std::string str[N];

int main(){
	// freopen("patchwork.in","r",stdin);
	// freopen("patchwork.out","w",stdout);
	n = read(), m = read();
	for (int i = 1;i <= n;i++){
		getline(std::cin,str[i]);
		for (int j = 1;j <= m;j++){
			s[i].insert(str[i]);
			char c = str[i][0];
			str[i].erase(0,1);
			str[i] += c;
		}
	}
	q = read();
	while (q--){
		int x,y; x = read(), y = read();
		if (s[x].find(str[y]) != s[x].end()) puts("Yes");
		else puts("No");
	}
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 19ms
memory: 82072kb

input:

5
10 10000
afcadffafeeebdfedfdafecfdbeecbcadfedcffaedecbacffedeccacfcbfbbdbcefbdefefebcbeacfbaafddbabcbfaeddaaefebbddafaaaaaedcbbdaafaffcbeeebfbbeedebabfbdbaceabfcccfedbdeafccbaffdeadbefbfeadbbedeeabbaafebaceeaeedbaddfecdefaabdbcfadadaebbdeedcfeeabbbdbcefdadbeecafcabbddddbcacadbbcddeddbbeecbdadefbaa...

output:

No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No...

result:

wrong answer 5th lines differ - expected: 'Yes', found: 'No'