QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#102439 | #5666. Repetitive Elements | Joler# | WA | 14ms | 3404kb | C++14 | 1.3kb | 2023-05-03 13:14:03 | 2023-05-03 13:14:06 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#ifdef LOCAL
template<class t,class u>ostream& operator<<(ostream& os,const pair<t,u>& p){return os<<"("<<p.first<<","<<p.second<<")";}
#endif
template<class t>ostream& operator<<(ostream& os,const vector<t>& v){if(v.size())os<<v[0];for(int i=1; i<v.size(); i++)os<<' '<<v[i]; return os;}
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
int n, m, t, k, a, b, c, d, cnt, mark, an, oT_To, x, y, z;
ll ans;
struct Solver {
void solve() {
string s;
cin >> s;
string sans;
cnt = 0;
for (int i = 1; i <= s.size(); ++i) {
for (int j = 0; j+i < s.size() && cnt < i; ++j) {
string ss = s.substr(j, i);
for (int l = j+i; l+i < s.size() && cnt < i; ++l) {
string sss = s.substr(l, i);
if (ss == sss) {
cnt = i;
sans = ss;
}
}
}
}
cout << sans << '\n';
}
};
int main () {
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
oT_To = 1;
cin >> oT_To;
while (oT_To--) {
Solver solver;
solver.solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3400kb
input:
5 TATCGATCGAGTTGT TCCGCGAGCGAGTCTCTCCATT GTTTCATCATACGAGGCCCCATACGCGCTGG AGATGGGATCCTTATG GCCCTTAGGCATGGGATGTCGTTTCTTG
output:
ATCG GCGA CATACG GAT CTT
result:
ok 5 lines
Test #2:
score: -100
Wrong Answer
time: 14ms
memory: 3404kb
input:
50 TTGACAACTTCAGGTTGGCACTCCTTCATTTGGATTTCGGAATAATAGTTTTCTGCTCTGCC ATCCTATTCGGGGATAGGAGAGATGGGTTGCCGCTATAAAAGCATTTGAACTCCATTTCACTCCGTTGGCTAGGGGTCGCACTG CCGTAATATAAAGACTCGGAATTCCAATAGCTGCTATTTGCGAGTATGTGACTGAAAACACACCTATAAATATTAGCTGCGTACAAGCTA ATGGCTGCATGCAGGGTCGACTAGACACACTTTGTCT TTGAGGATGTCGACGTGTCT...
output:
CTTCA CATTT TAGCTGC TGCA ACGTG GCGCCGG CTCTT AGTAT AGAG ACAG TAT TGAC CTTG CGTC TACTGG GCCGGT GAA CAGTA GCGT GGTT CCCT GA TAGAC GGTGC GCAGT TGAG ATCAA CCACACA GAGTC ATGTA ATGGTA TATA TATGAA TTCC CATACG TACCA TTAG GGAATGT CAGG GCT AAG CTGT GGAT TCTTC AAAAC ATG GATAA TTA ACATAT CAAT
result:
wrong answer 22nd lines differ - expected: 'GAG', found: 'GA'