QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#553488 | #5666. Repetitive Elements | fr1tz# | Compile Error | / | / | C++17 | 900b | 2024-09-08 14:09:11 | 2024-09-08 14:09:13 |
Judging History
answer
// REPETITIVE ELEMENTS
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
#define fi first
#define se second
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define pp pair<int, int>
#define el '\n'
int main() {
int t;
string s, s1, s2;
cin >> t;
while (t--) {
cin >> s;
bool found = false;
slen = s.size();
for (int length = slen/2; length > 0; length--) {
for (int i = 0; i + length <= slen; i++) {
checkstring = s.substr(i, length);
for (int j = i+length; j + length <= slen; j++) {
comparestring = s.substr(j, length);
if (checkstring == comparestring) {
cout << checkstring << el;
found = true;
break;
}
}
if (found) break;
}
if (found) break;
}
}
}
Details
answer.code: In function ‘int main()’: answer.code:22:5: error: ‘slen’ was not declared in this scope; did you mean ‘wcslen’? 22 | slen = s.size(); | ^~~~ | wcslen answer.code:25:9: error: ‘checkstring’ was not declared in this scope 25 | checkstring = s.substr(i, length); | ^~~~~~~~~~~ answer.code:27:11: error: ‘comparestring’ was not declared in this scope 27 | comparestring = s.substr(j, length); | ^~~~~~~~~~~~~