problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k ⌀ | fixed_code stringlengths 12 526k ⌀ | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M ⌀ | fixed_submission_id int64 2 1.54M ⌀ | user_id stringlengths 10 10 ⌀ | language stringclasses 9
values |
|---|---|---|---|---|---|---|---|
p03086 | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#define ll long long
#define vl vector<ll>
#define vvl vector<vector<ll>>
using namespace std;
int main() {
string s;
cin >> s;
ll count = 0;
ll ans = 0;
for (int i = 0; i < s.length(); ++i) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
count++;
} else {
ans = max(ans, count);
count = 0;
}
}
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#define ll long long
#define vl vector<ll>
#define vvl vector<vector<ll>>
using namespace std;
int main() {
string s;
cin >> s;
ll count = 0;
ll ans = 0;
for (int i = 0; i < s.length(); ++i) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
count++;
} else {
ans = max(ans, count);
count = 0;
}
}
cout << max(ans, count) << endl;
return 0;
} | [
"call.add",
"call.arguments.add"
] | 900,924 | 900,925 | u386131832 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
getline(cin, s);
int l, count = 0;
l = s.length();
int max = 0;
for (int i = 0; i < l; i++) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
count++;
if (count > max) {
max = count;
}
}
if (s[i + 1] != 'A' || s[i + 1] != 'C' || s[i + 1] != 'G' ||
s[i + 1] != 'T') {
count = 0;
}
}
cout << max;
return 0;
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
getline(cin, s);
int l, count = 0;
l = s.length();
int max = 0;
for (int i = 0; i < l; i++) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
count++;
if (count > max) {
max = count;
}
}
if (s[i + 1] != 'A' && s[i + 1] != 'C' && s[i + 1] != 'G' &&
s[i + 1] != 'T') {
count = 0;
}
}
cout << max;
return 0;
}
| [
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 900,946 | 900,947 | u270342249 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int max_cnt = 0;
int cnt = 0;
for (char c : S) {
if (c == 'A' || c == 'C' || c == 'G' || c == 'T') {
cnt += 1;
} else {
if (cnt > max_cnt) {
max_cnt = cnt;
}
cnt = 0;
}
}
cout << max_cnt << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int max_cnt = 0;
int cnt = 0;
for (char c : S) {
if (c == 'A' || c == 'C' || c == 'G' || c == 'T') {
cnt += 1;
if (cnt > max_cnt) {
max_cnt = cnt;
}
} else {
cnt = 0;
}
}
cout << max_cnt << endl;
return 0;
} | [
"control_flow.branch.else.add"
] | 900,968 | 900,969 | u866992281 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0;
for (int i = 0; i < (s.length()); i++) {
if (s.substr(i, 1) == "A" || s.substr(i, 1) == "C" ||
s.substr(i, 1) == "G" || s.substr(i, 1) == "T") {
int an = 1;
for (int j = 1; j < (s.length() - i - 1); j++) {
if (s.substr(i + j, 1) == "A" || s.substr(i + j, 1) == "C" ||
s.substr(i + j, 1) == "G" || s.substr(i + j, 1) == "T") {
an += 1;
} else {
break;
}
}
if (an > ans) {
ans = an;
}
}
}
cout << ans << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0;
for (int i = 0; i < (s.length()); i++) {
if (s.substr(i, 1) == "A" || s.substr(i, 1) == "C" ||
s.substr(i, 1) == "G" || s.substr(i, 1) == "T") {
int an = 1;
for (int j = 1; j < (s.length() - i); j++) {
if (s.substr(i + j, 1) == "A" || s.substr(i + j, 1) == "C" ||
s.substr(i + j, 1) == "G" || s.substr(i + j, 1) == "T") {
an += 1;
} else {
break;
}
}
if (an > ans) {
ans = an;
}
}
}
cout << ans << endl;
return 0;
}
| [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 900,970 | 900,971 | u668191971 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
int tmp = 0, ans = 0;
for (int i = 0; i < S.size(); i++) {
if (S.at(i) == 'A' || S.at(i) == 'C' || S.at(i) == 'G' || S.at(i) == 'T') {
tmp++;
} else {
if (tmp > ans)
ans = tmp;
tmp = 0;
}
}
cout << ans << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
int tmp = 0, ans = 0;
for (int i = 0; i < S.size(); i++) {
if (S.at(i) == 'A' || S.at(i) == 'C' || S.at(i) == 'G' || S.at(i) == 'T') {
tmp++;
if (tmp > ans)
ans = tmp;
} else {
tmp = 0;
}
}
cout << ans << endl;
return 0;
} | [
"control_flow.branch.else.add"
] | 900,980 | 900,981 | u940000534 | cpp |
p03086 | #include <stdio.h>
main(void) {
char moji[10];
int i, j;
int count = 0;
int tuyoi = 0;
scanf("%c", moji);
for (i = 0; i <= 9; i++) {
if (('A' == moji[i]) || ('T' == moji[i]) || ('C' == moji[i]) ||
('G' == moji[i]))
count++;
else {
if (count >= tuyoi)
tuyoi = count;
count = 0;
}
}
printf("%d", tuyoi);
return 0;
} | #include <stdio.h>
main(void) {
char moji[11];
int i;
int count = 0;
int tuyoi = 0;
scanf("%s", moji);
for (i = 0; i <= 10; i++) {
if (('A' == moji[i]) || ('T' == moji[i]) || ('C' == moji[i]) ||
('G' == moji[i]))
count++;
else {
if (count >= tuyoi)
tuyoi = count;
count = 0;
}
}
printf("%d", tuyoi);
return 0;
} | [
"literal.number.change",
"variable_declaration.array_dimensions.change",
"variable_declaration.remove",
"literal.string.change",
"call.arguments.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 900,991 | 900,990 | u428377266 | cpp |
p03086 | #include "bits/stdc++.h"
using namespace std;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REP1(i, n) for (ll i = 1; i < n; i++)
#define REPR(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
#define ALL(a) (a).begin(), (a).end()
#define pb(a) push_back(a)
int now, n, k;
int main() {
int ans = 0;
string s;
cin >> s;
int ren = 0;
REP(i, s.length()) {
if ((s[i] == 65 + 0) | (s[i] == 65 + 3) | (s[i] == 65 + 6) |
(s[i] == 65 + 19)) {
ren++;
ans = max(ren, ans);
} else {
ren = 0;
}
};
cout << ans << endl;
return 0;
} | #include "bits/stdc++.h"
using namespace std;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REP1(i, n) for (ll i = 1; i < n; i++)
#define REPR(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
#define ALL(a) (a).begin(), (a).end()
#define pb(a) push_back(a)
int now, n, k;
int main() {
int ans = 0;
string s;
cin >> s;
int ren = 0;
REP(i, s.length()) {
if ((s[i] == 65 + 0) | (s[i] == 65 + 2) | (s[i] == 65 + 6) |
(s[i] == 65 + 19)) {
ren++;
ans = max(ren, ans);
} else {
ren = 0;
}
};
cout << ans << endl;
return 0;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 900,999 | 901,000 | u837951457 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
int counts = 0, res = 0;
cin >> s;
for (int i = 0; i < s.length(); i++) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
counts++;
} else {
res = max(res, counts);
counts = 0;
}
}
cout << res << endl;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
int counts = 0, res = 0;
cin >> s;
for (int i = 0; i < s.length(); i++) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
counts++;
res = max(res, counts);
} else {
counts = 0;
}
}
cout << res << endl;
}
| [
"control_flow.branch.else.add"
] | 901,001 | 901,002 | u093744128 | cpp |
p03086 | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif
const int MOD = 1000000007, INF = 1111111111;
using namespace std;
typedef long long lint;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
string S;
cin >> S;
int tmp = 0, ans = 0;
for (int i = 0; i < (int)(S.length()); i++) {
if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T')
tmp++;
else {
ans = max(ans, tmp);
tmp = 0;
}
}
cout << ans;
return 0;
} | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif
const int MOD = 1000000007, INF = 1111111111;
using namespace std;
typedef long long lint;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
string S;
cin >> S;
int tmp = 0, ans = 0;
for (int i = 0; i < (int)(S.length()); i++) {
if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T')
tmp++;
else {
ans = max(ans, tmp);
tmp = 0;
}
}
cout << max(ans, tmp);
return 0;
} | [
"call.add",
"call.arguments.add"
] | 901,003 | 901,004 | u532573979 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int maxi = 0, sum = 0;
for (int i = 0; i < s.size(); i++) {
if (s.at(i) == 'A' || s.at(i) == 'T' || s.at(i) == 'G' || s.at(i) == 'C') {
sum++;
} else {
maxi = max(sum, maxi);
sum = 0;
}
}
cout << maxi << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int maxi = 0, sum = 0;
for (int i = 0; i < s.size(); i++) {
if (s.at(i) == 'A' || s.at(i) == 'T' || s.at(i) == 'G' || s.at(i) == 'C') {
sum++;
} else {
maxi = max(sum, maxi);
sum = 0;
}
}
cout << max(sum, maxi) << endl;
} | [
"call.add",
"call.arguments.change"
] | 901,021 | 901,022 | u372299304 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
bool valid(char s) { return (s == 'A' || s == 'C' || s == 'G' || s == 'T'); };
int main() {
string S;
cin >> S;
int n = S.size();
vector<int> ans(n, 0);
for (int i = 0; i < n; i++) {
if (valid(S[i])) {
for (int j = i; j < n; j++) {
if (valid(S[j]))
ans[i]++;
}
}
}
sort(ans.begin(), ans.end());
reverse(ans.begin(), ans.end());
cout << ans[0] << endl;
};
| #include <bits/stdc++.h>
using namespace std;
bool valid(char s) { return (s == 'A' || s == 'C' || s == 'G' || s == 'T'); };
int main() {
string S;
cin >> S;
int n = S.size();
vector<int> ans(n, 0);
for (int i = 0; i < n; i++) {
if (valid(S[i])) {
for (int j = i; j < n; j++) {
if (valid(S[j]))
ans[i]++;
else
break;
}
}
}
sort(ans.begin(), ans.end());
reverse(ans.begin(), ans.end());
cout << ans[0] << endl;
};
| [
"control_flow.branch.else_if.replace.remove",
"control_flow.branch.if.replace.add"
] | 901,023 | 901,024 | u987594251 | cpp |
p03086 | //
// Created by kuroneko on 2019-07-06.
//
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0, cnt = 0;
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
cnt++;
if (i == int(s.size()) - 1)
ans = cnt;
} else {
ans = max(ans, cnt);
cnt = 0;
}
}
cout << ans << endl;
return 0;
}
| //
// Created by kuroneko on 2019-07-06.
//
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0, cnt = 0;
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
cnt++;
if (i == int(s.size()) - 1)
ans = max(ans, cnt);
} else {
ans = max(ans, cnt);
cnt = 0;
}
}
cout << ans << endl;
return 0;
}
| [
"call.add",
"call.arguments.change"
] | 901,049 | 901,050 | u492352831 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int max_s = 0;
for (int i = 0; i < S.size() - 1; i++) {
int count = 0;
bool judge = true;
int j = i;
while (judge && j <= S.size()) {
if (S.at(j) == 'A' || S.at(j) == 'C' || S.at(j) == 'G' ||
S.at(j) == 'T') {
count++;
j++;
} else
judge = false;
}
if (count > max_s)
max_s = count;
}
cout << max_s << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int max_s = 0;
for (int i = 0; i < S.size(); i++) {
int count = 0;
bool judge = true;
int j = i;
while (judge && j < S.size()) {
if (S.at(j) == 'A' || S.at(j) == 'C' || S.at(j) == 'G' ||
S.at(j) == 'T') {
count++;
j++;
} else
judge = false;
}
if (count > max_s)
max_s = count;
}
cout << max_s << endl;
} | [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove",
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 901,055 | 901,056 | u581832318 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
int length = 0;
int cnt = 0;
for (int i = 0; i < S.length(); i++) {
if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'T') {
++cnt;
length = max(length, cnt);
} else {
cnt = 0;
}
}
cout << length << endl;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
int length = 0;
int cnt = 0;
for (int i = 0; i < S.length(); i++) {
if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') {
++cnt;
length = max(length, cnt);
} else {
cnt = 0;
}
}
cout << length << endl;
} | [
"literal.string.change",
"control_flow.branch.if.condition.change"
] | 901,059 | 901,060 | u911222357 | cpp |
p03086 | #include <stdio.h>
int main(void) {
char S[10];
int max = 0;
int kioku = 0;
scanf("%s", &S);
for (int i = 0; i < 10; i++) {
if (S[i] == 'A')
max += 1;
else if (S[i] == 'C')
max += 1;
else if (S[i] == 'G')
max += 1;
else if (S[i] == 'T')
max += 1;
else {
if (kioku < max)
kioku = max;
max = 0;
}
}
if (max != 0) {
if (max > kioku)
printf("%d", max);
else
printf("%d", kioku);
} else
printf("0");
return 0;
} | #include <stdio.h>
int main(void) {
char S[10];
int max = 0;
int kioku = 0;
scanf("%s", &S);
for (int i = 0; i < 10; i++) {
if (S[i] == 'A')
max += 1;
else if (S[i] == 'C')
max += 1;
else if (S[i] == 'G')
max += 1;
else if (S[i] == 'T')
max += 1;
else {
if (kioku < max)
kioku = max;
max = 0;
}
}
if (max != 0) {
if (max > kioku)
printf("%d", max);
else
printf("%d", kioku);
} else
printf("%d", kioku);
return 0;
} | [
"literal.string.change",
"call.arguments.change",
"io.output.change",
"call.arguments.add"
] | 901,066 | 901,067 | u858196335 | cpp |
p03086 | #include <algorithm>
#include <bitset>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop \
char nyaa; \
cin >> nyaa;
#define rep(i, n) for (int i = 0; i < n; i++)
#define per(i, n) for (int i = n - 1; i >= 0; i--)
#define Rep(i, sta, n) for (int i = sta; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define per1(i, n) for (int i = n; i >= 1; i--)
#define Rep1(i, sta, n) for (int i = sta; i <= n; i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(), c.end()
#define pb push_back
void Yes() {
cout << "Yes" << endl;
exit(0);
}
void No() {
cout << "No" << endl;
exit(0);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string S;
cin >> S;
int N = S.size();
int ans = 0;
for (int i = 0; i < N; i++) {
for (int j = i; j < N; j++) {
string T;
bool flag = true;
Rep(k, i, j) {
T += S[k];
if (S[k] != 'A' && S[k] != 'T' && S[k] != 'G' && S[k] != 'C') {
flag = false;
}
}
int M = T.size();
if (flag)
ans = max(ans, M);
}
}
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <bitset>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop \
char nyaa; \
cin >> nyaa;
#define rep(i, n) for (int i = 0; i < n; i++)
#define per(i, n) for (int i = n - 1; i >= 0; i--)
#define Rep(i, sta, n) for (int i = sta; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define per1(i, n) for (int i = n; i >= 1; i--)
#define Rep1(i, sta, n) for (int i = sta; i <= n; i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(), c.end()
#define pb push_back
void Yes() {
cout << "Yes" << endl;
exit(0);
}
void No() {
cout << "No" << endl;
exit(0);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string S;
cin >> S;
int N = S.size();
int ans = 0;
for (int i = 0; i < N; i++) {
for (int j = i; j < N; j++) {
string T;
bool flag = true;
Rep(k, i, j + 1) {
T += S[k];
if (S[k] != 'A' && S[k] != 'T' && S[k] != 'G' && S[k] != 'C') {
flag = false;
}
}
int M = T.size();
if (flag)
ans = max(ans, M);
}
}
cout << ans << endl;
return 0;
} | [
"expression.operation.binary.add"
] | 901,074 | 901,075 | u508571192 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
bool acgt(char ch) {
char atgc[] = "ACGT";
for (int j = 0; j < 4; ++j) {
if (ch == atgc[j]) {
return true;
}
}
return false;
}
int main() {
string str;
cin >> str;
vector<int> atcg(str.length(), 0);
int ans = 0;
for (int i = 0; i < str.length(); ++i) {
if (acgt[str[i]])
atcg[i] = 1;
if (i && acgt[str[i - 1]])
atcg[i] += atcg[i - 1];
ans = max(atcg[i], ans);
}
cout << ans << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
bool acgt(char ch) {
char atgc[] = "ACGT";
for (int j = 0; j < 4; ++j) {
if (ch == atgc[j]) {
return true;
}
}
return false;
}
int main() {
string str;
cin >> str;
vector<int> atcg(str.length(), 0);
int ans = 0;
for (int i = 0; i < str.length(); ++i) {
if (acgt(str[i]))
atcg[i] = 1;
if (i && acgt(str[i - 1]))
atcg[i] += atcg[i - 1];
ans = max(atcg[i], ans);
}
cout << ans << endl;
return 0;
}
| [
"control_flow.branch.if.condition.change"
] | 901,086 | 901,087 | u676654593 | cpp |
p03086 | /*{{{*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
// pll pp; -> (pp.first,pp.second)
// vector<vl> pp(n,vl(2)); sort(pp.begin(),pp.end(),[](vl a,vl b){return
// a[0]<b[0];});
#define REP(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define RREP(i, n) for (ll(i) = (n)-1; (i) >= 0; (i)--)
#define FOR(i, a, b) for (ll(i) = (a); (i) < (b); (i)++)
#define FORR(i, a, b) for (ll(i) = (b)-1; (i) >= (a); (i)--)
#define DEBUG(x) cout << #x << ": " << x << endl
#define CHMAX(a, b) a = max((a), (b))
#define CHMIN(a, b) a = min((a), (b))
/*}}}*/
int main() {
ll k, m;
string S;
cin >> S;
m = 0;
k = 0;
REP(i, S.length()) {
if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') {
k = k + 1;
} else {
if (k > 0 && k > m) {
m = k;
}
k = 0;
}
}
if (k != 0 || k > m) {
m = k;
}
cout << m << endl;
return 0;
} | /*{{{*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
// pll pp; -> (pp.first,pp.second)
// vector<vl> pp(n,vl(2)); sort(pp.begin(),pp.end(),[](vl a,vl b){return
// a[0]<b[0];});
#define REP(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define RREP(i, n) for (ll(i) = (n)-1; (i) >= 0; (i)--)
#define FOR(i, a, b) for (ll(i) = (a); (i) < (b); (i)++)
#define FORR(i, a, b) for (ll(i) = (b)-1; (i) >= (a); (i)--)
#define DEBUG(x) cout << #x << ": " << x << endl
#define CHMAX(a, b) a = max((a), (b))
#define CHMIN(a, b) a = min((a), (b))
/*}}}*/
int main() {
ll k, m;
string S;
cin >> S;
m = 0;
k = 0;
REP(i, S.length()) {
if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') {
k = k + 1;
} else {
if (k > 0 && k > m) {
m = k;
}
k = 0;
}
}
if (k != 0 && k > m) {
m = k;
}
cout << m << endl;
return 0;
} | [
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 901,092 | 901,093 | u401373764 | cpp |
p03086 | #include "bits/stdc++.h"
using namespace std;
int main() {
int ans = 0;
string s;
cin >> s;
for (int i = 0; i < s.size(); i++) {
for (int j = i; j < s.size(); j++) {
bool flag = true;
for (int k = i; k <= j; k++) {
if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T')
flag = false;
}
if (flag && j - i > ans)
ans = j - i + 1;
}
}
cout << ans;
return 0;
} | #include "bits/stdc++.h"
using namespace std;
int main() {
int ans = 0;
string s;
cin >> s;
for (int i = 0; i < s.size(); i++) {
for (int j = i; j < s.size(); j++) {
bool flag = true;
for (int k = i; k <= j; k++) {
if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T')
flag = false;
}
if (flag && j - i + 1 > ans)
ans = j - i + 1;
}
}
cout << ans;
return 0;
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 901,099 | 901,100 | u076704661 | cpp |
p03086 | #include "bits/stdc++.h"
using namespace std;
int main() {
int ans = 0;
string s;
cin >> s;
for (int i = 0; i < s.size(); i++) {
for (int j = i; j < s.size(); j++) {
bool flag = true;
for (int k = i; k <= j; k++) {
if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T')
flag = false;
}
if (flag && j - i > ans)
ans = j - i;
}
}
cout << ans;
return 0;
} | #include "bits/stdc++.h"
using namespace std;
int main() {
int ans = 0;
string s;
cin >> s;
for (int i = 0; i < s.size(); i++) {
for (int j = i; j < s.size(); j++) {
bool flag = true;
for (int k = i; k <= j; k++) {
if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T')
flag = false;
}
if (flag && j - i + 1 > ans)
ans = j - i + 1;
}
}
cout << ans;
return 0;
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one",
"assignment.change"
] | 901,101 | 901,100 | u076704661 | cpp |
p03086 | #include "bits/stdc++.h"
using namespace std;
int main() {
int ans = 0;
string s;
cin >> s;
for (int i = 0; i < s.size(); i++) {
for (int j = i; j < s.size(); j++) {
bool flag = true;
for (int k = i; k < j; k++) {
if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T')
flag = false;
}
if (flag && j - i > ans)
ans = j - i;
}
}
cout << ans;
return 0;
} | #include "bits/stdc++.h"
using namespace std;
int main() {
int ans = 0;
string s;
cin >> s;
for (int i = 0; i < s.size(); i++) {
for (int j = i; j < s.size(); j++) {
bool flag = true;
for (int k = i; k <= j; k++) {
if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T')
flag = false;
}
if (flag && j - i + 1 > ans)
ans = j - i + 1;
}
}
cout << ans;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change",
"misc.off_by_one",
"assignment.change"
] | 901,102 | 901,100 | u076704661 | cpp |
p03086 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;
int gcd(int n, int m) {
if (n == 0)
return m;
return gcd(m % n, n);
}
int bit_count(int i) {
i = i - ((i >> 1) & 0x55555555);
i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
i = (i + (i >> 4)) & 0x0f0f0f0f;
i = i + (i >> 8);
i = i + (i >> 16);
return i & 0x3f;
}
int main() {
string s;
cin >> s;
int max_l = 0;
for (size_t i = 0; i < s.length(); i++) {
int l = 0;
for (size_t j = 0; j < s.length() - 1 - i; j++) {
if (s[i + j] != 'A' && s[i + j] != 'C' && s[i + j] != 'G' &&
s[i + j] != 'T') {
break;
}
l++;
}
max_l = max(max_l, l);
}
cout << max_l << endl;
}
| #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;
int gcd(int n, int m) {
if (n == 0)
return m;
return gcd(m % n, n);
}
int bit_count(int i) {
i = i - ((i >> 1) & 0x55555555);
i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
i = (i + (i >> 4)) & 0x0f0f0f0f;
i = i + (i >> 8);
i = i + (i >> 16);
return i & 0x3f;
}
int main() {
string s;
cin >> s;
int max_l = 0;
for (size_t i = 0; i < s.length(); i++) {
int l = 0;
for (size_t j = 0; j < s.length() - i; j++) {
if (s[i + j] != 'A' && s[i + j] != 'C' && s[i + j] != 'G' &&
s[i + j] != 'T') {
break;
}
l++;
}
max_l = max(max_l, l);
}
cout << max_l << endl;
}
| [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 901,131 | 901,132 | u671357638 | cpp |
p03086 | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int maxi = 0, tmp = 0;
for (int i = 0; i < s.size(); ++i) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')
tmp++;
else
maxi = max(maxi, tmp);
}
cout << maxi << endl;
return 0;
} | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int maxi = 0, tmp = 0;
for (int i = 0; i < s.size(); ++i) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')
tmp++;
else
tmp = 0;
maxi = max(maxi, tmp);
}
cout << maxi << endl;
return 0;
} | [
"assignment.add"
] | 901,143 | 901,144 | u848359007 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int count = 0, ans = 0;
for (int i = 0; i < s.size(); i++) {
if (s.at(i) == 'A' || s.at(i) == 'C' || s.at(i) == 'G' || s.at(i) == 'T') {
count++;
} else {
if (ans < count)
ans = count;
count = 0;
}
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int count = 0, ans = 0;
for (int i = 0; i < s.size(); i++) {
if (s.at(i) == 'A' || s.at(i) == 'C' || s.at(i) == 'G' || s.at(i) == 'T') {
count++;
} else {
if (ans < count)
ans = count;
count = 0;
}
}
cout << max(ans, count) << endl;
}
| [
"call.add",
"call.arguments.add"
] | 901,149 | 901,150 | u952865396 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM + 7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int, int>
#define lPair pair<ll, ll>
#define chmax(a, b) (a < b ? a = b : 0)
#define chmin(a, b) (a > b ? a = b : 0)
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
int main() {
string s;
cin >> s;
int mx = 0, tmp = 0;
int n = s.size();
for (int i = 0; i < n; i++) {
if (s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C') {
tmp++;
if (i == n) {
mx = max(mx, tmp);
}
} else {
mx = max(mx, tmp);
tmp = 0;
}
}
cout << mx << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM + 7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int, int>
#define lPair pair<ll, ll>
#define chmax(a, b) (a < b ? a = b : 0)
#define chmin(a, b) (a > b ? a = b : 0)
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
int main() {
string s;
cin >> s;
int mx = 0, tmp = 0;
int n = s.size();
for (int i = 0; i < n; i++) {
if (s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C') {
tmp++;
if (i == n - 1) {
mx = max(mx, tmp);
}
} else {
mx = max(mx, tmp);
tmp = 0;
}
}
cout << mx << endl;
return 0;
}
| [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 901,157 | 901,158 | u342051078 | cpp |
p03086 | /*
* author: said_v15
* created with web_programmer
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int n = s.size();
int ans = 0;
for (int i = 0; i < n; i++) {
int cnt = 0;
for (int j = i; j < n; j++) {
if (s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T')
cnt++;
else {
ans = max(ans, cnt);
break;
}
}
}
cout << ans << endl;
return 0;
} | /*
* author: said_v15
* created with web_programmer
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int n = s.size();
int ans = 0;
for (int i = 0; i < n; i++) {
int cnt = 0;
for (int j = i; j < n; j++) {
if (s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T') {
cnt++;
ans = max(ans, cnt);
} else {
break;
}
}
}
cout << ans << endl;
return 0;
} | [
"control_flow.branch.else.add"
] | 901,165 | 901,166 | u972416449 | cpp |
p03086 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main() {
string s;
cin >> s;
int cnt = 0, ans;
for (int i = 0; i < s.size(); ++i) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'T' || s[i] == 'G')
cnt++;
else
cnt = 0;
ans = max(cnt, ans);
}
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main() {
string s;
cin >> s;
int cnt = 0, ans = 0;
for (int i = 0; i < s.size(); ++i) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'T' || s[i] == 'G')
cnt++;
else
cnt = 0;
ans = max(cnt, ans);
}
cout << ans << endl;
return 0;
} | [
"variable_declaration.value.change"
] | 901,171 | 901,172 | u266389218 | cpp |
p03086 | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
int main() {
string s;
cin >> s;
int ans = 0, count = 0;
for (int i = 0; i < s.size(); i++) {
char c = s[i];
if (c == 'A' || c == 'C' || c == 'G' || c == 'T') {
count++;
} else {
ans = max(ans, count);
count = 0;
}
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
int main() {
string s;
cin >> s;
int ans = 0, count = 0;
for (int i = 0; i < s.size(); i++) {
char c = s[i];
if (c == 'A' || c == 'C' || c == 'G' || c == 'T') {
count++;
} else {
ans = max(ans, count);
count = 0;
}
}
cout << max(ans, count) << endl;
}
| [
"call.add",
"call.arguments.add"
] | 901,175 | 901,176 | u630664279 | cpp |
p03086 | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define all(x) (x).begin(), (x).end()
#define pushb push_back()
#define popb pop_back()
#define makep make_pair
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
int main() {
string s;
cin >> s;
vector<int> count(s.size());
rep(i, s.size()) {
char a = s[i];
if ((a == 'A') + (a == 'C') + (a == 'G') + (a == 'T')) {
count[i] = 1;
} else {
count[i] = 0;
}
}
int ans = 0;
rep(i, 1, s.size()) {
if (count[i]) {
count[i] += count[i - 1];
ans = max(ans, count[i]);
}
}
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define all(x) (x).begin(), (x).end()
#define pushb push_back()
#define popb pop_back()
#define makep make_pair
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
int main() {
string s;
cin >> s;
vector<int> count(s.size());
rep(i, s.size()) {
char a = s[i];
if ((a == 'A') + (a == 'C') + (a == 'G') + (a == 'T')) {
count[i] = 1;
} else {
count[i] = 0;
}
}
int ans = count[0];
rep(i, 1, s.size()) {
if (count[i]) {
count[i] += count[i - 1];
ans = max(ans, count[i]);
}
}
cout << ans << endl;
return 0;
} | [] | 901,177 | 901,178 | u342703951 | cpp |
p03086 | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define pb(a) push_back(a)
using namespace std;
typedef long long ll;
int main() {
string S;
cin >> S;
int cnt = 0;
int M = 0;
REP(i, S.size()) {
if (S.at(i) == 'A' || S.at(i) == 'C' || S.at(i) == 'G' || S.at(i) == 'T')
cnt++;
else {
M = max(cnt, M);
cnt = 0;
}
}
cout << M << endl;
}
| #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define pb(a) push_back(a)
using namespace std;
typedef long long ll;
int main() {
string S;
cin >> S;
int cnt = 0;
int M = 0;
REP(i, S.size()) {
if (S.at(i) == 'A' || S.at(i) == 'C' || S.at(i) == 'G' || S.at(i) == 'T') {
cnt++;
M = max(cnt, M);
} else {
cnt = 0;
}
}
cout << M << endl;
}
| [
"control_flow.branch.else.add"
] | 901,203 | 901,204 | u346812984 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
bool acgt(string s) {
bool flag = true;
for (int i = 0; i < s.size(); i++) {
if (s[i] != 'A' && s[i] != 'C' && s[i] != 'G' && s[i] != 'T') {
flag = false;
}
if (!flag)
break;
;
}
return flag;
}
int main() {
string s;
cin >> s;
bool flag;
int m = 0;
for (int i = 0; i < s.size(); i++) {
for (int j = i; j < s.size(); j++) {
flag = acgt(s.substr(i, j - i));
if (flag)
m = max(m, j - i);
}
}
cout << m << endl;
return 0;
} | #include <iostream>
#
#include <string>
using namespace std;
bool acgt(string s) {
bool flag = true;
for (int i = 0; i < s.size(); i++) {
if (s[i] != 'A' && s[i] != 'C' && s[i] != 'G' && s[i] != 'T') {
flag = false;
}
if (!flag)
break;
;
}
return flag;
}
int main() {
string s;
cin >> s;
bool flag;
int m = 0;
for (int i = 0; i < s.size(); i++) {
for (int j = i; j < s.size() + 1; j++) {
flag = acgt(s.substr(i, j - i));
if (flag)
m = max(m, j - i);
}
}
cout << m << endl;
return 0;
}
| [
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 901,223 | 901,224 | u167604613 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int dp[100][100];
int main() {
string s;
cin >> s;
string t = "ATGC";
int cnt = 0, mx = 0;
for (char c : s) {
if (t.find(c) != string::npos) {
cnt++;
} else {
mx = max(mx, cnt);
cnt = 0;
}
}
cout << mx << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int dp[100][100];
int main() {
string s;
cin >> s;
string t = "ATGC";
int cnt = 0, mx = 0;
for (char c : s) {
if (t.find(c) != string::npos) {
cnt++;
} else {
mx = max(mx, cnt);
cnt = 0;
}
}
cout << max(cnt, mx) << endl;
}
| [
"call.add",
"call.arguments.change"
] | 901,225 | 901,226 | u048764593 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
int count;
int countmax = 0;
for (int i = 0; i < S.length(); i++) {
if ((S[i] == 'A') || (S[i] == 'C') || (S[i] == 'G') || (S[i] == 'T')) {
count++;
if (count > countmax) {
countmax = count;
}
} else {
count = 0;
}
}
cout << countmax << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
int count = 0;
int countmax = 0;
for (int i = 0; i < S.length(); i++) {
if ((S[i] == 'A') || (S[i] == 'C') || (S[i] == 'G') || (S[i] == 'T')) {
count++;
if (count > countmax) {
countmax = count;
}
} else {
count = 0;
}
}
cout << countmax << endl;
return 0;
} | [
"variable_declaration.value.change"
] | 901,244 | 901,245 | u828664775 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0, now = 0;
for (auto e : s) {
if (e == 'A' or e == 'T' or e == 'G' or e == 'C')
ans = max(++ans, now);
else
now = 0;
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0, now = 0;
for (auto e : s) {
if (e == 'A' or e == 'T' or e == 'G' or e == 'C')
ans = max(ans, ++now);
else
now = 0;
}
cout << ans << endl;
} | [
"call.arguments.change"
] | 901,268 | 901,269 | u331606500 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
// using std::swap;
int main() {
string s, r;
int t = 0, u = 0, i = 0;
cin >> s;
while (1) {
if (i + 1 > s.length())
break;
r = s.substr(i, 1);
if (r != "A" && r != "T" && r != "G" && r != "C") {
if (i > t)
t = i;
s.erase(0, i + 1);
i = 0;
continue;
}
if (i > t)
t = i;
++i;
}
cout << t << "\n";
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s, r;
int t = 0, u = 0, i = 0;
cin >> s;
while (1) {
if (i + 1 > s.length())
break;
r = s.substr(i, 1);
if (r != "A" && r != "T" && r != "G" && r != "C") {
if (i > t)
t = i;
s.erase(0, i + 1);
i = 0;
continue;
}
if (i >= t)
t = i + 1;
++i;
}
cout << t << "\n";
return 0;
} | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"assignment.change"
] | 901,294 | 901,295 | u196471026 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < int(n); i++)
int main() {
string s;
cin >> s;
int n = s.size();
int maxi = 0;
forn(i, n) {
forn(j, n - i) {
string a = s.substr(i, j);
int flag = 0;
forn(k, a.size()) {
if (a[k] != 'A' && a[k] != 'C' && a[k] != 'G' && a[k] != 'T') {
flag = 1;
break;
}
}
if (flag == 0)
maxi = max(maxi, j);
}
}
cout << maxi << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < int(n); i++)
int main() {
string s;
cin >> s;
int n = s.size();
int maxi = 0;
int j;
forn(i, n) {
forn(j, n - i + 1) {
string a = s.substr(i, j);
int flag = 0;
forn(k, a.size()) {
if (a[k] != 'A' && a[k] != 'C' && a[k] != 'G' && a[k] != 'T') {
flag = 1;
break;
}
}
if (flag == 0)
maxi = max(maxi, j);
}
}
cout << maxi << endl;
} | [
"variable_declaration.add"
] | 901,307 | 901,308 | u061383139 | cpp |
p03086 | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define ALL(x) (x).begin(), (x).end()
#define rt return
#define dll(x) scanf("%I64d", &x)
#define xll(x) printf("%I64d\n", x)
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define rep(i, x, n) for (int i = x; i < n; i++)
#define repd(i, x, n) for (int i = x; i <= n; i++)
#define pii pair<int, int>
#define pll pair<long long, long long>
#define gbtb ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define gg(x) getInt(&x)
#define db(x) cout << "== [ " << x << " ] ==" << endl;
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll powmod(ll a, ll b, ll MOD) {
ll ans = 1;
while (b) {
if (b % 2)
ans = ans * a % MOD;
a = a * a % MOD;
b /= 2;
}
return ans;
}
inline void getInt(int *p);
const int maxn = 1000010;
const int inf = 0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
char str[maxn];
int dp[maxn];
int ans = 0;
int main() {
// freopen("D:\\common_text\\code_stream\\in.txt","r",stdin);
// freopen("D:\\common_text\\code_stream\\out.txt","w",stdout);
scanf("%s", str);
int n = strlen(str);
repd(i, 0, n - 1) {
if (str[i] == 'A' || str[i] == 'C' || str[i] == 'G' || str[i] == 'T') {
dp[i] = dp[i - 1] + 1;
}
ans = max(ans, dp[i - 1]);
}
printf("%d\n", ans);
return 0;
}
inline void getInt(int *p) {
char ch;
do {
ch = getchar();
} while (ch == ' ' || ch == '\n');
if (ch == '-') {
*p = -(getchar() - '0');
while ((ch = getchar()) >= '0' && ch <= '9') {
*p = *p * 10 - ch + '0';
}
} else {
*p = ch - '0';
while ((ch = getchar()) >= '0' && ch <= '9') {
*p = *p * 10 + ch - '0';
}
}
}
| #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define ALL(x) (x).begin(), (x).end()
#define rt return
#define dll(x) scanf("%I64d", &x)
#define xll(x) printf("%I64d\n", x)
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define rep(i, x, n) for (int i = x; i < n; i++)
#define repd(i, x, n) for (int i = x; i <= n; i++)
#define pii pair<int, int>
#define pll pair<long long, long long>
#define gbtb ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define gg(x) getInt(&x)
#define db(x) cout << "== [ " << x << " ] ==" << endl;
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll powmod(ll a, ll b, ll MOD) {
ll ans = 1;
while (b) {
if (b % 2)
ans = ans * a % MOD;
a = a * a % MOD;
b /= 2;
}
return ans;
}
inline void getInt(int *p);
const int maxn = 1000010;
const int inf = 0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
char str[maxn];
int dp[maxn];
int ans = 0;
int main() {
// freopen("D:\\common_text\\code_stream\\in.txt","r",stdin);
// freopen("D:\\common_text\\code_stream\\out.txt","w",stdout);
scanf("%s", str);
int n = strlen(str);
repd(i, 0, n - 1) {
if (str[i] == 'A' || str[i] == 'C' || str[i] == 'G' || str[i] == 'T') {
dp[i] = dp[i - 1] + 1;
}
ans = max(ans, dp[i]);
}
printf("%d\n", ans);
return 0;
}
inline void getInt(int *p) {
char ch;
do {
ch = getchar();
} while (ch == ' ' || ch == '\n');
if (ch == '-') {
*p = -(getchar() - '0');
while ((ch = getchar()) >= '0' && ch <= '9') {
*p = *p * 10 - ch + '0';
}
} else {
*p = ch - '0';
while ((ch = getchar()) >= '0' && ch <= '9') {
*p = *p * 10 + ch - '0';
}
}
}
| [
"expression.operation.binary.remove"
] | 901,330 | 901,331 | u220293451 | cpp |
p03086 | #include <bits/stdc++.h>
#define FOR(i, n) for (int i = 0; i < n; i++)
#define SFOR(i, a, b) for (int i = a; i < b; i++)
#define elif (a) else if (a)
#define INF INT_MAX
#define F first
#define S second
#define endl '\n'
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string s;
cin >> s;
int cnt = 0, maxi = 0;
FOR(i, s.size()) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
cnt++;
} else {
maxi = max(maxi, cnt);
cnt = 0;
}
}
cout << maxi << endl;
return 0;
}
| #include <bits/stdc++.h>
#define FOR(i, n) for (int i = 0; i < n; i++)
#define SFOR(i, a, b) for (int i = a; i < b; i++)
#define elif (a) else if (a)
#define INF INT_MAX
#define F first
#define S second
#define endl '\n'
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string s;
cin >> s;
int cnt = 0, maxi = 0;
FOR(i, s.size() + 1) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
cnt++;
} else {
maxi = max(maxi, cnt);
cnt = 0;
}
}
cout << maxi << endl;
return 0;
}
| [
"expression.operation.binary.add"
] | 901,332 | 901,333 | u260221618 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0;
int anmichi = 0;
for (int i = 0; i < s.size(); i++) {
if (s[0] == 'A' || s[0] == 'C' || s[0] == 'G' || s[0] == 'T')
ans++;
else
ans = 0;
anmichi = max(ans, anmichi);
}
cout << anmichi << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0;
int anmichi = 0;
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')
ans++;
else
ans = 0;
anmichi = max(ans, anmichi);
}
cout << anmichi << endl;
}
| [
"identifier.replace.add",
"literal.replace.remove",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 901,338 | 901,339 | u608785059 | cpp |
p03086 | #include <cstring>
#include <iostream>
using namespace std;
char s[15];
int l, lmax;
int main() {
cin >> s;
for (int i = 0; i < strlen(s); i++)
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')
l++;
else {
lmax = max(lmax, l);
l = 0;
}
cout << lmax;
return 0;
}
| #include <cstring>
#include <iostream>
using namespace std;
char s[15];
int l, lmax;
int main() {
cin >> s;
for (int i = 0; i < strlen(s); i++)
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')
l++;
else {
lmax = max(lmax, l);
l = 0;
}
cout << max(l, lmax);
return 0;
}
| [
"call.add",
"call.arguments.change"
] | 901,342 | 901,343 | u735980210 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N = S.size();
int cnt = 0, ans = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') {
cnt++;
} else {
ans = max(ans, cnt);
cnt == 0;
}
}
ans = max(ans, cnt);
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N = S.size();
int cnt = 0, ans = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') {
cnt++;
} else {
ans = max(ans, cnt);
cnt = 0;
}
}
ans = max(ans, cnt);
cout << ans << endl;
}
| [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 901,351 | 901,352 | u812498271 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
int N = S.size();
int cnt = 0, ans = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') {
cnt++;
} else {
ans = max(ans, cnt);
cnt == 0;
}
}
ans = max(ans, cnt);
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N = S.size();
int cnt = 0, ans = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') {
cnt++;
} else {
ans = max(ans, cnt);
cnt = 0;
}
}
ans = max(ans, cnt);
cout << ans << endl;
}
| [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 901,353 | 901,352 | u812498271 | cpp |
p03086 | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int ACGT_length(string str) {
for (int i = 0; i < str.length(); i++) {
if (str[i] != 'A' && str[i] != 'C' && str[i] != 'G' && str[i] != 'T') {
return -1;
}
}
return str.length();
}
int main(void) {
string str;
cin >> str;
int max_length = 0;
for (int i = 0; i < str.length(); i++) {
for (int j = 0; i + j < str.length(); j++) {
string substr = str.substr(i, j);
max_length = max(max_length, ACGT_length(substr));
}
}
cout << max_length << endl;
return 0;
}
| #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int ACGT_length(string str) {
for (int i = 0; i < str.length(); i++) {
if (str[i] != 'A' && str[i] != 'C' && str[i] != 'G' && str[i] != 'T') {
return -1;
}
}
return str.length();
}
int main(void) {
string str;
cin >> str;
int max_length = 0;
for (int i = 0; i < str.length(); i++) {
for (int j = 0; i + j <= str.length(); j++) {
string substr = str.substr(i, j);
max_length = max(max_length, ACGT_length(substr));
}
}
cout << max_length << endl;
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 901,356 | 901,357 | u396989868 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main(void) {
string S;
cin >> S;
int ans = 0;
for (int i = 0; i < S.length(); i++) {
for (int j = i; j < S.length(); j++) {
string res = S.substr(i, j);
if (regex_match(res, regex("(A|T|G|C)*")))
ans = max((int)res.length(), ans);
}
}
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main(void) {
string S;
cin >> S;
int ans = 0;
for (int i = 0; i < S.length(); i++) {
for (int j = 0; j < S.length() - i + 1; j++) {
string res = S.substr(i, j);
if (regex_match(res, regex("(A|T|G|C)*")))
ans = max((int)res.length(), ans);
}
}
cout << ans << endl;
return 0;
} | [
"variable_declaration.value.change",
"identifier.replace.remove",
"literal.replace.add",
"control_flow.loop.for.initializer.change",
"control_flow.loop.for.condition.change"
] | 901,362 | 901,361 | u615194706 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
char b;
int i, k, max;
k = 0;
max = 0;
cin >> s;
for (i = 0; i < s.size(); i++) {
b = s[i];
if (b == 'A' || b == 'T' || b == 'C' || b == 'C') {
k++;
} else {
k = 0;
}
if (max < k)
max = k;
}
cout << max;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
char b;
int i, k, max;
k = 0;
max = 0;
cin >> s;
for (i = 0; i < s.size(); i++) {
b = s[i];
if (b == 'A' || b == 'T' || b == 'C' || b == 'G') {
k++;
} else {
k = 0;
}
if (max < k)
max = k;
}
cout << max;
return 0;
} | [
"literal.string.change",
"control_flow.branch.if.condition.change"
] | 901,383 | 901,384 | u070471279 | cpp |
p03086 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define ASC(c) sort((c).begin(), (c).end())
#define DESC(c) sort((c).begin(), (c).end(), greater<int>())
#define DUMP(x) cerr << #x << " = " << (x) << endl;
#define DEBUG(x) \
cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
<< " " << __FILE__ << endl;
typedef long long ll;
typedef unsigned long long ull;
struct edge {
int u, v;
ll w;
};
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;
int main() {
string s;
cin >> s;
int mx = 0, count = 0;
REP(i, s.length()) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
count++;
} else {
if (mx < count)
mx = count;
count = 0;
}
}
cout << mx << endl;
}
| #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define ASC(c) sort((c).begin(), (c).end())
#define DESC(c) sort((c).begin(), (c).end(), greater<int>())
#define DUMP(x) cerr << #x << " = " << (x) << endl;
#define DEBUG(x) \
cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
<< " " << __FILE__ << endl;
typedef long long ll;
typedef unsigned long long ull;
struct edge {
int u, v;
ll w;
};
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;
int main() {
string s;
cin >> s;
int mx = 0, count = 0;
REP(i, s.length()) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
count++;
} else {
if (mx < count)
mx = count;
count = 0;
}
}
cout << max(mx, count) << endl;
}
| [
"call.add",
"call.arguments.add"
] | 901,393 | 901,394 | u112581208 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int count(string s) {
for (int i = 0; i < (int)s.size(); i++) {
if (!(s[i] == 'A' || s[i] == 'C' || s[i] == 'T' || s[i] == 'G')) {
return -1;
}
}
return (int)s.size();
}
int main() {
string s;
cin >> s;
int max = 0;
for (int i = 0; i < (int)s.size(); i++) {
for (int j = i + 1; j < (int)s.size(); j++) {
int tmp = count(s.substr(i, j - i));
if (tmp > max)
max = tmp;
}
}
cout << max << endl;
} | #include <bits/stdc++.h>
using namespace std;
int count(string s) {
for (int i = 0; i < (int)s.size(); i++) {
if (!(s[i] == 'A' || s[i] == 'C' || s[i] == 'T' || s[i] == 'G')) {
return -1;
}
}
return (int)s.size();
}
int main() {
string s;
cin >> s;
int max = 0;
for (int i = 0; i < (int)s.size(); i++) {
for (int j = i + 1; j <= (int)s.size(); j++) {
int tmp = count(s.substr(i, j - i));
if (tmp > max)
max = tmp;
}
}
cout << max << endl;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 901,395 | 901,396 | u204973596 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
//入力
string S;
cin >> S;
//処理
string T = "ATCG";
int ans = 0;
for (int i = 0; i < S.size(); i++) {
// iは開始地点
int now = 0;
for (int j = i; j < T.size(); j++) {
// j文字目まではATCGであるかチェック
bool ok = false;
for (int k = 0; k < T.size(); k++) {
if (S[j] == T[k])
ok = true;
}
if (ok) {
// j文字目がATCG文字なら,i文字目からj文字目がATCG文字列である。
now++;
ans = max(ans, now);
}
else {
// j文字目がATCG文字列でないならこれ以上i文字目から始まるATCG文字列は作れない
break;
}
}
}
cout << ans << endl;
} | #include <algorithm>
#include <bits/stdc++.h>
using namespace std;
int main() {
//入力
string S;
cin >> S;
//処理
string T = "ATCG";
int ans = 0;
for (int i = 0; i < S.size(); i++) {
// iは開始地点
int now = 0;
for (int j = i; j < S.size(); j++) {
// j文字目まではATCGであるかチェック
bool ok = false;
for (int k = 0; k < T.size(); k++) {
if (S[j] == T[k])
ok = true;
}
if (ok) {
// j文字目がATCG文字なら,i文字目からj文字目がATCG文字列である。
now++;
ans = max(ans, now);
}
else {
// j文字目がATCG文字列でないならこれ以上i文字目から始まるATCG文字列は作れない
break;
}
}
}
cout << ans << endl;
} | [
"import.add",
"identifier.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 901,405 | 901,406 | u102871988 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
bool check(char ch) {
string s = "ATCH";
return (s.find(ch) != -1);
}
int main() {
string s;
cin >> s;
s = '6' + s + '6';
int pre_pos, ans = 0;
for (int i = 1; i < s.size(); i++) {
if (check(s[i - 1]) && !check(s[i])) {
ans = max(ans, i - pre_pos);
}
if (check(s[i]) && !check(s[i - 1])) {
pre_pos = i;
}
}
cout << ans << endl;
return 0;
}
| #include <iostream>
#include <string>
using namespace std;
bool check(char ch) {
string s = "ATCG";
return (s.find(ch) != -1);
}
int main() {
string s;
cin >> s;
s = '6' + s + '6';
int pre_pos, ans = 0;
for (int i = 1; i < s.size(); i++) {
if (check(s[i - 1]) && !check(s[i])) {
ans = max(ans, i - pre_pos);
}
if (check(s[i]) && !check(s[i - 1])) {
pre_pos = i;
}
}
cout << ans << endl;
return 0;
}
| [
"literal.string.change",
"variable_declaration.value.change"
] | 901,413 | 901,414 | u935845450 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
bool C(char d) {
if (d == 'A' || d == 'T' || d == 'C' || d == 'G')
return true;
else
return false;
}
int main() {
string s;
int max = 0;
cin >> s;
for (int i = 0; i < s.size() - 1; i++) {
int k = i;
int count = 0;
while (C(s[k]) == true) {
count++;
k++;
}
if (count > max)
max = count;
}
cout << max << endl;
return 0;
}
| #include <iostream>
#include <string>
using namespace std;
bool C(char d) {
if (d == 'A' || d == 'T' || d == 'C' || d == 'G')
return true;
else
return false;
}
int main() {
string s;
int max = 0;
cin >> s;
for (int i = 0; i < s.size(); i++) {
int k = i;
int count = 0;
while (C(s[k]) == true) {
count++;
k++;
}
if (count > max)
max = count;
}
cout << max << endl;
return 0;
} | [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 901,415 | 901,416 | u821732221 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
int main() {
string str = "AGTKIEAAAC";
int max = 0, cnt = 0;
for (int i = 0; i < str.length(); ++i) {
if (str[i] == 'A' || str[i] == 'G' || str[i] == 'C' || str[i] == 'T') {
++cnt;
} else {
if (cnt > max)
max = cnt;
cnt = 0;
}
}
if (cnt > max)
max = cnt;
cout << max << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
int max = 0, cnt = 0;
for (int i = 0; i < str.length(); ++i) {
if (str[i] == 'A' || str[i] == 'G' || str[i] == 'C' || str[i] == 'T') {
++cnt;
} else {
if (cnt > max)
max = cnt;
cnt = 0;
}
}
if (cnt > max)
max = cnt;
cout << max << endl;
return 0;
}
| [] | 901,419 | 901,420 | u343110708 | cpp |
p03086 | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
size_t max_length = 0;
size_t length = 0;
const set<char> checker{'A', 'C', 'G', 'T'};
for (size_t i = 0, size = str.size(); i < size; ++i) {
if (checker.find(str[i]) != checker.end()) {
++length;
} else {
if (length > max_length) {
max_length = length;
}
length = 0;
}
}
cout << max_length;
return 0;
}
| #include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
size_t max_length = 0;
size_t length = 0;
const set<char> checker{'A', 'C', 'G', 'T'};
for (size_t i = 0, size = str.size(); i < size; ++i) {
if (checker.find(str[i]) != checker.end()) {
++length;
if (length > max_length) {
max_length = length;
}
} else {
length = 0;
}
}
cout << max_length;
return 0;
}
| [
"control_flow.branch.else.add"
] | 901,421 | 901,422 | u762603420 | cpp |
p03086 | #include <iostream>
#include <map>
#include <stdio.h>
#include <string>
using namespace std;
int main(void) {
string S;
int max_length = 0;
int tmp_length = 0;
cin >> S;
for (int head = 0; head < S.length(); head++) {
for (int tail = 0; tail < S.length(); tail++) {
if (S[tail] == 'A' || S[tail] == 'C' || S[tail] == 'G' ||
S[tail] == 'T') {
tmp_length++;
} else {
break;
}
}
if (tmp_length > max_length)
max_length = tmp_length;
tmp_length = 0;
}
cout << max_length << endl;
return 0;
} | #include <iostream>
#include <map>
#include <stdio.h>
#include <string>
using namespace std;
int main(void) {
string S;
int max_length = 0;
int tmp_length = 0;
cin >> S;
for (int head = 0; head < S.length(); head++) {
for (int tail = head; tail < S.length(); tail++) {
if (S[tail] == 'A' || S[tail] == 'C' || S[tail] == 'G' ||
S[tail] == 'T') {
tmp_length++;
} else {
break;
}
}
if (tmp_length > max_length)
max_length = tmp_length;
tmp_length = 0;
}
cout << max_length << endl;
return 0;
}
| [
"variable_declaration.value.change",
"identifier.replace.add",
"literal.replace.remove",
"control_flow.loop.for.initializer.change"
] | 901,441 | 901,442 | u363215066 | cpp |
p03086 | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 999999999
#define llong long long
using namespace std;
int main() {
string s;
cin >> s;
int max = 0;
int flag = 0;
for (int i = 0; i < s.size() - 1; i++) {
for (int j = i + 1; j < s.size(); j++) {
flag = 0;
for (int k = i; k <= j; k++) {
if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T') {
flag = 1;
}
}
if (flag == 0 && max < j - i + 1) {
max = j - i + 1;
}
}
}
cout << max << endl;
return 0;
}
| #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 999999999
#define llong long long
using namespace std;
int main() {
string s;
cin >> s;
int max = 0;
int flag = 0;
for (int i = 0; i < s.size(); i++) {
for (int j = i; j < s.size(); j++) {
flag = 0;
for (int k = i; k <= j; k++) {
if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T') {
flag = 1;
}
}
if (flag == 0 && max < j - i + 1) {
max = j - i + 1;
}
}
}
cout << max << endl;
return 0;
}
| [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove",
"control_flow.loop.for.initializer.change"
] | 901,447 | 901,448 | u831416184 | cpp |
p03086 | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 999999999
#define llong long long
using namespace std;
int main() {
string s;
cin >> s;
int max = 0;
int flag = 0;
for (int i = 0; i < s.size(); i++) {
for (int j = i + 1; j <= s.size(); j++) {
flag = 0;
for (int k = i; k <= j; k++) {
if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T') {
flag = 1;
}
}
if (flag == 0 && max < j - i + 1) {
max = j - i + 1;
}
}
}
cout << max << endl;
return 0;
}
| #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 999999999
#define llong long long
using namespace std;
int main() {
string s;
cin >> s;
int max = 0;
int flag = 0;
for (int i = 0; i < s.size(); i++) {
for (int j = i; j < s.size(); j++) {
flag = 0;
for (int k = i; k <= j; k++) {
if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T') {
flag = 1;
}
}
if (flag == 0 && max < j - i + 1) {
max = j - i + 1;
}
}
}
cout << max << endl;
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove",
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 901,449 | 901,448 | u831416184 | cpp |
p03086 | #include <iostream>
#include <string>
int main(int argc, char *argv[]) {
std::string str("abcde");
int countACGTLength = 0;
int maxACGTLength = 0;
int str_i = 0;
std::cin >> str;
for (str_i = 0; str_i < (int)str.length(); str_i++) {
if ((str[str_i] == 'A') || (str[str_i] == 'C') || (str[str_i] == 'G') ||
(str[str_i] == 'T')) {
countACGTLength++;
} else {
maxACGTLength = std::max(countACGTLength, maxACGTLength);
countACGTLength = 0;
}
}
std::cout << maxACGTLength << std::endl;
return 0;
} | #include <iostream>
#include <string>
int main(int argc, char *argv[]) {
std::string str("abcde");
int countACGTLength = 0;
int maxACGTLength = 0;
int str_i = 0;
std::cin >> str;
for (str_i = 0; str_i < (int)str.length(); str_i++) {
if ((str[str_i] == 'A') || (str[str_i] == 'C') || (str[str_i] == 'G') ||
(str[str_i] == 'T')) {
countACGTLength++;
maxACGTLength = std::max(countACGTLength, maxACGTLength);
} else {
countACGTLength = 0;
}
}
std::cout << maxACGTLength << std::endl;
return 0;
} | [
"control_flow.branch.else.add"
] | 901,459 | 901,460 | u718082610 | cpp |
p03086 | #include <iostream>
using namespace std;
int main() {
string str;
int len = 0, maxlen = 0;
cin >> str;
for (int i = 0; i < str.length(); i++) {
switch (str[i]) {
case 'A':
case 'T':
case 'G':
case 'C':
len++;
break;
default:
maxlen = max(len, maxlen);
len = 0;
}
}
cout << maxlen << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
string str;
int len = 0, maxlen = 0;
cin >> str;
for (int i = 0; i <= str.length(); i++) {
switch (str[i]) {
case 'A':
case 'T':
case 'G':
case 'C':
len++;
break;
default:
maxlen = max(len, maxlen);
len = 0;
}
}
cout << maxlen << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 901,461 | 901,462 | u979960743 | cpp |
p03086 | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
char c;
int i = 1;
int ans = 0;
int a[12];
while (cin >> c) {
if (c == 'A' || c == 'C' || c == 'G' || c == 'T')
a[i]++;
if (a[i] == 1 && a[i - 1] > 0)
a[i] = a[i - 1] + 1;
if (ans < a[i])
ans = a[i];
i++;
}
cout << ans << endl;
}
| #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
char c;
int i = 1;
int ans = 0;
int a[12] = {0};
while (cin >> c) {
if (c == 'A' || c == 'C' || c == 'G' || c == 'T')
a[i]++;
if (a[i] == 1 && a[i - 1] > 0)
a[i] = a[i - 1] + 1;
if (ans < a[i])
ans = a[i];
i++;
}
cout << ans << endl;
} | [
"variable_declaration.value.change"
] | 901,479 | 901,480 | u791146764 | cpp |
p03086 |
// include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// conversion
//------------------------------------------
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }
// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c) \
for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define EXISTch(s, c) \
((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1)
#define SORT(c) sort((c).begin(), (c).end())
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007; // 10^9+7
const LL INF2 = (LL)100000000000000000; // 10^18
int main() {
string s;
cin >> s;
int n = s.size();
int cnt = 0;
int ans = 0;
bool f = true;
for (int i = 0; i < n - 1; i++) {
for (int j = i + 1; j < n; j++) {
cnt = 0;
f = true;
for (int k = i; k < j + 1; k++) {
if (s[k] == 'A' || s[k] == 'C' || s[k] == 'G' || s[k] == 'T') {
cnt++;
} else {
f = false;
}
}
if (f == true) {
ans = max(ans, cnt);
}
}
}
cout << ans << endl;
return 0;
}
|
// include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// conversion
//------------------------------------------
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }
// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c) \
for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define EXISTch(s, c) \
((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1)
#define SORT(c) sort((c).begin(), (c).end())
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007; // 10^9+7
const LL INF2 = (LL)100000000000000000; // 10^18
int main() {
string s;
cin >> s;
int n = s.size();
int cnt = 0;
int ans = 0;
bool f = true;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n + 1; j++) {
cnt = 0;
f = true;
for (int k = i; k < j; k++) {
if (s[k] == 'A' || s[k] == 'C' || s[k] == 'G' || s[k] == 'T') {
cnt++;
} else {
f = false;
}
}
if (f == true) {
ans = max(ans, cnt);
}
}
}
cout << ans << endl;
return 0;
}
| [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove",
"misc.off_by_one"
] | 901,485 | 901,486 | u874996917 | cpp |
p03086 |
// include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// conversion
//------------------------------------------
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }
// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c) \
for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define EXISTch(s, c) \
((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1)
#define SORT(c) sort((c).begin(), (c).end())
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007; // 10^9+7
const LL INF2 = (LL)100000000000000000; // 10^18
int main() {
string s;
cin >> s;
int n = s.size();
int cnt = 0;
int ans = 0;
bool f = true;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
cnt = 0;
f = true;
for (int k = i; k < j + 1; k++) {
if (s[k] == 'A' || s[k] == 'C' || s[k] == 'G' || s[k] == 'T') {
cnt++;
} else {
f = false;
}
}
if (f == true) {
ans = max(ans, cnt);
}
}
}
cout << ans << endl;
return 0;
}
|
// include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// conversion
//------------------------------------------
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }
// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c) \
for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define EXISTch(s, c) \
((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1)
#define SORT(c) sort((c).begin(), (c).end())
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007; // 10^9+7
const LL INF2 = (LL)100000000000000000; // 10^18
int main() {
string s;
cin >> s;
int n = s.size();
int cnt = 0;
int ans = 0;
bool f = true;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n + 1; j++) {
cnt = 0;
f = true;
for (int k = i; k < j; k++) {
if (s[k] == 'A' || s[k] == 'C' || s[k] == 'G' || s[k] == 'T') {
cnt++;
} else {
f = false;
}
}
if (f == true) {
ans = max(ans, cnt);
}
}
}
cout << ans << endl;
return 0;
}
| [
"control_flow.loop.for.condition.change",
"misc.off_by_one",
"expression.operation.binary.remove"
] | 901,487 | 901,486 | u874996917 | cpp |
p03086 |
// include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// conversion
//------------------------------------------
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }
// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c) \
for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define EXISTch(s, c) \
((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1)
#define SORT(c) sort((c).begin(), (c).end())
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007; // 10^9+7
const LL INF2 = (LL)100000000000000000; // 10^18
int main() {
string s;
cin >> s;
int n = s.size();
int cnt = 0;
int ans = 0;
bool f = true;
for (int i = 0; i < n - 1; i++) {
for (int j = i + 1; j < n; j++) {
cnt = 0;
f = true;
for (int k = i; k < j + 1; k++) {
if (s[k] == 'A' || s[k] == 'C' || s[k] == 'G' || s[k] == 'T') {
cnt++;
} else {
f = false;
}
}
if (f == true) {
ans = max(ans, cnt);
}
}
}
cout << ans << endl;
return 0;
}
|
// include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// conversion
//------------------------------------------
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }
// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c) \
for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define EXISTch(s, c) \
((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1)
#define SORT(c) sort((c).begin(), (c).end())
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007; // 10^9+7
const LL INF2 = (LL)100000000000000000; // 10^18
int main() {
string s;
cin >> s;
int n = s.size();
int cnt = 0;
int ans = 0;
bool f = true;
for (int i = 0; i < n; i++) {
for (int j = i; j < n; j++) {
cnt = 0;
f = true;
for (int k = i; k < j + 1; k++) {
if (s[k] == 'A' || s[k] == 'C' || s[k] == 'G' || s[k] == 'T') {
cnt++;
} else {
f = false;
}
}
if (f == true) {
ans = max(ans, cnt);
}
}
}
cout << ans << endl;
return 0;
}
| [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove",
"control_flow.loop.for.initializer.change"
] | 901,485 | 901,488 | u874996917 | cpp |
p03086 |
// include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// conversion
//------------------------------------------
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }
// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c) \
for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define EXISTch(s, c) \
((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1)
#define SORT(c) sort((c).begin(), (c).end())
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007; // 10^9+7
const LL INF2 = (LL)100000000000000000; // 10^18
int main() {
string s;
cin >> s;
int n = s.size();
int cnt = 0;
int ans = 0;
bool f = true;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
cnt = 0;
f = true;
for (int k = i; k < j + 1; k++) {
if (s[k] == 'A' || s[k] == 'C' || s[k] == 'G' || s[k] == 'T') {
cnt++;
} else {
f = false;
}
}
if (f == true) {
ans = max(ans, cnt);
}
}
}
cout << ans << endl;
return 0;
}
|
// include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// conversion
//------------------------------------------
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }
// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c) \
for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define EXISTch(s, c) \
((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1)
#define SORT(c) sort((c).begin(), (c).end())
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007; // 10^9+7
const LL INF2 = (LL)100000000000000000; // 10^18
int main() {
string s;
cin >> s;
int n = s.size();
int cnt = 0;
int ans = 0;
bool f = true;
for (int i = 0; i < n; i++) {
for (int j = i; j < n; j++) {
cnt = 0;
f = true;
for (int k = i; k < j + 1; k++) {
if (s[k] == 'A' || s[k] == 'C' || s[k] == 'G' || s[k] == 'T') {
cnt++;
} else {
f = false;
}
}
if (f == true) {
ans = max(ans, cnt);
}
}
}
cout << ans << endl;
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove"
] | 901,487 | 901,488 | u874996917 | cpp |
p03086 |
// include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// conversion
//------------------------------------------
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }
// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c) \
for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define EXISTch(s, c) \
((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1)
#define SORT(c) sort((c).begin(), (c).end())
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007; // 10^9+7
const LL INF2 = (LL)100000000000000000; // 10^18
int main() {
string s;
cin >> s;
int n = s.size();
int cnt = 0;
int ans = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'A' && s[i] == 'C' && s[i] == 'G' && s[i] == 'T') {
cnt++;
ans = max(ans, cnt);
} else {
cnt = 0;
}
}
cout << ans << endl;
return 0;
}
|
// include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// conversion
//------------------------------------------
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }
// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c) \
for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define EXISTch(s, c) \
((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1)
#define SORT(c) sort((c).begin(), (c).end())
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007; // 10^9+7
const LL INF2 = (LL)100000000000000000; // 10^18
int main() {
string s;
cin >> s;
int n = s.size();
int cnt = 0;
int ans = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
cnt++;
ans = max(ans, cnt);
} else {
cnt = 0;
}
}
cout << ans << endl;
return 0;
}
| [
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 901,489 | 901,490 | u874996917 | cpp |
p03086 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
int main() {
string str;
cin >> str;
ll cnt = 0, ans = 0;
for (int i = 0; i < str.size(); i++) {
if (str[i] != 'A' && str[i] != 'C' && str[i] != 'G' && str[i] != 'T') {
ans = max(ans, cnt);
cnt = 0;
} else
cnt++;
}
cout << ans;
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
int main() {
string str;
cin >> str;
ll cnt = 0, ans = 0;
for (int i = 0; i < str.size(); i++) {
if (str[i] != 'A' && str[i] != 'C' && str[i] != 'G' && str[i] != 'T') {
ans = max(ans, cnt);
cnt = 0;
} else
cnt++;
}
cout << max(ans, cnt);
return 0;
} | [
"call.add",
"call.arguments.add"
] | 901,491 | 901,492 | u855186748 | cpp |
p03086 | #include <stdio.h>
#include <string.h>
int main() {
char s[10];
int i, j, n, max = 0;
if (scanf("%s", s) == 0)
return -1;
n = strlen(s);
for (i = 0; i < n; i++) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
for (j = i; j < n; j++) {
if (s[j] != 'A' && s[j] != 'C' && s[j] != 'G' && s[j] != 'T')
break;
}
if (max < (j - i))
max = j - i;
i = j + 1;
}
}
printf("%d", max);
return 0;
}
| #include <stdio.h>
#include <string.h>
int main() {
char s[10];
int i, j, n, max = 0;
if (scanf("%s", s) == 0)
return -1;
n = strlen(s);
for (i = 0; i < n; i++) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
for (j = i + 1; j < n; j++) {
if (s[j] != 'A' && s[j] != 'C' && s[j] != 'G' && s[j] != 'T')
break;
}
if (max < (j - i))
max = j - i;
i = j;
}
}
printf("%d", max);
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"assignment.change",
"expression.operation.binary.remove"
] | 901,507 | 901,508 | u737756998 | cpp |
p03086 | #include <stdio.h>
#include <string.h>
int main() {
char s[10];
int i, j, n, max = 0;
if (scanf("%s", s) == 0)
return -1;
n = strlen(s);
for (i = 0; i < n; i++) {
if (s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T') {
for (j = i; j < n; j++) {
if (s[j] != 'A' && s[j] != 'C' && s[j] != 'G' && s[j] != 'T')
break;
}
if (max < (j - i))
max = j - i;
i = j;
}
}
printf("%d", max);
return 0;
}
| #include <stdio.h>
#include <string.h>
int main() {
char s[10];
int i, j, n, max = 0;
if (scanf("%s", s) == 0)
return -1;
n = strlen(s);
for (i = 0; i < n; i++) {
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
for (j = i + 1; j < n; j++) {
if (s[j] != 'A' && s[j] != 'C' && s[j] != 'G' && s[j] != 'T')
break;
}
if (max < (j - i))
max = j - i;
i = j;
}
}
printf("%d", max);
return 0;
}
| [
"identifier.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.initializer.change",
"assignment.change"
] | 901,509 | 901,508 | u737756998 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
#define sc scanf
#define pr printf
int main() {
int maxi = 0;
int atual = 0;
char ch;
while (ch = getchar(), ch != '\n') {
if (ch == 'A' || ch == 'T' || ch == 'G' || ch == 'C')
atual++;
else {
maxi = max(maxi, atual);
atual = 0;
}
}
pr("%d\n", maxi);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define sc scanf
#define pr printf
int main() {
int maxi = 0;
int atual = 0;
char ch;
while (ch = getchar(), ch != EOF) {
if (ch == 'A' || ch == 'T' || ch == 'G' || ch == 'C')
atual++;
else {
maxi = max(maxi, atual);
atual = 0;
}
}
pr("%d\n", maxi);
return 0;
} | [
"control_flow.loop.condition.change"
] | 901,518 | 901,519 | u396427486 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int a = 0, b = 0;
for (int i = 0; i < S.size(); i++) {
if (S.at(i) == 'A' || S.at(i) == 'C' || S.at(i) == 'G' || S.at(i) == 'T')
a++;
else {
b = max(a, b);
a = 0;
}
}
cout << b << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int a = 0, b = 0;
for (int i = 0; i < S.size(); i++) {
if (S.at(i) == 'A' || S.at(i) == 'C' || S.at(i) == 'G' || S.at(i) == 'T') {
a++;
b = max(a, b);
} else
a = 0;
}
cout << b << endl;
} | [
"control_flow.branch.else.add"
] | 901,525 | 901,526 | u438481810 | cpp |
p03086 | #include <algorithm>
#include <iostream>
#include <string>
int main() {
std::string s;
std::cin >> s;
int length[20] = {};
int i = 0;
for (auto &e : s) {
if (e == 'A' || e == 'T' || e == 'G' || e == 'C')
length[i]++;
else
i++;
}
int max = 0;
for (int j = 0; j < i; j++) {
max = std::max(length[j], max);
}
std::cout << max << std::endl;
return 0;
} | #include <algorithm>
#include <iostream>
#include <string>
int main() {
std::string s;
std::cin >> s;
int length[20] = {};
int i = 0;
for (auto &e : s) {
if (e == 'A' || e == 'T' || e == 'G' || e == 'C')
length[i]++;
else
i++;
}
int max = 0;
for (int j = 0; j < 20; j++) {
max = std::max(length[j], max);
}
std::cout << max << std::endl;
return 0;
} | [
"identifier.replace.remove",
"literal.replace.add",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 901,531 | 901,532 | u060431747 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int cou = 0;
int ans = 0;
string T = "AGCT";
for (int i = 0; i < S.size(); i++) {
bool isAGCT = false;
for (int j = 0; j < 4; j++) {
if (S.at(i) == S.at(j))
isAGCT = true;
}
if (!isAGCT)
cou = 0;
else {
cou++;
ans = max(cou, ans);
}
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int cou = 0;
int ans = 0;
string T = "AGCT";
for (int i = 0; i < S.size(); i++) {
bool isAGCT = false;
for (int j = 0; j < 4; j++) {
if (S.at(i) == T.at(j))
isAGCT = true;
}
if (!isAGCT)
cou = 0;
else {
cou++;
ans = max(cou, ans);
}
}
cout << ans << endl;
} | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 901,565 | 901,566 | u222866518 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
int max = 0;
int i = 0;
for (char b : a) {
switch (b) {
case 'A':
case 'C':
case 'G':
case 'T':
i++;
break;
default:
if (max < i) {
max = i;
} else {
i = 0;
}
break;
}
}
if (max < i) {
max = i;
}
cout << max;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
int max = 0;
int i = 0;
for (char b : a) {
switch (b) {
case 'A':
case 'C':
case 'G':
case 'T':
i++;
break;
default:
if (max < i) {
max = i;
}
i = 0;
break;
}
}
if (max < i) {
max = i;
}
cout << max;
} | [] | 901,569 | 901,570 | u026284793 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
int max = 0;
int i = 0;
for (char b : a) {
switch (b) {
case 'A':
case 'C':
case 'G':
case 'T':
i++;
break;
default:
if (max < i) {
max = i;
} else {
i = 0;
}
break;
}
}
if (max == 0) {
max = i;
}
cout << max;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
int max = 0;
int i = 0;
for (char b : a) {
switch (b) {
case 'A':
case 'C':
case 'G':
case 'T':
i++;
break;
default:
if (max < i) {
max = i;
}
i = 0;
break;
}
}
if (max < i) {
max = i;
}
cout << max;
} | [] | 901,571 | 901,570 | u026284793 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
char S[10];
cin >> S;
int ACGT[strlen(S)] = {0};
int max = 0, count = 0;
for (int i = 0; i < strlen(S); ++i) {
if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') {
count++;
} else {
if (!count) {
continue;
} else {
ACGT[i] = count;
count = 0;
}
}
}
ACGT[strlen(S)] = count;
for (int i = 0; i < strlen(S); ++i) {
if (max < ACGT[i]) {
max = ACGT[i];
}
}
cout << max << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
char S[10];
cin >> S;
int ACGT[strlen(S) + 1] = {0};
int max = 0, count = 0;
for (int i = 0; i < strlen(S); ++i) {
if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') {
count++;
} else {
if (!count) {
continue;
} else {
ACGT[i] = count;
count = 0;
}
}
}
ACGT[strlen(S)] = count;
for (int i = 0; i <= strlen(S); ++i) {
if (max < ACGT[i]) {
max = ACGT[i];
}
}
cout << max << endl;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 901,587 | 901,588 | u593081125 | cpp |
p03086 | #include <stdio.h>
int main(void) {
char s[10 + 1];
scanf("%s", s);
int T = 0, t = 0;
for (char *p = s; *p; p++) {
switch (*p) {
case 'A':
case 'C':
case 'G':
case 'T':
t++;
break;
default:
if (t > T)
T = t;
t = 0;
break;
}
}
printf("%d\n", T);
return 0;
}
| #include <stdio.h>
int main(void) {
char s[10 + 1];
scanf("%s", s);
int T = 0, t = 0;
for (char *p = s; *p; p++) {
switch (*p) {
case 'A':
case 'C':
case 'G':
case 'T':
t++;
break;
default:
if (t > T)
T = t;
t = 0;
break;
}
}
printf("%d\n", t > T ? t : T);
return 0;
}
| [] | 901,591 | 901,592 | u375132909 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main(void) {
string s;
cin >> s;
int ret = 0;
for (int i = 0; i < s.size(); i++) {
for (int j = i + 1; j < s.size(); j++) {
int cnt = 0;
for (int k = i; k < j; k++) {
if (s[k] == 'A' || s[k] == 'G' || s[k] == 'T' || s[k] == 'C') {
cnt++;
} else
break;
}
ret = max(ret, cnt);
}
}
cout << ret << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main(void) {
string s;
cin >> s;
int ret = 0;
for (int i = 0; i < s.size(); i++) {
for (int j = i + 1; j <= s.size(); j++) {
int cnt = 0;
for (int k = i; k < j; k++) {
if (s[k] == 'A' || s[k] == 'G' || s[k] == 'T' || s[k] == 'C') {
cnt++;
} else
break;
}
ret = max(ret, cnt);
}
}
cout << ret << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 901,599 | 901,600 | u560301081 | cpp |
p03086 | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main() {
string a;
cin >> a;
bool count = false;
int ans = 0;
int ansm = 0;
rep(i, a.size()) {
if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {
count = true;
ans++;
ansm = max(ans, ans);
} else {
if (count) {
count = false;
ansm = max(ans, ansm);
ans = 0;
}
}
}
cout << ansm << endl;
}
| #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main() {
string a;
cin >> a;
bool count = false;
int ans = 0;
int ansm = 0;
rep(i, a.size()) {
if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {
count = true;
ans++;
ansm = max(ans, ansm);
} else {
if (count) {
count = false;
ansm = max(ans, ansm);
ans = 0;
}
}
}
cout << ansm << endl;
}
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 901,611 | 901,612 | u233626335 | cpp |
p03086 | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main() {
string a;
cin >> a;
bool count = false;
int ans = 0;
int ansm = 0;
rep(i, a.size()) {
if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {
count = true;
ans++;
ansm = ans;
} else {
if (count) {
count = false;
ansm = max(ans, ansm);
ans = 0;
}
}
}
cout << ansm << endl;
}
| #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main() {
string a;
cin >> a;
bool count = false;
int ans = 0;
int ansm = 0;
rep(i, a.size()) {
if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {
count = true;
ans++;
ansm = max(ans, ansm);
} else {
if (count) {
count = false;
ansm = max(ans, ansm);
ans = 0;
}
}
}
cout << ansm << endl;
}
| [
"call.add",
"call.arguments.add"
] | 901,613 | 901,612 | u233626335 | cpp |
p03086 | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
bool is_atgc(string s) {
for (int i = 0; i < s.size(); ++i) {
if (string("ATGC").find(s[i]) == string::npos) {
return false;
}
}
return true;
}
int main() {
string b;
cin >> b;
int ans = 0;
for (int i = 0; i < b.size(); ++i) {
for (int j = 0; j < i; ++j) {
if (is_atgc(b.substr(j, i - j + 1))) {
ans = max(ans, i - j + 1);
}
}
}
cout << ans << endl;
}
| #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
bool is_atgc(string s) {
for (int i = 0; i < s.size(); ++i) {
if (string("ATGC").find(s[i]) == string::npos) {
return false;
}
}
return true;
}
int main() {
string b;
cin >> b;
int ans = 0;
for (int i = 0; i < b.size(); ++i) {
for (int j = 0; j <= i; ++j) {
if (is_atgc(b.substr(j, i - j + 1))) {
ans = max(ans, i - j + 1);
}
}
}
cout << ans << endl;
}
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 901,618 | 901,619 | u187878098 | cpp |
p03086 | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
bool is_atgc(string s) {
for (int i = 0; i < s.size(); ++i) {
if (string("ATGC").find(s[i]) == string::npos) {
return false;
}
}
return true;
}
int main() {
string b;
cin >> b;
int ans = 0;
for (int i = 0; i < b.size(); ++i) {
for (int j = 0; j < i; ++j) {
if (is_atgc(b.substr(j, i - j))) {
ans = max(ans, i - j);
}
}
}
cout << ans << endl;
}
| #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
bool is_atgc(string s) {
for (int i = 0; i < s.size(); ++i) {
if (string("ATGC").find(s[i]) == string::npos) {
return false;
}
}
return true;
}
int main() {
string b;
cin >> b;
int ans = 0;
for (int i = 0; i < b.size(); ++i) {
for (int j = 0; j <= i; ++j) {
if (is_atgc(b.substr(j, i - j + 1))) {
ans = max(ans, i - j + 1);
}
}
}
cout << ans << endl;
}
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change",
"misc.off_by_one",
"assignment.change"
] | 901,620 | 901,619 | u187878098 | cpp |
p03086 | #include <iostream>
#include <string>
using namespace std;
bool isACGT(char c) { return c == 'A' || c == 'C' || c == 'G' || c == 'T'; }
int main() {
string s;
cin >> s;
int ans = 0;
int cnt = 0;
for (int i = 0; i < s.size(); i++) {
if (isACGT(s[i])) {
cnt++;
} else {
if (cnt > ans) {
ans = cnt;
}
cnt = 0;
}
}
cout << ans << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
bool isACGT(char c) { return c == 'A' || c == 'C' || c == 'G' || c == 'T'; }
int main() {
string s;
cin >> s;
int ans = 0;
int cnt = 0;
for (int i = 0; i < s.size(); i++) {
if (isACGT(s[i])) {
cnt++;
if (cnt > ans) {
ans = cnt;
}
} else {
cnt = 0;
}
}
cout << ans << endl;
return 0;
} | [
"control_flow.branch.else.add"
] | 901,627 | 901,628 | u419383010 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N = S.size();
vector<int> answer(N);
for (int i = 0; i < N; i++) {
if (S.at(i) == 'A' || S.at(i) == 'T' || S.at(i) == 'G' || S.at(i) == 'C') {
for (int j = i; j < N; j++) {
if (S.at(j) == 'A' || S.at(j) == 'T' || S.at(j) == 'G' ||
S.at(j) == 'C') {
answer.at(i)++;
}
else {
break;
}
}
}
}
sort(S.begin(), S.end());
cout << answer.at(N - 1) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N = S.size();
vector<int> answer(N);
for (int i = 0; i < N; i++) {
if (S.at(i) == 'A' || S.at(i) == 'T' || S.at(i) == 'G' || S.at(i) == 'C') {
for (int j = i; j < N; j++) {
if (S.at(j) == 'A' || S.at(j) == 'T' || S.at(j) == 'G' ||
S.at(j) == 'C') {
answer.at(i)++;
}
else {
break;
}
}
}
}
sort(answer.begin(), answer.end());
cout << answer.at(N - 1) << endl;
} | [
"identifier.change",
"call.arguments.change"
] | 901,629 | 901,630 | u578348620 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int l = 0, r = 0;
int ans = 0;
while (r >= s.size()) {
if (s[r] == 'A' || s[r] == 'C' || s[r] == 'G' || s[r] == 'T') {
r++;
ans = max(ans, r - l);
} else {
r++;
l = r;
}
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int l = 0, r = 0;
int ans = 0;
while (r < s.size()) {
if (s[r] == 'A' || s[r] == 'C' || s[r] == 'G' || s[r] == 'T') {
r++;
ans = max(ans, r - l);
} else {
r++;
l = r;
}
}
cout << ans << endl;
}
| [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 901,633 | 901,634 | u798086274 | cpp |
p03086 | /*why so serious?*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define fast() \
ios_base::sync_with_stdio(0); \
cin.tie(0)
#define all(x) x.begin(), x.end()
#define pb push_back
#define F first
#define S second
int32_t main() {
int n, i, j, cnt, f;
string s, str;
fast();
cin >> s;
n = s.length();
cnt = 0;
for (i = 0; i < n; ++i) {
for (j = i; j < n; ++j) {
str = s.substr(i, j - i);
// cout<<str<<"\n";
f = 1;
for (auto x : str) {
if (!((x == 'A') || (x == 'T') || (x == 'C') || (x == 'G'))) {
f = 0;
break;
}
}
if (f)
cnt = max(cnt, (int)str.length());
}
}
cout << cnt;
return 0;
}
| /*why so serious?*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define fast() \
ios_base::sync_with_stdio(0); \
cin.tie(0)
#define all(x) x.begin(), x.end()
#define pb push_back
#define F first
#define S second
int32_t main() {
int n, i, j, cnt, f;
string s, str;
fast();
cin >> s;
n = s.length();
cnt = 0;
for (i = 0; i < n; ++i) {
for (j = i; j < n; ++j) {
str = s.substr(i, j - i + 1);
// cout<<str<<"\n";
f = 1;
for (auto x : str) {
if ((x == 'A') || (x == 'T') || (x == 'C') || (x == 'G'))
;
else {
f = 0;
break;
}
}
if (f)
cnt = max(cnt, (int)str.length());
}
}
cout << cnt;
return 0;
} | [
"assignment.change",
"control_flow.loop.for.condition.change",
"control_flow.branch.if.condition.change",
"control_flow.branch.else_if.replace.remove",
"control_flow.branch.if.replace.add"
] | 901,648 | 901,649 | u579670739 | cpp |
p03086 | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
int main() {
string s;
cin >> s;
bool flag;
int ans = 0;
for (int len = 1; len <= s.length(); len++) {
for (int i = 0; i < s.length() - len; i++) {
flag = true;
string t = s.substr(i, len);
for (int j = 0; j < t.length(); j++) {
if (t[j] != 'A' && t[j] != 'C' && t[j] != 'G' && t[j] != 'T') {
flag = false;
break;
}
}
if (flag == true) {
ans = max(int(t.length()), ans);
}
}
}
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
int main() {
string s;
cin >> s;
bool flag;
int ans = 0;
for (int len = 1; len <= s.length(); len++) {
for (int i = 0; i < s.length() - len + 1; i++) {
flag = true;
string t = s.substr(i, len);
for (int j = 0; j < t.length(); j++) {
if (t[j] != 'A' && t[j] != 'C' && t[j] != 'G' && t[j] != 'T') {
flag = false;
break;
}
}
if (flag == true) {
ans = max(int(t.length()), ans);
}
}
}
cout << ans << endl;
return 0;
} | [
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 901,650 | 901,651 | u678503521 | cpp |
p03086 | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
int main() {
string s;
cin >> s;
bool flag;
int ans = 0;
for (int len = 1; len < s.length(); len++) {
for (int i = 0; i < s.length() - len; i++) {
flag = true;
string t = s.substr(i, len);
for (int j = 0; j < t.length(); j++) {
if (t[j] != 'A' && t[j] != 'C' && t[j] != 'G' && t[j] != 'T') {
flag = false;
break;
}
}
if (flag == true) {
ans = max(int(t.length()), ans);
}
}
}
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
int main() {
string s;
cin >> s;
bool flag;
int ans = 0;
for (int len = 1; len <= s.length(); len++) {
for (int i = 0; i < s.length() - len + 1; i++) {
flag = true;
string t = s.substr(i, len);
for (int j = 0; j < t.length(); j++) {
if (t[j] != 'A' && t[j] != 'C' && t[j] != 'G' && t[j] != 'T') {
flag = false;
break;
}
}
if (flag == true) {
ans = max(int(t.length()), ans);
}
}
}
cout << ans << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"misc.off_by_one"
] | 901,652 | 901,651 | u678503521 | cpp |
p03086 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ALL(A) A.begin(), A.end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
string S;
cin >> S;
int n = (int)S.length();
int res = 0;
rep(i, n) {
for (int j = i + 1; j < n; ++j) {
string curr = S.substr(i, j - i + 1);
// cerr << "curr: " << curr << endl;
int m = (int)curr.length();
bool ok = true;
rep(k, m) {
if (curr[k] == 'A' || curr[k] == 'C' || curr[k] == 'G' ||
curr[k] == 'T') {
ok &= true;
} else {
ok = false;
} // end if
} // end rep
if (ok) {
if (res < m) {
// cerr << "curr: " << curr <<
//endl;
res = m;
} // end if
} // end if
} // end for
} // end rep
cout << res << endl;
return 0;
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ALL(A) A.begin(), A.end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
string S;
cin >> S;
int n = (int)S.length();
int res = 0;
rep(i, n) {
for (int j = i; j < n; ++j) {
string curr = S.substr(i, j - i + 1);
// cerr << "curr: " << curr << endl;
int m = (int)curr.length();
bool ok = true;
rep(k, m) {
if (curr[k] == 'A' || curr[k] == 'C' || curr[k] == 'G' ||
curr[k] == 'T') {
ok &= true;
} else {
ok = false;
} // end if
} // end rep
if (ok) {
if (res < m) {
// cerr << "curr: " << curr <<
//endl;
res = m;
} // end if
} // end if
} // end for
} // end rep
cout << res << endl;
return 0;
} | [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove"
] | 901,661 | 901,662 | u635277286 | cpp |
p03086 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ALL(A) A.begin(), A.end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
string S;
cin >> S;
int n = (int)S.length();
int res = 0;
rep(i, n) {
for (int j = i + 1; j < n; ++j) {
string curr = S.substr(i, j - i);
int m = (int)curr.length();
bool ok = true;
rep(k, m) {
if (curr[k] == 'A' || curr[k] == 'C' || curr[k] == 'G' ||
curr[k] == 'T') {
ok &= true;
} else {
ok = false;
} // end if
} // end rep
if (ok) {
if (res < m) {
// cerr << "curr: " << curr <<
//endl;
res = m;
} // end if
} // end if
} // end for
} // end rep
cout << res << endl;
return 0;
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ALL(A) A.begin(), A.end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
string S;
cin >> S;
int n = (int)S.length();
int res = 0;
rep(i, n) {
for (int j = i; j < n; ++j) {
string curr = S.substr(i, j - i + 1);
// cerr << "curr: " << curr << endl;
int m = (int)curr.length();
bool ok = true;
rep(k, m) {
if (curr[k] == 'A' || curr[k] == 'C' || curr[k] == 'G' ||
curr[k] == 'T') {
ok &= true;
} else {
ok = false;
} // end if
} // end rep
if (ok) {
if (res < m) {
// cerr << "curr: " << curr <<
//endl;
res = m;
} // end if
} // end if
} // end for
} // end rep
cout << res << endl;
return 0;
} | [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove"
] | 901,663 | 901,662 | u635277286 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main(void) {
string s;
vector<int> count(10);
cin >> s;
for (int i = 0; i < s.size(); i++) {
for (int j = 0; j < s.size() - i; j++) {
if (s[i + j] == 'A' || s[i + j] == 'G' || s[i + j] == 'T' ||
s[i + j] == 'C')
count[i]++;
}
}
sort(count.begin(), count.end());
reverse(count.begin(), count.end());
cout << count[0] << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main(void) {
string s;
vector<int> count(10);
cin >> s;
for (int i = 0; i < s.size(); i++) {
for (int j = 0; j < s.size(); j++) {
if (s[i + j] == 'A' || s[i + j] == 'G' || s[i + j] == 'T' ||
s[i + j] == 'C')
count[i]++;
else
break;
}
}
sort(count.begin(), count.end());
reverse(count.begin(), count.end());
cout << count[0] << endl;
}
| [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove",
"control_flow.branch.else_if.replace.remove",
"control_flow.branch.if.replace.add"
] | 901,664 | 901,665 | u616029737 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
#define maxn 200005
int main() {
string a;
cin >> a;
int ml = 0, k = 0, l = 0;
while (l < a.size()) {
if (a[l] == 'A' || a[l] == 'T' || a[l] == 'C' || a[l] == 'T') {
l++, k++;
ml = max(ml, k);
} else
k = 0, l++;
}
printf("%d\n", ml);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define maxn 200005
int main() {
string a;
cin >> a;
int ml = 0, k = 0, l = 0;
while (l < a.size()) {
if (a[l] == 'A' || a[l] == 'T' || a[l] == 'C' || a[l] == 'G') {
l++, k++;
ml = max(ml, k);
} else
k = 0, l++;
}
printf("%d\n", ml);
return 0;
}
| [
"literal.string.change",
"control_flow.branch.if.condition.change"
] | 901,672 | 901,673 | u820628270 | cpp |
p03086 | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout << #X << ": " << X << " ";
#define ARDEB(i, X) cout << #X << "[" << i << "]: " << X[i] << " ";
#define END cout << endl;
#else
#define DEB(X) \
{}
#define ARDEB(i, X) \
{}
#define END \
{}
#endif
typedef long long int ll;
#define int long long
typedef pair<int, int> P;
struct edge {
int to, cost;
};
#define REP(i, n) for (int i = 0; i < (n); i++)
const int INF = 100000000000000000;
signed main() {
int ans = 0;
string S;
cin >> S;
for (int i = 0; i < S.size(); i++) {
for (int j = 1; i + j < S.size(); j++) {
string sub = S.substr(i, j);
DEB(sub) END bool flag = true;
REP(k, sub.size()) {
if (sub[k] != 'A' && sub[k] != 'G' && sub[k] != 'C' && sub[k] != 'T') {
flag = false;
break;
}
}
if (flag == false) {
break;
}
ans = max(ans, (int)sub.size());
}
}
cout << ans << endl;
return 0;
}
| #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout << #X << ": " << X << " ";
#define ARDEB(i, X) cout << #X << "[" << i << "]: " << X[i] << " ";
#define END cout << endl;
#else
#define DEB(X) \
{}
#define ARDEB(i, X) \
{}
#define END \
{}
#endif
typedef long long int ll;
#define int long long
typedef pair<int, int> P;
struct edge {
int to, cost;
};
#define REP(i, n) for (int i = 0; i < (n); i++)
const int INF = 100000000000000000;
signed main() {
int ans = 0;
string S;
cin >> S;
for (int i = 0; i < S.size(); i++) {
for (int j = 1; i + j <= S.size(); j++) {
string sub = S.substr(i, j);
DEB(sub) END bool flag = true;
REP(k, sub.size()) {
if (sub[k] != 'A' && sub[k] != 'G' && sub[k] != 'C' && sub[k] != 'T') {
flag = false;
break;
}
}
if (flag == false) {
break;
}
ans = max(ans, (int)sub.size());
}
}
cout << ans << endl;
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 901,676 | 901,677 | u848736574 | cpp |
p03086 | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
std::string s;
int ans;
int judge(int x, int y) {
for (int i = x; i <= y; ++i)
if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')
return 0;
return 1;
}
int main() {
std::ios::sync_with_stdio(0);
std::cin.tie(0);
std::cin >> s;
for (int i = 0; i < s.size(); ++i)
for (int j = i + 1; j < s.size(); ++j)
if (judge(i, j))
ans = std::max(ans, j - i + 1);
std::cout << ans << "\n";
return 0;
} | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
std::string s;
int ans;
int judge(int x, int y) {
for (int i = x; i <= y; ++i)
if (s[i] != 'A' && s[i] != 'T' && s[i] != 'C' && s[i] != 'G')
return 0;
return 1;
}
int main() {
std::ios::sync_with_stdio(0);
std::cin.tie(0);
std::cin >> s;
for (int i = 0; i < s.size(); ++i)
for (int j = i; j < s.size(); ++j)
if (judge(i, j))
ans = std::max(ans, j - i + 1);
std::cout << ans << "\n";
return 0;
} | [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove"
] | 901,684 | 901,685 | u240904580 | cpp |
p03086 | #include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define bogo_sort std::sort
#define bozo_sort std::stable_sort
#define alles(obj) obj.begin(), obj.end()
#define elif else if
#define unless(flg) if (!(flg))
#define elless(flg) else if (!(flg))
#define echo std::cout <<
#define read std::cin >>
#define endl std::endl
#define fin << '\n'
#define bash push_back
#define fish push_front
#define makePair std::make_pair
#define _ << ' ' <<
// type-define
#define Stack std::stack
#define Queue std::queue
#define Deque std::deque
#define PQueue std::priority_queue
#define Set std::set
#define Vector std::vector
#define Pair std::pair
#define Map std::map
#define HashMap std::unordered_map
#define Greater std::greater
using String = std::string;
using llong = long long;
using boolean = bool;
using Pii = Pair<int, int>;
using Vi = Vector<int>;
using Vii = Vector<Pii>;
// utils
constexpr int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr llong LINF = 0x3f3f3f3f3f3f3f3fLL;
namespace {
template <class A, class B, class C> A power(A x, B n, C mod) {
llong ans = 1;
while (n > 0) {
if (n & 1)
ans = (ans * x) % mod;
x = (x * x) % mod;
n >>= 1;
}
return ans;
}
template <class A, class B> A power(A x, B n) {
return power(x, n, 1000000007);
}
template <class A> A gcd(A x, A y) { return x % y ? gcd(y, x % y) : y; }
template <class A> A lcm(A x, A y) { return (x / gcd(x, y) * y); }
template <class A> inline A abs(A n) { return (n < 0) ? -n : n; }
template <class A> inline boolean chmax(A &a, const A &b) {
return b > a ? a = b, true : false;
}
template <class A> inline boolean chmin(A &a, const A &b) {
return b < a ? a = b, true : false;
}
inline boolean isMovable(int x, int y, int w, int h) {
return (x >= 0 && y >= 0 && x < w && y < h);
}
} // namespace
namespace Rlyeh {
bool check(char s) {
if (s == 'A' || s == 'T' || s == 'C' || s == 'G')
return false;
return true;
}
int ans = 0;
signed call_of_Cthulhu(signed datum) {
String s;
read s;
for (int i = 0; i < s.size(); i++) {
for (int j = i + 1; j < s.size(); j++) {
bool flg = true;
for (int k = i; k < j; k++) {
if (check(s[k])) {
flg = false;
}
}
if (flg) {
chmax(ans, j - i);
}
}
}
echo ans fin;
return 0;
}
} // namespace Rlyeh
signed main() {
std::cin.tie(0);
std::ios::sync_with_stdio(false);
int main_result = Rlyeh::call_of_Cthulhu(114514);
return 0;
}
| #include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define bogo_sort std::sort
#define bozo_sort std::stable_sort
#define alles(obj) obj.begin(), obj.end()
#define elif else if
#define unless(flg) if (!(flg))
#define elless(flg) else if (!(flg))
#define echo std::cout <<
#define read std::cin >>
#define endl std::endl
#define fin << '\n'
#define bash push_back
#define fish push_front
#define makePair std::make_pair
#define _ << ' ' <<
// type-define
#define Stack std::stack
#define Queue std::queue
#define Deque std::deque
#define PQueue std::priority_queue
#define Set std::set
#define Vector std::vector
#define Pair std::pair
#define Map std::map
#define HashMap std::unordered_map
#define Greater std::greater
using String = std::string;
using llong = long long;
using boolean = bool;
using Pii = Pair<int, int>;
using Vi = Vector<int>;
using Vii = Vector<Pii>;
// utils
constexpr int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr llong LINF = 0x3f3f3f3f3f3f3f3fLL;
namespace {
template <class A, class B, class C> A power(A x, B n, C mod) {
llong ans = 1;
while (n > 0) {
if (n & 1)
ans = (ans * x) % mod;
x = (x * x) % mod;
n >>= 1;
}
return ans;
}
template <class A, class B> A power(A x, B n) {
return power(x, n, 1000000007);
}
template <class A> A gcd(A x, A y) { return x % y ? gcd(y, x % y) : y; }
template <class A> A lcm(A x, A y) { return (x / gcd(x, y) * y); }
template <class A> inline A abs(A n) { return (n < 0) ? -n : n; }
template <class A> inline boolean chmax(A &a, const A &b) {
return b > a ? a = b, true : false;
}
template <class A> inline boolean chmin(A &a, const A &b) {
return b < a ? a = b, true : false;
}
inline boolean isMovable(int x, int y, int w, int h) {
return (x >= 0 && y >= 0 && x < w && y < h);
}
} // namespace
namespace Rlyeh {
bool check(char s) {
if (s == 'A' || s == 'T' || s == 'C' || s == 'G')
return false;
return true;
}
int ans = 0;
signed call_of_Cthulhu(signed datum) {
String s;
read s;
for (int i = 0; i < s.size(); i++) {
for (int j = i + 1; j <= s.size(); j++) {
bool flg = true;
for (int k = i; k < j; k++) {
if (check(s[k])) {
flg = false;
}
}
if (flg) {
chmax(ans, j - i);
}
}
}
echo ans fin;
return 0;
}
} // namespace Rlyeh
signed main() {
std::cin.tie(0);
std::ios::sync_with_stdio(false);
int main_result = Rlyeh::call_of_Cthulhu(114514);
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 901,690 | 901,691 | u437622890 | cpp |
p03086 | #include <bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define RREP(i, n) for (int(i) = (n)-1; (i) >= 0; (i)--)
#define ios() cin.tie(0), ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
ll const MOD = 1e9 + 7;
ll const INF = 1e18;
using namespace std;
int main() {
vector<char> v = {'A', 'T', 'G', 'C'};
string s;
cin >> s;
int ans = 0;
REP(i, s.length()) {
for (int j = i; j < s.length(); j++) {
string t = s.substr(i, j - i);
bool flag = true;
REP(k, t.length()) {
if (find(all(v), t[k]) == v.end()) {
flag = false;
break;
}
}
if (flag) {
ans = max(ans, (int)t.length());
}
}
}
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define RREP(i, n) for (int(i) = (n)-1; (i) >= 0; (i)--)
#define ios() cin.tie(0), ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
ll const MOD = 1e9 + 7;
ll const INF = 1e18;
using namespace std;
int main() {
vector<char> v = {'A', 'T', 'G', 'C'};
string s;
cin >> s;
int ans = 0;
REP(i, s.length()) {
for (int j = i; j < s.length(); j++) {
string t = s.substr(i, j - i + 1);
// cout << t << endl;
bool flag = true;
REP(k, t.length()) {
if (find(all(v), t[k]) == v.end()) {
flag = false;
break;
}
}
if (flag) {
ans = max(ans, (int)t.length());
}
}
}
cout << ans << endl;
return 0;
} | [
"assignment.change"
] | 901,692 | 901,693 | u994831328 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N;
N = S.size();
int num[N];
for (int i = 0; i < N; i++) {
if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') {
num[i] = 1;
} else {
num[i] = 0;
}
}
int cnt = 0;
for (int i = 0; i < N; i++) {
int temp = 0;
for (int j = i; j < N; j++) {
if (S[j] == 1)
temp++;
else
break;
}
cnt = max(cnt, temp);
}
cout << cnt << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N;
N = S.size();
int num[N];
for (int i = 0; i < N; i++) {
if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') {
num[i] = 1;
} else {
num[i] = 0;
}
}
int cnt = 0;
for (int i = 0; i < N; i++) {
int temp = 0;
for (int j = i; j < N; j++) {
if (num[j] == 1)
temp++;
else
break;
}
cnt = max(cnt, temp);
}
cout << cnt << endl;
} | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 901,696 | 901,697 | u618395292 | cpp |
p03086 | #ifdef DEBUG_IS_VALID
#define DEB 1
#define _LIBCPP_DEBUG 0
#else
#define DEB 0
#define NDEBUG
#endif
#include "bits/stdc++.h"
#define ALL(g) (g).begin(), (g).end()
#define REP(i, x, n) for (int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define RREP(i, x, n) for (int i = x; i >= n; i--)
#define rrep(i, n) RREP(i, n, 0)
#define pb push_back
#pragma GCC optimize("-O3")
using namespace std;
#define DUMPOUT cout
#define dump(...) \
if (DEB) \
DUMPOUT << " " << #__VA_ARGS__ << " :[" << __LINE__ << ":" \
<< __FUNCTION__ << "]" << endl \
<< " "; \
if (DEB) \
dump_func(__VA_ARGS__)
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
cout << "(" << p.first << ", " << p.second << ")";
return os;
}
template <typename T> ostream &operator<<(ostream &os, vector<T> &vec) {
os << "{";
for (int i = 0; i < vec.size(); i++)
os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
os << "}";
return os;
}
template <typename T> ostream &operator<<(ostream &os, set<T> &st) {
cout << "{";
for (auto itr = st.begin(); itr != st.end(); itr++)
cout << *itr << (next(itr) != st.end() ? ", " : "");
cout << "}";
return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, map<T1, T2> mp) {
cout << "{";
for (auto itr = mp.begin(); itr != mp.end(); itr++)
cout << "(" << (itr->first) << ", " << (itr->second) << ")"
<< (next(itr) != mp.end() ? "," : "");
cout << "}";
return os;
}
void dump_func() { DUMPOUT << endl; }
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&...tail) {
DUMPOUT << head;
if (sizeof...(Tail) == 0) {
DUMPOUT << " ";
} else {
DUMPOUT << ", ";
}
dump_func(std::move(tail)...);
}
template <class T> inline bool chmax(T &a, T const &b) {
if (a >= b)
return false;
a = b;
return true;
}
template <class T> inline bool chmin(T &a, T const &b) {
if (a <= b)
return false;
a = b;
return true;
}
void _main();
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
_main();
return 0;
}
using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
const int mod = 1e9 + 7, INF = 1 << 29;
const double EPS = 1e-5, PI = 3.1415926535897932384626;
const ll lmod = 1e9 + 7, LINF = 1LL << 59;
void _main() {
string s;
cin >> s;
int N = s.size();
string x = "ACGT";
ll ans = 0;
rep(i, N - 1) REP(j, i + 1, N) {
string a = "";
bool ok = true;
REP(k, i, j + 1) {
ok &= (s[k] == 'A' || s[k] == 'C' || s[k] == 'G' || s[k] == 'T');
if (!ok)
break;
a += s[k];
}
if (!ok)
continue;
chmax(ans, ll(a.size()));
}
cout << ans << endl;
} | #ifdef DEBUG_IS_VALID
#define DEB 1
#define _LIBCPP_DEBUG 0
#else
#define DEB 0
#define NDEBUG
#endif
#include "bits/stdc++.h"
#define ALL(g) (g).begin(), (g).end()
#define REP(i, x, n) for (int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define RREP(i, x, n) for (int i = x; i >= n; i--)
#define rrep(i, n) RREP(i, n, 0)
#define pb push_back
#pragma GCC optimize("-O3")
using namespace std;
#define DUMPOUT cout
#define dump(...) \
if (DEB) \
DUMPOUT << " " << #__VA_ARGS__ << " :[" << __LINE__ << ":" \
<< __FUNCTION__ << "]" << endl \
<< " "; \
if (DEB) \
dump_func(__VA_ARGS__)
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
cout << "(" << p.first << ", " << p.second << ")";
return os;
}
template <typename T> ostream &operator<<(ostream &os, vector<T> &vec) {
os << "{";
for (int i = 0; i < vec.size(); i++)
os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
os << "}";
return os;
}
template <typename T> ostream &operator<<(ostream &os, set<T> &st) {
cout << "{";
for (auto itr = st.begin(); itr != st.end(); itr++)
cout << *itr << (next(itr) != st.end() ? ", " : "");
cout << "}";
return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, map<T1, T2> mp) {
cout << "{";
for (auto itr = mp.begin(); itr != mp.end(); itr++)
cout << "(" << (itr->first) << ", " << (itr->second) << ")"
<< (next(itr) != mp.end() ? "," : "");
cout << "}";
return os;
}
void dump_func() { DUMPOUT << endl; }
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&...tail) {
DUMPOUT << head;
if (sizeof...(Tail) == 0) {
DUMPOUT << " ";
} else {
DUMPOUT << ", ";
}
dump_func(std::move(tail)...);
}
template <class T> inline bool chmax(T &a, T const &b) {
if (a >= b)
return false;
a = b;
return true;
}
template <class T> inline bool chmin(T &a, T const &b) {
if (a <= b)
return false;
a = b;
return true;
}
void _main();
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
_main();
return 0;
}
using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
const int mod = 1e9 + 7, INF = 1 << 29;
const double EPS = 1e-5, PI = 3.1415926535897932384626;
const ll lmod = 1e9 + 7, LINF = 1LL << 59;
void _main() {
string s;
cin >> s;
int N = s.size();
string x = "ACGT";
ll ans = 0;
rep(i, N) REP(j, i, N) {
string a = "";
bool ok = true;
REP(k, i, j + 1) {
ok &= (s[k] == 'A' || s[k] == 'C' || s[k] == 'G' || s[k] == 'T');
if (!ok)
break;
a += s[k];
}
if (!ok)
continue;
chmax(ans, ll(a.size()));
}
cout << ans << endl;
} | [
"expression.operation.binary.remove"
] | 901,698 | 901,699 | u584355711 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int maxLen = 0;
for (int i = 0; i < s.size() - 1; i++) {
int j = 0;
while (i + j < s.size()) {
if (s[i + j] == 'A' || s[i + j] == 'C' || s[i + j] == 'G' ||
s[i + j] == 'T') {
j++;
} else {
break;
}
}
maxLen = max(maxLen, j);
}
cout << maxLen << "\n";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int maxLen = 0;
for (int i = 0; i < s.size(); i++) {
int j = 0;
while (i + j < s.size()) {
if (s[i + j] == 'A' || s[i + j] == 'C' || s[i + j] == 'G' ||
s[i + j] == 'T') {
j++;
} else {
break;
}
}
maxLen = max(maxLen, j);
}
cout << maxLen << "\n";
} | [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 901,710 | 901,711 | u422029490 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0;
int cnt = 0;
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') {
cnt++;
} else {
ans = max(ans, cnt);
}
}
ans = max(ans, cnt);
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0;
int cnt = 0;
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') {
cnt++;
} else {
ans = max(ans, cnt);
cnt = 0;
}
}
ans = max(ans, cnt);
cout << ans << endl;
} | [
"assignment.add"
] | 901,716 | 901,717 | u210718367 | cpp |
p03086 | #include <algorithm>
#include <array>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
int main(int argc, char const *argv[]) {
string s;
cin >> s;
ll ans = 0;
for (ll i = 0; i < s.size() - 1; i++) {
ll temp = 0;
for (ll k = i; k < s.size(); k++) {
if (s[k] == 'A' || s[k] == 'T' || s[k] == 'G' || s[k] == 'C') {
temp++;
} else {
break;
}
}
ans = max(ans, temp);
}
cout << ans << endl;
}
| #include <algorithm>
#include <array>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
int main(int argc, char const *argv[]) {
string s;
cin >> s;
ll ans = 0;
for (ll i = 0; i < s.size(); i++) {
ll temp = 0;
for (ll k = i; k < s.size(); k++) {
if (s[k] == 'A' || s[k] == 'T' || s[k] == 'G' || s[k] == 'C') {
temp++;
} else {
break;
}
}
ans = max(ans, temp);
}
cout << ans << endl;
} | [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 901,722 | 901,723 | u324139341 | cpp |
p03086 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
string ans = "", sum;
for (int i = 0; i < s.size(); i++) {
if (s.at(i) == 'A' || s.at(i) == 'T' || s.at(i) == 'G' || s.at(i) == 'C') {
sum += s.at(i);
if (sum.size() > ans.size()) {
ans = sum;
}
} else {
sum = "";
}
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
string ans = "", sum;
for (int i = 0; i < s.size(); i++) {
if (s.at(i) == 'A' || s.at(i) == 'T' || s.at(i) == 'G' || s.at(i) == 'C') {
sum += s.at(i);
if (sum.size() > ans.size()) {
ans = sum;
}
} else {
sum = "";
}
}
cout << ans.size() << endl;
} | [
"call.add"
] | 901,724 | 901,725 | u317711717 | cpp |
p03086 | //#include "pch.h"
#include <algorithm>
#include <atomic>
#include <cmath>
#include <future>
#include <iomanip>
#include <iostream>
#include <map>
#include <mutex>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <thread>
#include <time.h>
#include <vector>
#define double long double
#define int long long
#define low lower_bound
#define upp upper_bound
#define mod 1e9 + 7
#define inf 1e16
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define vsort(vec) sort(all(vec))
#define vrever(vec) reverse(all(vec));
#define vunsort(vec) \
vsort(vec); \
vrever(vec);
#define bisea binary_search
using namespace std;
signed main() {
string s;
cin >> s;
int n = s.size();
int ans = 0;
rep(i, n) {
for (int j = 1; j <= n - i - 1; j++) {
string a = s.substr(i, j);
int m = a.size();
bool can = true;
rep(k, m) {
if (a[k] == 'A' || a[k] == 'C' || a[k] == 'G' || a[k] == 'T') {
continue;
}
can = false;
}
if (can) {
ans = max(ans, j);
}
}
}
cout << ans << endl;
} | //#include "pch.h"
#include <algorithm>
#include <atomic>
#include <cmath>
#include <future>
#include <iomanip>
#include <iostream>
#include <map>
#include <mutex>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <thread>
#include <time.h>
#include <vector>
#define double long double
#define int long long
#define low lower_bound
#define upp upper_bound
#define mod 1e9 + 7
#define inf 1e16
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define vsort(vec) sort(all(vec))
#define vrever(vec) reverse(all(vec));
#define vunsort(vec) \
vsort(vec); \
vrever(vec);
#define bisea binary_search
using namespace std;
signed main() {
string s;
cin >> s;
int n = s.size();
int ans = 0;
rep(i, n) {
for (int j = 1; j <= n - i; j++) {
string a = s.substr(i, j);
int m = a.size();
bool can = true;
rep(k, m) {
if (a[k] == 'A' || a[k] == 'C' || a[k] == 'G' || a[k] == 'T') {
continue;
}
can = false;
}
if (can) {
ans = max(ans, j);
}
}
}
cout << ans << endl;
} | [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 901,726 | 901,727 | u054475353 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.