QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#190136 | #6851. Cyclically Isomorphic | yiwei | WA | 19ms | 82072kb | C++14 | 886b | 2023-09-28 12:56:21 | 2023-09-28 12:56:21 |
Judging History
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'