Datasets:

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 <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int count = 0; int maxz = 0; for (int i = 0; i <= s.size(); i++) { if (s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C') { count++; } else { if (count >= maxz) { maxz = count; } } } cout << maxz << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int count = 0; int maxz = 0; for (int i = 0; i <= s.size(); i++) { if (s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C') { count++; } else { if (count >= maxz) { maxz = count; } count = 0; } } cout << maxz << endl; }
[ "assignment.add" ]
899,797
899,798
u935370883
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int count = 0; int maxz = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C') { count++; } else { if (count >= maxz) { maxz = count; } } } cout << maxz << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int count = 0; int maxz = 0; for (int i = 0; i <= s.size(); i++) { if (s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C') { count++; } else { if (count >= maxz) { maxz = count; } count = 0; } } cout << maxz << endl; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change", "assignment.add" ]
899,799
899,798
u935370883
cpp
p03086
#include <bits/stdc++.h> using ll = long long; using namespace std; using Graph = vector<vector<ll>>; int main() { string s; cin >> s; int ans = -1; for (int left = 0; left < s.size(); left++) { for (int right = left; right < s.size(); right++) { char c = s.at(right); if (c == 'A' || c == 'C' || c == 'G' || c == 'T') { if (right == s.size() - 1) { ans = max(ans, right - left); } continue; } else { ans = max(ans, right - left); // left = right; break; } } } cout << ans << endl; }
#include <bits/stdc++.h> using ll = long long; using namespace std; using Graph = vector<vector<ll>>; int main() { string s; cin >> s; int ans = -1; for (int left = 0; left < s.size(); left++) { for (int right = left; right < s.size(); right++) { char c = s.at(right); if (c == 'A' || c == 'C' || c == 'G' || c == 'T') { if (right == s.size() - 1) { ans = max(ans, right - left + 1); } continue; } else { ans = max(ans, right - left); left = right; break; } } } cout << ans << endl; }
[ "assignment.change", "assignment.add" ]
899,805
899,806
u830087664
cpp
p03086
#include <bits/stdc++.h> using ll = long long; using namespace std; using Graph = vector<vector<ll>>; int main() { string s; cin >> s; int ans = -1; for (int left = 0; left < s.size(); left++) { for (int right = left; right < s.size(); right++) { char c = s.at(right); if (c == 'A' || c == 'C' || c == 'G' || c == 'T') { if (right == s.size() - 1) { ans = max(ans, right - left); } continue; } else { ans = max(ans, right - left); left = right; break; } } } cout << ans << endl; }
#include <bits/stdc++.h> using ll = long long; using namespace std; using Graph = vector<vector<ll>>; int main() { string s; cin >> s; int ans = -1; for (int left = 0; left < s.size(); left++) { for (int right = left; right < s.size(); right++) { char c = s.at(right); if (c == 'A' || c == 'C' || c == 'G' || c == 'T') { if (right == s.size() - 1) { ans = max(ans, right - left + 1); } continue; } else { ans = max(ans, right - left); left = right; break; } } } cout << ans << endl; }
[ "assignment.change" ]
899,807
899,806
u830087664
cpp
p03086
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <ctype.h> #include <deque> // deque #include <iomanip> #include <iostream> // cout, endl, cin #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <string> // string, to_string, stoi #include <tuple> // tuple, make_tuple #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <utility> // pair, make_pair #include <vector> // vector using namespace std; using ll = long long; #define rep(i, N) for (int i = 0; i < (int)N; ++i) ll GCD(ll x, ll y) { if (y == 0) return x; else return GCD(y, x % y); } ll LCM(ll x, ll y) { return x / GCD(x, y) * y; } bool my_compare(pair<string, int> a, pair<string, int> b) { if (a.first != b.first) { return a.first < b.first; } if (a.second != b.second) { return a.second > b.second; } else { return true; } } int main() { string S; cin >> S; int N = S.size(); deque<char> deq; int M = 0; int k; rep(i, N) { if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') { deq.push_back(S[i]); } else { k = deq.size(); M = max(M, k); deq.clear(); } } cout << M << endl; }
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <ctype.h> #include <deque> // deque #include <iomanip> #include <iostream> // cout, endl, cin #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <string> // string, to_string, stoi #include <tuple> // tuple, make_tuple #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <utility> // pair, make_pair #include <vector> // vector using namespace std; using ll = long long; #define rep(i, N) for (int i = 0; i < (int)N; ++i) ll GCD(ll x, ll y) { if (y == 0) return x; else return GCD(y, x % y); } ll LCM(ll x, ll y) { return x / GCD(x, y) * y; } bool my_compare(pair<string, int> a, pair<string, int> b) { if (a.first != b.first) { return a.first < b.first; } if (a.second != b.second) { return a.second > b.second; } else { return true; } } int main() { string S; cin >> S; int N = S.size(); deque<char> deq; int M = 0; int k; rep(i, N) { if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') { deq.push_back(S[i]); k = deq.size(); M = max(M, k); } else { deq.clear(); } } cout << M << endl; }
[ "control_flow.branch.else.add" ]
899,814
899,815
u368324062
cpp
p03086
#include <bits/stdc++.h> using namespace std; using ll = long long; typedef pair<int, int> P; ll Mod = 1000000007; int main() { string S; cin >> S; int ans = 0; for (int i = 0; i <= S.size(); i++) { for (int j = 0; j <= S.size() - i; j++) { string str = S.substr(i, S.size() - i - j); bool Yes = true; for (int k = 0; k < str.size(); k++) { if (str[k] != 'A' || str[k] != 'C' || str[k] != 'G' || str[k] != 'T') { Yes = false; } } if (Yes) { ans = max(ans, (int)(str.length())); } } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; typedef pair<int, int> P; ll Mod = 1000000007; int main() { string S; cin >> S; int ans = 0; for (int i = 0; i <= S.size(); i++) { for (int j = 0; j <= S.size() - i; j++) { string str = S.substr(i, S.size() - i - j); bool Yes = true; for (int k = 0; k < str.size(); k++) { if (str[k] != 'A' && str[k] != 'C' && str[k] != 'G' && str[k] != 'T') { Yes = false; } } if (Yes) { ans = max(ans, (int)(str.length())); } } } cout << ans << endl; return 0; }
[ "misc.opposites", "control_flow.branch.if.condition.change" ]
899,819
899,820
u083494782
cpp
p03086
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define FOR(i, a, n) for (int i = (a); i < (n); i++) #define all(v) v.begin(), v.end() #define fi first #define se second using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1e9; const int MOD = 1e9 + 7; int main() { ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; int n = int(s.size()); vector<int> a(n, 0); rep(i, n) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { a[i] = 1; } } int ans = 0; rep(i, n) FOR(j, i, n) { if (accumulate(a.begin() + i, a.begin() + j, 0) == j - i) { ans = max(ans, j - i); } } cout << ans << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define FOR(i, a, n) for (int i = (a); i < (n); i++) #define all(v) v.begin(), v.end() #define fi first #define se second using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1e9; const int MOD = 1e9 + 7; int main() { ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; int n = int(s.size()); vector<int> a(n, 0); rep(i, n) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { a[i] = 1; } } int ans = 0; rep(i, n) FOR(j, i + 1, n + 1) { if (accumulate(a.begin() + i, a.begin() + j, 0) == j - i) { ans = max(ans, j - i); } } cout << ans << endl; }
[ "expression.operation.binary.add" ]
899,827
899,828
u846634344
cpp
p03086
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; typedef pair<int, int> P; int main(void) { string s; cin >> s; int ans = 0; int check = 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')) { check++; ans = max(ans, check); } else check = 0; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; typedef pair<int, int> P; int main(void) { string s; cin >> s; int ans = 0; int check = 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')) { check++; ans = max(ans, check); } else check = 0; } cout << ans << endl; return 0; }
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
899,831
899,832
u917518913
cpp
p03086
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int ans = 0, now = 0; string S, T; T = "ATGC"; cin >> S; for (int i = 0; i < S.size(); i++) { bool isATGC = false; for (int j = 0; j < T.size(); j++) { if (S[i] == T[i]) isATGC = true; } if (!isATGC) { now = 0; } else { now++; ans = max(now, ans); } } cout << ans << endl; return 0; }
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int ans = 0, now = 0; string S, T; T = "ATGC"; cin >> S; for (int i = 0; i < S.size(); i++) { bool isATGC = false; for (int j = 0; j < T.size(); j++) { if (S[i] == T[j]) isATGC = true; } if (!isATGC) { now = 0; } else { now++; ans = max(now, ans); } } cout << ans << endl; return 0; }
[ "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
899,833
899,834
u778418521
cpp
p03086
#include <bits/stdc++.h> using namespace std; #define ll long long #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { string s; cin >> s; int cntc = 0, ans = 0; rep(i, s.size()) { if ((s[i] == 'A') || (s[i] == 'G') || (s[i] == 'C') || (s[i] == 'T')) { cntc++; } else { ans = max(ans, cntc); cntc = 0; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define ll long long #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { string s; cin >> s; int cntc = 0, ans = 0; rep(i, s.size()) { if ((s[i] == 'A') || (s[i] == 'G') || (s[i] == 'C') || (s[i] == 'T')) { cntc++; ans = max(ans, cntc); } else { cntc = 0; } } cout << ans << endl; }
[ "control_flow.branch.else.add" ]
899,835
899,836
u975789224
cpp
p03086
#include <bits/stdc++.h> using namespace std; typedef long long ll; int ans; bool atgc(char s) { string c = "ACGT"; for (int i = 0; i < c.size(); i++) { if (s == c[i]) { // cout << "true" << endl; return true; } } // cout << "f" << endl; return false; } int counter(string s, int index) { int count = 0; for (int i = index; i < s.size(); i++) { if (atgc(s[i])) { count++; } else { ans = max(ans, count); counter(s, i + 1); } } ans = max(ans, count); return 0; } int main() { string s; cin >> s; counter(s, 0); cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int ans; bool atgc(char s) { string c = "ACGT"; for (int i = 0; i < c.size(); i++) { if (s == c[i]) { // cout << "true" << endl; return true; } } // cout << "f" << endl; return false; } int counter(string s, int index) { int count = 0; for (int i = index; i < s.size(); i++) { if (atgc(s[i])) { count++; } else { ans = max(ans, count); counter(s, i + 1); break; } } ans = max(ans, count); return 0; } int main() { string s; cin >> s; counter(s, 0); cout << ans << endl; }
[ "control_flow.break.add" ]
899,842
899,843
u497418592
cpp
p03086
#include <iostream> #include <string> int main() { std::string S; std::cin >> S; int count = 0; int maxCount = 0; for (int i = 0; i != S.size(); i++) { if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') { count++; } else { maxCount = count > maxCount ? count : maxCount; count = 0; } } std::cout << maxCount << std::endl; return 0; }
#include <iostream> #include <string> int main() { std::string S; std::cin >> S; int count = 0; int maxCount = 0; for (int i = 0; i != S.size(); i++) { if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') { count++; maxCount = count > maxCount ? count : maxCount; } else { count = 0; } } std::cout << maxCount << std::endl; return 0; }
[ "control_flow.branch.else.add" ]
899,851
899,852
u809157683
cpp
p03086
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string S; cin >> S; vector<int> a; 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') { int count = 0; for (int j = i; j < S.size(); j++) { if (S.at(j) == 'A' || S.at(j) == 'T' || S.at(j) == 'G' || S.at(j) == 'C') count++; } a.push_back(count); } } if (!a.empty()) { sort(a.begin(), a.end()); cout << a.at(a.size() - 1) << endl; } else cout << 0 << endl; }
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string S; cin >> S; vector<int> a; 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') { int count = 0; for (int j = i; j < S.size(); j++) { if (S.at(j) == 'A' || S.at(j) == 'T' || S.at(j) == 'G' || S.at(j) == 'C') count++; else break; } a.push_back(count); } } if (!a.empty()) { sort(a.begin(), a.end()); cout << a.at(a.size() - 1) << endl; } else cout << 0 << endl; }
[ "control_flow.branch.else_if.replace.remove", "control_flow.branch.if.replace.add" ]
899,861
899,862
u255112547
cpp
p03086
#include <algorithm> #include <cstdio> #include <cstring> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define int long long int #define rep(i, n) for (int i = 0; i < n; i++) #define INF 1001001001 #define LLINF 1001001001001001001 #define mp make_pair #define pb push_back #define mod 1000000007 signed main() { char S[100]; scanf("%s", S); int N = strlen(S); int ans = 0; for (int i = 0; i < N - 1; i++) { //始点 for (int j = i; j < N; j++) { //終点 for (int k = i; k <= j; k++) { if (S[k] != 'A' && S[k] != 'C' && S[k] != 'G' && S[k] != 'T') break; if (k == j) ans = max(ans, j - i + 1); } } } printf("%lld\n", ans); return 0; }
#include <algorithm> #include <cstdio> #include <cstring> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define int long long int #define rep(i, n) for (int i = 0; i < n; i++) #define INF 1001001001 #define LLINF 1001001001001001001 #define mp make_pair #define pb push_back #define mod 1000000007 signed main() { char S[100]; scanf("%s", S); int N = strlen(S); int ans = 0; for (int i = 0; i < N; i++) { //始点 for (int j = i; j < N; j++) { //終点 for (int k = i; k <= j; k++) { if (S[k] != 'A' && S[k] != 'C' && S[k] != 'G' && S[k] != 'T') break; if (k == j) ans = max(ans, j - i + 1); } } } printf("%lld\n", ans); return 0; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
899,865
899,866
u857644621
cpp
p03086
#include <bits/stdc++.h> #define all(a) (a).begin(), (a).end() #define rep(i, n) for (ll(i) = 0, (i##_len) = (n); (i) < (i##_len); (i)++) #define rep2(i, a, b) \ for (ll(i) = (a), (i##_len) = (b); (i) <= (i##_len); (i++)) #define Yes(n) cout << ((n) ? "Yes\n" : "No\n") #define vll vector<ll> #define pb push_back using namespace std; using ll = long long; static inline void ignore_ret(int x) {} template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } template <class T> T abs(T x) { return max(x, -x); } template <class T> T gcd_vec(vector<T> v) { T r = v.at(0); for (T i = 1; i < v.size(); i++) r = gcd(r, v.at(i)); return r; } template <class T> T lcm(T m, T n) { return m * n / gcd(m, n); } template <class T> T lcm_vec(vector<T> v) { T r = v.at(0); for (T i = 1; i < v.size(); i++) r = lcm<T>(r, v.at(i)); return r; } template <class T> T factorial(T n) { if (n == 0) return 1; T r = 1; for (T i = 2; i <= n; i++) r *= i; return r; } template <class T> T nCr(T n, T k) { return factorial<T>(n) / (factorial<T>(k) * factorial<T>(n - k)); } template <class T> T dot_product(vector<T> u, vector<T> v) { T r = 0; for (T i = 0; i < u.size(); i++) r += u.at(i) * v.at(i); return r; } template <class T> T sum(vector<T> v) { return reduce(all(v), 0LL); } // Template ends here void solve(string S) { int cnt = 0, tmp = 0; rep(i, (int)S.size() - 1) { if (S.at(i) == 'A' || S.at(i) == 'C' || S.at(i) == 'G' || S.at(i) == 'T') chmax(cnt, ++tmp); else tmp = 0; } cout << cnt << "\n"; } int main() { string S; cin >> S; solve(S); return 0; }
#include <bits/stdc++.h> #define all(a) (a).begin(), (a).end() #define rep(i, n) for (ll(i) = 0, (i##_len) = (n); (i) < (i##_len); (i)++) #define rep2(i, a, b) \ for (ll(i) = (a), (i##_len) = (b); (i) <= (i##_len); (i++)) #define Yes(n) cout << ((n) ? "Yes\n" : "No\n") #define vll vector<ll> #define pb push_back using namespace std; using ll = long long; static inline void ignore_ret(int x) {} template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } template <class T> T abs(T x) { return max(x, -x); } template <class T> T gcd_vec(vector<T> v) { T r = v.at(0); for (T i = 1; i < v.size(); i++) r = gcd(r, v.at(i)); return r; } template <class T> T lcm(T m, T n) { return m * n / gcd(m, n); } template <class T> T lcm_vec(vector<T> v) { T r = v.at(0); for (T i = 1; i < v.size(); i++) r = lcm<T>(r, v.at(i)); return r; } template <class T> T factorial(T n) { if (n == 0) return 1; T r = 1; for (T i = 2; i <= n; i++) r *= i; return r; } template <class T> T nCr(T n, T k) { return factorial<T>(n) / (factorial<T>(k) * factorial<T>(n - k)); } template <class T> T dot_product(vector<T> u, vector<T> v) { T r = 0; for (T i = 0; i < u.size(); i++) r += u.at(i) * v.at(i); return r; } template <class T> T sum(vector<T> v) { return reduce(all(v), 0LL); } // Template ends here void solve(string S) { int cnt = 0, tmp = 0; rep(i, S.size()) { if (S.at(i) == 'A' || S.at(i) == 'C' || S.at(i) == 'G' || S.at(i) == 'T') chmax(cnt, ++tmp); else tmp = 0; } cout << cnt << "\n"; } int main() { string S; cin >> S; solve(S); return 0; }
[ "expression.operation.binary.remove" ]
899,869
899,870
u368735320
cpp
p03086
#include <iostream> #include <string> int main(int argc, char *argv[]) { char c; int count = 0, max = 0; while (std::cin >> c) { if (c == 'A' || c == 'C' || c == 'G' || c == 'T') ++count; else { max = std::max(max, count); count = 0; } } std::cout << max << std::endl; }
#include <iostream> #include <string> int main(int argc, char *argv[]) { char c; int count = 0, max = 0; while (std::cin >> c) { if (c == 'A' || c == 'C' || c == 'G' || c == 'T') { ++count; max = std::max(max, count); } else { count = 0; } } std::cout << max << std::endl; }
[ "control_flow.branch.else.add" ]
899,879
899,880
u089888152
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans = 0; int temp = 0; for (int i = 0; i < s.length(); i++) { if (s[i] != 'A' && s[i] != 'C' && s[i] != 'G' && s[i] != 'T') { ans = max(ans, temp); temp = 0; } else { temp++; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans = 0; int temp = 0; for (int i = 0; i < s.length(); i++) { if (s[i] != 'A' && s[i] != 'C' && s[i] != 'G' && s[i] != 'T') { ans = max(ans, temp); temp = 0; } else { temp++; } } cout << max(ans, temp) << endl; }
[ "call.add", "call.arguments.add" ]
899,883
899,884
u879949614
cpp
p03086
#include <bits/stdc++.h> using namespace std; template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); } template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); } typedef long long ll; typedef vector<int> vint; typedef pair<int, int> pint; typedef vector<long long> vlong; #define _GLIBCXX_DEBUG #define vpush(a, x) a.push_back(x); #define rep(i, n) REP(i, 0, n) #define all(v) v.begin(), v.end() #define REP(i, x, n) for (int i = x; i < n; i++) const int INF = 1 << 30; const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}; const int dy[] = {0, -1, 0, 1, 1, -1, -1, 1}; #define stp(x) setprecision(x) int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string s; cin >> s; int ans = 0, si = s.size(); bool fg = false; rep(i, si) { for (int j = si - 1; j > i; j--) { fg = true; REP(k, i, j + 1) { if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T') { fg = false; } } if (fg) { int tmp = j - i + 1; chmax(ans, tmp); } } } cout << ans << '\n'; return (0); }
#include <bits/stdc++.h> using namespace std; template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); } template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); } typedef long long ll; typedef vector<int> vint; typedef pair<int, int> pint; typedef vector<long long> vlong; #define _GLIBCXX_DEBUG #define vpush(a, x) a.push_back(x); #define rep(i, n) REP(i, 0, n) #define all(v) v.begin(), v.end() #define REP(i, x, n) for (int i = x; i < n; i++) const int INF = 1 << 30; const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}; const int dy[] = {0, -1, 0, 1, 1, -1, -1, 1}; #define stp(x) setprecision(x) int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string s; cin >> s; int ans = 0, si = s.size(); bool fg = false; rep(i, si) { for (int j = si - 1; j >= i; j--) { fg = true; REP(k, i, j + 1) { if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T') { fg = false; } } if (fg) { int tmp = j - i + 1; chmax(ans, tmp); } } } cout << ans << '\n'; return (0); }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
899,901
899,902
u132033278
cpp
p03086
#include <bits/stdc++.h> using namespace std; template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); } template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); } typedef long long ll; typedef vector<int> vint; typedef pair<int, int> pint; typedef vector<long long> vlong; #define _GLIBCXX_DEBUG #define vpush(a, x) a.push_back(x); #define rep(i, n) REP(i, 0, n) #define all(v) v.begin(), v.end() #define REP(i, x, n) for (int i = x; i < n; i++) const int INF = 1 << 30; const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}; const int dy[] = {0, -1, 0, 1, 1, -1, -1, 1}; #define stp(x) setprecision(x) int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string s; cin >> s; int ans = 0, si = s.size(); bool fg = false; rep(i, si) { for (int j = si - 1; j > i; j--) { fg = true; REP(k, i, j) { if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T') { fg = false; } } if (fg) { int tmp = j - i; chmax(ans, tmp); } } } cout << ans << '\n'; return (0); }
#include <bits/stdc++.h> using namespace std; template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); } template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); } typedef long long ll; typedef vector<int> vint; typedef pair<int, int> pint; typedef vector<long long> vlong; #define _GLIBCXX_DEBUG #define vpush(a, x) a.push_back(x); #define rep(i, n) REP(i, 0, n) #define all(v) v.begin(), v.end() #define REP(i, x, n) for (int i = x; i < n; i++) const int INF = 1 << 30; const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}; const int dy[] = {0, -1, 0, 1, 1, -1, -1, 1}; #define stp(x) setprecision(x) int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string s; cin >> s; int ans = 0, si = s.size(); bool fg = false; rep(i, si) { for (int j = si - 1; j >= i; j--) { fg = true; REP(k, i, j + 1) { if (s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T') { fg = false; } } if (fg) { int tmp = j - i + 1; chmax(ans, tmp); } } } cout << ans << '\n'; return (0); }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
899,903
899,902
u132033278
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int cnt = 0, c = 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') c++; else { if (cnt < c) cnt = c; c = 0; } if (i = S.size() - 1) { if (cnt < c) cnt = c; } } cout << cnt << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int cnt = 0, c = 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') c++; else { if (cnt < c) cnt = c; c = 0; } if (i == S.size() - 1) { if (cnt < c) cnt = c; } } cout << cnt << endl; }
[ "expression.operation.compare.replace.add", "assignment.replace.remove", "misc.typo" ]
899,906
899,907
u315542000
cpp
p03086
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (int)(b); i++) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(a) (a).begin(), (a).end() #define allg(a) (a).begin(), (a).end(), greater<int>() using vi = vector<int>; using vvi = vector<vi>; using vs = vector<string>; const int INF = 1001001001; const int MOD = 1000000007; const long long INFL = (1LL << 60); const double EPS = 1e-9; int main() { string s; cin >> s; int n = s.size(); int res = 0; rep(i, n) rep(j, n - i) { string sub = s.substr(i, j); bool isACGT = true; rep(k, sub.size()) { char c = sub[k]; if (c != 'A' && c != 'C' && c != 'G' && c != 'T') { isACGT = false; break; } } if (isACGT) res = max(res, (int)sub.size()); } cout << res << endl; }
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (int)(b); i++) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(a) (a).begin(), (a).end() #define allg(a) (a).begin(), (a).end(), greater<int>() using vi = vector<int>; using vvi = vector<vi>; using vs = vector<string>; const int INF = 1001001001; const int MOD = 1000000007; const long long INFL = (1LL << 60); const double EPS = 1e-9; int main() { string s; cin >> s; int n = s.size(); int res = 0; rep(i, n) rep(j, n - i + 1) { string sub = s.substr(i, j); bool isACGT = true; rep(k, sub.size()) { char c = sub[k]; if (c != 'A' && c != 'C' && c != 'G' && c != 'T') { isACGT = false; break; } } if (isACGT) res = max(res, (int)sub.size()); } cout << res << endl; }
[ "expression.operation.binary.add" ]
899,912
899,913
u118474439
cpp
p03086
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; signed main(void) { string s; int n, ans; bool ok; cin >> s; n = s.size(); ans = 0; rep(i, n - 1) { for (int j = i; j < n; j++) { string t = s.substr(i, j - i + 1); ok = true; rep(k, t.size()) { if (t[k] != 'A' && t[k] != 'T' && t[k] != 'G' && t[k] != 'C') ok = false; } int m = t.size(); if (ok) ans = max(ans, m); } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; signed main(void) { string s; int n, ans; bool ok; cin >> s; n = s.size(); ans = 0; rep(i, n) { for (int j = i; j < n; j++) { string t = s.substr(i, j - i + 1); ok = true; rep(k, t.size()) { if (t[k] != 'A' && t[k] != 'T' && t[k] != 'G' && t[k] != 'C') ok = false; } int m = t.size(); if (ok) ans = max(ans, m); } } cout << ans << endl; return 0; }
[ "expression.operation.binary.remove" ]
899,914
899,915
u890331732
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int cnt = 0, ans = 0; for (int i = 0; i < (int)s.size(); i++) { if (s.at(i) == 'A' || s.at(i) == 'C' || s.at(i) == 'G' || s.at(i) == 'T') { cnt++; } else { 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 cnt = 0, ans = 0; for (int i = 0; i < (int)s.size(); i++) { if (s.at(i) == 'A' || s.at(i) == 'C' || s.at(i) == 'G' || s.at(i) == 'T') { cnt++; } else { cnt = 0; } ans = max(ans, cnt); } cout << ans << endl; }
[]
899,920
899,921
u515131769
cpp
p03086
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 1; i < n + 1; i++) int main() { string s, m; cin >> s; int ans = 0, n = s.size(), M; bool ok; for (int a = 0; a < n; a++) for (int b = a + 1; b < n; b++) { m = s.substr(a, b - a); M = m.size(); ok = true; for (int i = 0; i < M; i++) { if (m[i] != 'A' && m[i] != 'T' && m[i] != 'G' && m[i] != 'C') ok = false; } if (ok) ans = max(ans, M); } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 1; i < n + 1; i++) int main() { string s, m; cin >> s; int ans = 0, n = s.size(), M; bool ok; for (int a = 0; a < n; a++) for (int b = a + 1; b < n + 1; b++) { m = s.substr(a, b - a); M = m.size(); ok = true; for (int i = 0; i < M; i++) { if (m[i] != 'A' && m[i] != 'T' && m[i] != 'G' && m[i] != 'C') ok = false; } if (ok) ans = max(ans, M); } cout << ans << endl; }
[ "control_flow.loop.for.condition.change", "misc.off_by_one" ]
899,922
899,923
u551813187
cpp
p03086
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string s; cin >> s; int n = s.size(); int res = 0; for (int i = 0; i < n; ++i) { for (int j = i; j < n; ++j) { string sub = s.substr(i, j - i + 1); int num = sub.size(); bool flg = true; for (int k = 0; i < num; ++k) { char c = sub[k]; if (c != 'A' && c != 'C' && c != 'G' && c != 'T') { flg = false; } } if (flg) res = max(res, num); } } cout << res << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string s; cin >> s; int n = s.size(); int res = 0; for (int i = 0; i < n; ++i) { for (int j = i; j < n; ++j) { string sub = s.substr(i, j - i + 1); int num = sub.size(); bool flg = true; for (int k = 0; k < num; ++k) { char c = sub[k]; if (c != 'A' && c != 'C' && c != 'G' && c != 'T') { flg = false; break; } } if (flg) res = max(res, num); } } cout << res << endl; return 0; }
[ "identifier.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
899,926
899,927
u374051158
cpp
p03086
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string s; cin >> s; int n = s.size(); int res = 0; for (int i = 0; i < n; ++i) { for (int j = i; j < n; ++j) { string sub = s.substr(i, j - i + 1); int num = sub.size(); bool flg = true; for (int k = 0; i < sub.size(); ++k) { char c = sub[k]; if (c != 'A' && c != 'C' && c != 'G' && c != 'T') { flg = false; break; } } if (flg) res = max(res, num); } } cout << res << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string s; cin >> s; int n = s.size(); int res = 0; for (int i = 0; i < n; ++i) { for (int j = i; j < n; ++j) { string sub = s.substr(i, j - i + 1); int num = sub.size(); bool flg = true; for (int k = 0; k < num; ++k) { char c = sub[k]; if (c != 'A' && c != 'C' && c != 'G' && c != 'T') { flg = false; break; } } if (flg) res = max(res, num); } } cout << res << endl; return 0; }
[ "identifier.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change", "call.remove" ]
899,928
899,927
u374051158
cpp
p03086
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string s; cin >> s; int n = s.size(); int res = 0; for (int i = 0; i < n; ++i) { for (int j = i; j < n; ++j) { string sub = s.substr(i, j - i + 1); int num = sub.size(); bool flg = true; for (int k = 0; i < num; ++k) { char c = sub[k]; if (c != 'A' && c != 'C' && c != 'G' && c != 'T') { flg = false; } } if (flg) res = max(res, num); } } cout << res << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string s; cin >> s; int n = s.size(); int res = 0; for (int i = 0; i < n; ++i) { for (int j = i; j < n; ++j) { string sub = s.substr(i, j - i + 1); int num = sub.size(); bool flg = true; for (int k = 0; k < num; ++k) { char c = sub[k]; if (c != 'A' && c != 'C' && c != 'G' && c != 'T') { flg = false; } } if (flg) res = max(res, num); } } cout << res << endl; return 0; }
[ "identifier.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
899,926
899,929
u374051158
cpp
p03086
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, n) for (int i = 1; i < (n); ++i) using namespace std; typedef long long ll; const ll INF = 1LL << 60; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string s; cin >> s; int n = s.size(); int res = 0; for (int i = 0; i < n - 1; ++i) { for (int j = i; j < n; ++j) { string sub = s.substr(i, j - i + 1); bool flg = true; rep(k, sub.size()) { char c = sub[k]; if (c == 'A' || c == 'C' || c == 'G' || c == 'T') flg = flg && true; else flg = false; } if (flg) res = max(res, (int)sub.size()); } } cout << res << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, n) for (int i = 1; i < (n); ++i) using namespace std; typedef long long ll; const ll INF = 1LL << 60; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string s; cin >> s; int n = s.size(); int res = 0; for (int i = 0; i < n; ++i) { for (int j = i; j < n; ++j) { string sub = s.substr(i, j - i + 1); bool flg = true; rep(k, sub.size()) { char c = sub[k]; if (c == 'A' || c == 'C' || c == 'G' || c == 'T') flg = flg && true; else flg = false; } if (flg) res = max(res, (int)sub.size()); } } cout << res << endl; return 0; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
899,930
899,931
u374051158
cpp
p03086
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, n) for (int i = 1; i < (n); ++i) using namespace std; typedef long long ll; const ll INF = 1LL << 60; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string s; cin >> s; int n = s.size(); int res = 0; for (int i = 0; i < n - 1; ++i) { for (int j = i + 1; j < n; ++j) { string sub = s.substr(i, j - i + 1); bool flg = true; rep(k, sub.size()) { char c = sub[k]; if (c == 'A' || c == 'C' || c == 'G' || c == 'T') flg = flg && true; else flg = false; } if (flg) res = max(res, (int)sub.size()); } } cout << res << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, n) for (int i = 1; i < (n); ++i) using namespace std; typedef long long ll; const ll INF = 1LL << 60; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string s; cin >> s; int n = s.size(); int res = 0; for (int i = 0; i < n; ++i) { for (int j = i; j < n; ++j) { string sub = s.substr(i, j - i + 1); bool flg = true; rep(k, sub.size()) { char c = sub[k]; if (c == 'A' || c == 'C' || c == 'G' || c == 'T') flg = flg && true; else flg = false; } if (flg) res = max(res, (int)sub.size()); } } cout << res << endl; return 0; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove", "control_flow.loop.for.initializer.change" ]
899,932
899,931
u374051158
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans = 0; for (int i = 0; i < s.size(); i++) { int cnt = 0; if (s.at(i) == 'A' || s.at(i) == 'C' || s.at(i) == 'G' || s.at(i) == 'T') { cnt++; for (int j = i + 1; j < s.size(); j++) { if (s.at(j) == 'A' || s.at(j) == 'C' || s.at(j) == 'G' || s.at(j) == 'T') cnt++; } } ans = max(ans, cnt); } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans = 0; for (int i = 0; i < s.size(); i++) { int cnt = 0; if (s.at(i) == 'A' || s.at(i) == 'C' || s.at(i) == 'G' || s.at(i) == 'T') { cnt++; for (int j = i + 1; j < s.size(); j++) { if (s.at(j) == 'A' || s.at(j) == 'C' || s.at(j) == 'G' || s.at(j) == 'T') cnt++; else break; } } ans = max(ans, cnt); } cout << ans << endl; }
[ "control_flow.branch.else_if.replace.remove", "control_flow.branch.if.replace.add" ]
899,935
899,936
u644110877
cpp
p03086
#include <iostream> using namespace std; bool ACGT(char s) { return s == 'A' || s == 'C' || s == 'G' || s == 'T'; } int main(void) { string S; cin >> S; int i, j; int count_max = 0; for (i = 0; i < S.length() - 1; i++) { int count = 0; for (j = i; ACGT(S[j]); j++) count++; count_max = max(count_max, count); } cout << count_max << endl; return 0; }
#include <iostream> using namespace std; bool ACGT(char s) { return s == 'A' || s == 'C' || s == 'G' || s == 'T'; } int main(void) { string S; cin >> S; int i, j; int count_max = 0; for (i = 0; i < S.length(); i++) { int count = 0; for (j = i; ACGT(S[j]); j++) count++; count_max = max(count_max, count); } cout << count_max << endl; return 0; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
899,949
899,950
u537852947
cpp
p03086
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define _GLIBCXX_DEBUG using ll = long long; using vi = vector<int>; using vll = vector<ll>; using vd = vector<double>; using vvi = vector<vi>; using vvll = vector<vll>; using vvd = vector<vd>; using vvvi = vector<vvi>; using vvvll = vector<vvll>; using vvvd = vector<vvd>; const double pi = 3.141592653589793; int main() { string s; cin >> s; int num = s.size(); int ans = 0; for (int i = 0; i < num; i++) { for (int j = i; j < num; j++) { int b = 1; for (int k = i; k < j + 1; k++) { char ss = s.at(i); if (!(ss == 'A' || ss == 'T' || ss == 'G' || ss == 'C')) { b = 0; break; } } if (b) { ans = max(ans, j - i + 1); } } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define _GLIBCXX_DEBUG using ll = long long; using vi = vector<int>; using vll = vector<ll>; using vd = vector<double>; using vvi = vector<vi>; using vvll = vector<vll>; using vvd = vector<vd>; using vvvi = vector<vvi>; using vvvll = vector<vvll>; using vvvd = vector<vvd>; const double pi = 3.141592653589793; int main() { string s; cin >> s; int num = s.size(); int ans = 0; for (int i = 0; i < num; i++) { for (int j = i; j < num; j++) { int b = 1; for (int k = i; k < j + 1; k++) { char ss = s.at(k); if (!(ss == 'A' || ss == 'T' || ss == 'G' || ss == 'C')) { b = 0; break; } } if (b) { ans = max(ans, j - i + 1); } } } cout << ans << endl; return 0; }
[ "identifier.change", "call.arguments.change" ]
899,951
899,952
u518042385
cpp
p03086
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define all(v) v.begin(), v.end() using namespace std; using ll = long long; int main() { string S; cin >> S; int res = 0; int count = 0; rep(i, S.size()) { if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') count++; else { res = max(res, count); count = 0; } } cout << res << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define all(v) v.begin(), v.end() using namespace std; using ll = long long; int main() { string S; cin >> S; int res = 0; int count = 0; rep(i, S.size()) { if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') count++; else { res = max(res, count); count = 0; } } cout << max(res, count) << endl; }
[ "call.add", "call.arguments.add" ]
899,955
899,956
u560381579
cpp
p03086
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ull = unsigned long long; using ll = long long; bool isACGT(string s) { bool acgt = true; for (int i = 0; i < s.size(); i++) { if ((s[i] != 'A') && (s[i] != 'C') && (s[i] != 'G') && (s[i] != 'T')) acgt = false; } return acgt; } int main() { string S; cin >> S; int ans = 0; for (int i = 0; i < S.size(); i++) { for (int len = 1; len < S.size() - i; len++) { string subs = S.substr(i, len); if (isACGT(subs)) ans = max(ans, (int)subs.size()); } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ull = unsigned long long; using ll = long long; bool isACGT(string s) { bool acgt = true; for (int i = 0; i < s.size(); i++) { if ((s[i] != 'A') && (s[i] != 'C') && (s[i] != 'G') && (s[i] != 'T')) acgt = false; } return acgt; } int main() { string S; cin >> S; int ans = 0; for (int i = 0; i < S.size(); i++) { for (int len = 1; len <= S.size() - i; len++) { string subs = S.substr(i, len); if (isACGT(subs)) ans = max(ans, (int)subs.size()); } } cout << ans << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
899,957
899,958
u494249944
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans = 0; int count = 0; for (int j = 0; j < s.size() - 1; j++) { if ((s.at(j) == 'A') || (s.at(j) == 'C') || (s.at(j) == 'G') || (s.at(j) == 'T')) count++; else count = 0; if (count > ans) ans = count; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans = 0; int count = 0; for (int j = 0; j < s.size(); j++) { if ((s.at(j) == 'A') || (s.at(j) == 'C') || (s.at(j) == 'G') || (s.at(j) == 'T')) count++; else count = 0; if (count > ans) ans = count; } cout << ans << endl; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
899,959
899,960
u987575170
cpp
p03086
#include <bits/stdc++.h> using namespace std; typedef long long ll; void solve() { string S; cin >> S; int n = S.size(); int ans = 0; bool flag = true; for (int k = 0; k < n; k++) { if (S[k] == 'A' || S[k] == 'T' || S[k] == 'G' || S[k] == 'C') continue; else { flag = false; } } if (flag) ans = n; for (int i = 0; i < n; i++) { for (int j = 1; j < n - i; ++j) { string tmp = S.substr(i, j); bool flag = true; for (int k = 0; k < tmp.size(); k++) { if (tmp[k] == 'A' || tmp[k] == 'T' || tmp[k] == 'G' || tmp[k] == 'C') continue; else { flag = false; } } if (flag) { ans = max(ans, (int)tmp.size()); } } } printf("%d\n", ans); } int main(void) { ////////////////////////// solve(); ////////////////////////// return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; void solve() { string S; cin >> S; int n = S.size(); int ans = 0; bool flag = true; for (int k = 0; k < n; k++) { if (S[k] == 'A' || S[k] == 'T' || S[k] == 'G' || S[k] == 'C') continue; else { flag = false; } } if (flag) ans = n; for (int i = 0; i < n; i++) { for (int j = 1; j <= n - i; ++j) { string tmp = S.substr(i, j); bool flag = true; for (int k = 0; k < tmp.size(); k++) { if (tmp[k] == 'A' || tmp[k] == 'T' || tmp[k] == 'G' || tmp[k] == 'C') continue; else { flag = false; } } if (flag) { ans = max(ans, (int)tmp.size()); } } } printf("%d\n", ans); } int main(void) { ////////////////////////// solve(); ////////////////////////// return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
899,961
899,962
u379959788
cpp
p03086
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstddef> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> // clang-format off template <typename T> T gcd(T a, T b) { return b == 0 ? a : gcd(b, a % b); } template <typename T> T lcm(T a, T b) { return a * b / gcd(a, b); } template <typename T> T clamp(T val, T min, T max) { return val < min ? min : (max < val ? max : val); } template <typename T> size_t max_index(T begin, T end) { return distance(begin, max_element(begin, end)); } template <typename T> size_t min_index(T begin, T end) { return distance(begin, min_element(begin, end)); } // clang-format on // #define int long long using namespace std; signed main(void) { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int num = 0; for (int i = 0; i < s.length(); ++i) { for (int j = 0; j < s.length() - i; ++j) { string t = s.substr(i, j); bool flag = true; for (auto it = t.begin(); it != t.end(); ++it) { if (*it != 'A' && *it != 'C' && *it != 'G' && *it != 'T') { flag = false; break; } } if (flag) num = max(num, (int)t.length()); } } cout << num << endl; return 0; }
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstddef> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> // clang-format off template <typename T> T gcd(T a, T b) { return b == 0 ? a : gcd(b, a % b); } template <typename T> T lcm(T a, T b) { return a * b / gcd(a, b); } template <typename T> T clamp(T val, T min, T max) { return val < min ? min : (max < val ? max : val); } template <typename T> size_t max_index(T begin, T end) { return distance(begin, max_element(begin, end)); } template <typename T> size_t min_index(T begin, T end) { return distance(begin, min_element(begin, end)); } // clang-format on // #define int long long using namespace std; signed main(void) { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int num = 0; for (int i = 0; i < s.length(); ++i) { for (int j = 0; j < s.length() - i + 1; ++j) { string t = s.substr(i, j); // cout << t << endl; bool flag = true; for (auto it = t.begin(); it != t.end(); ++it) { if (*it != 'A' && *it != 'C' && *it != 'G' && *it != 'T') { flag = false; break; } } if (flag) num = max(num, (int)t.length()); } } cout << num << endl; return 0; }
[ "control_flow.loop.for.condition.change", "misc.off_by_one" ]
899,972
899,973
u076865901
cpp
p03086
#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++) { for (int j = 1; j < N - i; j++) { string t = s.substr(i, j); bool flg = true; for (int k = 0; k < t.size(); k++) { if (t[k] == 'A' || t[k] == 'C' || t[k] == 'G' || t[k] == 'T') continue; else { flg = false; break; } } if (flg) { ans = max(ans, int(t.size())); // cout<<t.size()<<endl; } } } cout << ans << endl; }
#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++) { for (int j = 1; j <= N - i; j++) { string t = s.substr(i, j); // cout<<t<<endl; bool flg = true; for (int k = 0; k < t.size(); k++) { if (t[k] == 'A' || t[k] == 'C' || t[k] == 'G' || t[k] == 'T') continue; else { flg = false; break; } } if (flg) { // cout<<t<<endl; ans = max(ans, int(t.size())); // cout<<t.size()<<endl; } } } cout << ans << endl; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
899,978
899,979
u223172354
cpp
p03086
#include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <unordered_map> #include <vector> using namespace std; #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) #define rep(i, n) for (ll i = 0; i < (n); ++i) #define Sort(v) sort(v.begin(), v.end()) #define Reverse(v) reverse(v.begin(), v.end()) #define Lower_bound(v, x) \ distance(v.begin(), lower_bound(v.begin(), v.end(), x)) #define Upper_bound(v, x) \ distance(v.begin(), upper_bound(v.begin(), v.end(), x)) using ll = long long; using ull = unsigned long long; using P = pair<ll, ll>; using T = tuple<ll, ll, ll>; using vll = vector<ll>; using vP = vector<P>; using vT = vector<T>; using vvll = vector<vector<ll>>; using vvP = vector<vector<P>>; using dqll = deque<ll>; ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0}; ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0}; const ll INF = 1LL << 50; const ll mod = 1e9 + 7; int main() { string s; cin >> s; ll n = s.size(); ll ans = 0; for (ll i = 0; i < n - 1; i++) { for (ll j = i + 1; j < n; j++) { ll res = j - i + 1; for (ll k = i; k <= j; k++) { if (s[k] != 'A' && s[k] != 'G' && s[k] != 'C' && s[k] != 'T') res = 0; } chmax(ans, res); } } cout << ans << endl; return 0; }
#include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <unordered_map> #include <vector> using namespace std; #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) #define rep(i, n) for (ll i = 0; i < (n); ++i) #define Sort(v) sort(v.begin(), v.end()) #define Reverse(v) reverse(v.begin(), v.end()) #define Lower_bound(v, x) \ distance(v.begin(), lower_bound(v.begin(), v.end(), x)) #define Upper_bound(v, x) \ distance(v.begin(), upper_bound(v.begin(), v.end(), x)) using ll = long long; using ull = unsigned long long; using P = pair<ll, ll>; using T = tuple<ll, ll, ll>; using vll = vector<ll>; using vP = vector<P>; using vT = vector<T>; using vvll = vector<vector<ll>>; using vvP = vector<vector<P>>; using dqll = deque<ll>; ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0}; ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0}; const ll INF = 1LL << 50; const ll mod = 1e9 + 7; int main() { string s; cin >> s; ll n = s.size(); ll ans = 0; for (ll i = 0; i < n; i++) { for (ll j = i; j < n; j++) { ll res = j - i + 1; for (ll k = i; k <= j; k++) { if (s[k] != 'A' && s[k] != 'G' && s[k] != 'C' && s[k] != 'T') res = 0; } chmax(ans, res); } } cout << ans << endl; return 0; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove", "control_flow.loop.for.initializer.change" ]
899,990
899,991
u714724786
cpp
p03086
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1}; const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1}; const ll MOD = 1000000007; const ll INF = 1000000000000000000L; #ifdef __DEBUG /** * For DEBUG * https://github.com/ta7uw/cpp-pyprint */ #include "cpp-pyprint/pyprint.h" #endif void Main() { string S; cin >> S; ll ans = 0; ll N = S.size(); rep(i, N) { rep2(j, i + 1, N) { string T = ""; rep2(k, i, j) { T += S[k]; } bool ok = true; rep(t, T.size()) { if (T[t] == 'A' || T[t] == 'G' || T[t] == 'C' || T[t] == 'T') { continue; } else { ok = false; } } if (ok) { ans = max(ans, (ll)T.size()); } } } cout << ans << '\n'; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); Main(); return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1}; const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1}; const ll MOD = 1000000007; const ll INF = 1000000000000000000L; #ifdef __DEBUG /** * For DEBUG * https://github.com/ta7uw/cpp-pyprint */ #include "cpp-pyprint/pyprint.h" #endif void Main() { string S; cin >> S; ll ans = 0; ll N = S.size(); rep(i, N) { rep2(j, i + 1, N + 1) { string T = ""; rep2(k, i, j) { T += S[k]; } bool ok = true; rep(t, T.size()) { if (T[t] == 'A' || T[t] == 'G' || T[t] == 'C' || T[t] == 'T') { continue; } else { ok = false; } } if (ok) { ans = max(ans, (ll)T.size()); } } } cout << ans << '\n'; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); Main(); return 0; }
[ "expression.operation.binary.add" ]
900,004
900,005
u427344224
cpp
p03086
// https://atcoder.jp/contests/abc122/tasks/abc122_b #include <bits/stdc++.h> #define rep(i, a, n) for (int i = (a); i < n; i++) #define print(x) cout << x << endl; using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } typedef long long ll; int main() { string S; cin >> S; int n = S.length(); int res = 0; int tmp = 0; rep(i, 0, n) { if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') { tmp++; } else { res = max(res, tmp); tmp = 0; } } cout << res << endl; return 0; }
// https://atcoder.jp/contests/abc122/tasks/abc122_b #include <bits/stdc++.h> #define rep(i, a, n) for (int i = (a); i < n; i++) #define print(x) cout << x << endl; using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } typedef long long ll; int main() { string S; cin >> S; int n = S.length(); int res = 0; int tmp = 0; rep(i, 0, n) { if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') { tmp++; res = max(res, tmp); } else { tmp = 0; } } cout << res << endl; return 0; }
[ "control_flow.branch.else.add" ]
900,006
900,007
u468440139
cpp
p03086
#include <bits/stdc++.h> using namespace std; string S; int main() { cin >> S; int len = S.length(); int count = 0; int max = 0; for (int i = 0; i < len; ++i) { if (S.at(i) == 'A' || S.at(i) == 'C' || S.at(i) == 'G' || S.at(i) == 'T') { count++; } else { if (max < count) max = count; count = 0; } } cout << max << endl; }
#include <bits/stdc++.h> using namespace std; string S; int main() { cin >> S; int len = S.length(); int count = 0; int max = 0; for (int i = 0; i < len; ++i) { if (S.at(i) == 'A' || S.at(i) == 'C' || S.at(i) == 'G' || S.at(i) == 'T') { count++; if (max < count) max = count; } else { count = 0; } } cout << max << endl; }
[ "control_flow.branch.else.add" ]
900,010
900,011
u971089878
cpp
p03086
#include <bits/stdc++.h> using namespace std; bool isACGT(char a) { return a == 'A' || a == 'C' || a == 'G' || a == 'T'; } int main() { string S; cin >> S; int ans = -1; int left = 0; for (int i = 0; i < S.length(); i++) { if (!isACGT(S[i])) { left = i; continue; } ans = max(ans, i - left); } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; bool isACGT(char a) { return a == 'A' || a == 'C' || a == 'G' || a == 'T'; } int main() { string S; cin >> S; int ans = -1; int left = 0; for (int i = 0; i < S.length(); i++) { if (!isACGT(S[i])) { left = i + 1; } ans = max(ans, i - left + 1); } cout << ans << endl; return 0; }
[ "assignment.change" ]
900,012
900,013
u303453927
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int ans = 0; int N = 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') { ans = max(ans, N); } else { N = 0; } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int ans = 0; int N = 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') { N++; ans = max(ans, N); } else { N = 0; } } cout << ans << endl; return 0; }
[ "expression.unary.arithmetic.add" ]
900,016
900,017
u629548179
cpp
p03086
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { string s; cin >> s; int ans = 0; int ct = 0; rep(i, s.size()) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { ct++; } else { ans = max(ct, ans); ct = 0; } } cout << ans << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { string s; cin >> s; int ans = 0; int ct = 0; rep(i, s.size()) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { ct++; ans = max(ct, ans); } else ct = 0; } cout << ans << endl; }
[ "control_flow.branch.else.add" ]
900,028
900,029
u697968316
cpp
p03086
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vvi = vector<vi>; using vll = vector<ll>; using vvll = vector<vll>; using vb = vector<bool>; using vs = vector<string>; typedef pair<ll, ll> P; #define bit(n) (1LL << (n)) //#define int long long #define all(v) v.begin(), v.end() #define sortAl(v) sort(all(v)) #define sortAlr(v) \ sort(v.begin(), v.end()); \ reverse(v.begin(), v.end()) #define rep(i, n) for (ll i = 0; i < n; i++) #define REP(i, n) for (ll i = 1; i < n; i++) #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++) template <class T> inline void chmax(T &a, T b) { a = std::max(a, b); } template <class T> inline void chmin(T &a, T b) { a = std::min(a, b); } #define mod (ll)(1e9 + 7) #define INF LLONG_MAX bool is_AGCT(char c) { if (c == 'A' || c == 'G' || c == 'C' || c == 'T') { return true; } return false; } signed main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); string s; cin >> s; ll ans = 0; ll n = s.size(); rep(l, n) { if (is_AGCT(s[l])) { for (int r = l + 1; r < n; r++) { if (is_AGCT(s[r])) { chmax(ans, r - l + 1); } else { l = r; break; } if (r == n - 1) { break; } } } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vvi = vector<vi>; using vll = vector<ll>; using vvll = vector<vll>; using vb = vector<bool>; using vs = vector<string>; typedef pair<ll, ll> P; #define bit(n) (1LL << (n)) //#define int long long #define all(v) v.begin(), v.end() #define sortAl(v) sort(all(v)) #define sortAlr(v) \ sort(v.begin(), v.end()); \ reverse(v.begin(), v.end()) #define rep(i, n) for (ll i = 0; i < n; i++) #define REP(i, n) for (ll i = 1; i < n; i++) #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++) template <class T> inline void chmax(T &a, T b) { a = std::max(a, b); } template <class T> inline void chmin(T &a, T b) { a = std::min(a, b); } #define mod (ll)(1e9 + 7) #define INF LLONG_MAX bool is_AGCT(char c) { if (c == 'A' || c == 'G' || c == 'C' || c == 'T') { return true; } return false; } signed main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); string s; cin >> s; ll ans = 0; ll n = s.size(); rep(l, n) { if (is_AGCT(s[l])) { for (int r = l; r < n; r++) { if (is_AGCT(s[r])) { chmax(ans, r - l + 1); } else { l = r; break; } if (r == n - 1) { break; } } } } cout << ans << endl; return 0; }
[ "control_flow.loop.for.initializer.change", "expression.operation.binary.remove" ]
900,032
900,033
u324825702
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int len = s.length(); int count = 0; int ans = 0; for (int i = 0; i < len - 1; i++) { if (s[i] == 'A' || s[i] == 'G' || s[i] == 'T' || s[i] == 'C') { count = 1; for (int j = i + 1; j < len; j++) { if (s[j] == 'A' || s[j] == 'G' || s[j] == 'T' || s[j] == 'C') { count++; } else { break; } } } ans = max(count, ans); count = 0; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int len = s.length(); int count = 0; int ans = 0; for (int i = 0; i < len; i++) { if (s[i] == 'A' || s[i] == 'G' || s[i] == 'T' || s[i] == 'C') { count = 1; for (int j = i + 1; j < len; j++) { if (s[j] == 'A' || s[j] == 'G' || s[j] == 'T' || s[j] == 'C') { count++; } else { break; } } } ans = max(count, ans); count = 0; } cout << ans << endl; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
900,036
900,037
u787005274
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int len = s.length(); int count = 0; int ans = 0; for (int i = 0; i < len - 1; i++) { if (s[i] == 'A' || s[i] == 'G' || s[i] == 'T' || s[i] == 'C') { count = 1; for (int j = i + 1; j < len; j++) { if (s[j] == 'A' || s[j] == 'G' || s[j] == 'T' || s[j] == 'C') { count++; } else { break; } } } ans = max(count, ans); } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int len = s.length(); int count = 0; int ans = 0; for (int i = 0; i < len; i++) { if (s[i] == 'A' || s[i] == 'G' || s[i] == 'T' || s[i] == 'C') { count = 1; for (int j = i + 1; j < len; j++) { if (s[j] == 'A' || s[j] == 'G' || s[j] == 'T' || s[j] == 'C') { count++; } else { break; } } } ans = max(count, ans); count = 0; } cout << ans << endl; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove", "assignment.add" ]
900,038
900,037
u787005274
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int a = 0; int b = 0; for (int i = 0; i < S.size(); i++) { if (S.at(i) == 'A' || S.at(i) == 'T' || S.at(i) == 'C' || S.at(i) == 'G') { a++; } else { b = max(b, a); a = 0; } } cout << b << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int a = 0; int b = 0; for (int i = 0; i < S.size(); i++) { if (S.at(i) == 'A' || S.at(i) == 'T' || S.at(i) == 'C' || S.at(i) == 'G') { a++; } else { b = max(b, a); a = 0; } } cout << max(b, a) << endl; }
[ "call.add", "call.arguments.add" ]
900,039
900,040
u387371565
cpp
p03086
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { string s; cin >> s; int n = s.size(); int length_of_longest_ACGT = 0; //先頭 for (int i = 0; i < n - 1; i++) { // i番目以降 int temp = 0; for (int j = i; j < n; j++) { if (s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T') temp++; else break; } length_of_longest_ACGT = max(length_of_longest_ACGT, temp); } cout << length_of_longest_ACGT << endl; }
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { string s; cin >> s; int n = s.size(); int length_of_longest_ACGT = 0; //先頭 for (int i = 0; i < n; i++) { // i番目以降 int temp = 0; for (int j = i; j < n; j++) { if (s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T') temp++; else break; } length_of_longest_ACGT = max(length_of_longest_ACGT, temp); } cout << length_of_longest_ACGT << endl; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
900,041
900,042
u477343425
cpp
p03086
#include <bits/stdc++.h> #define rep(i, a, n) for (ll i = a; i < n; i++) #define per(i, a, n) for (ll i = n - 1; i >= a; i--) #define fill0(n) setfill('0') << right << setw(n) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define LONGMAX 1e18 #define INTMAX 1000000000 using namespace std; typedef long long ll; typedef pair<ll, ll> P; const ll mod = 1e9 + 7; const long double EPS = 0.0000000001; string s; int check(string sub) { int ret = 0; for (int i = 0; i < sub.size(); i++) { if (sub[i] == 'A' or sub[i] == 'C' or sub[i] == 'G' or sub[i] == 'T') { continue; } else { return ret; } } return sub.size(); } int main() { cin >> s; int ans = 0; for (int i = 0; i < s.size(); i++) { for (int j = s.size(); j >= i + 1; j--) { string sub = s.substr(i, j); ans = max(ans, check(sub)); } } cout << ans << endl; }
#include <bits/stdc++.h> #define rep(i, a, n) for (ll i = a; i < n; i++) #define per(i, a, n) for (ll i = n - 1; i >= a; i--) #define fill0(n) setfill('0') << right << setw(n) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define LONGMAX 1e18 #define INTMAX 1000000000 using namespace std; typedef long long ll; typedef pair<ll, ll> P; const ll mod = 1e9 + 7; const long double EPS = 0.0000000001; string s; int check(string sub) { int ret = 0; for (int i = 0; i < sub.size(); i++) { if (sub[i] == 'A' or sub[i] == 'C' or sub[i] == 'G' or sub[i] == 'T') { continue; } else { return ret; } } return sub.size(); } int main() { cin >> s; int ans = 0; for (int i = 0; i < s.size(); i++) { for (int j = s.size(); j >= i + 1; j--) { string sub = s.substr(i, j - i); // cout << i <<"\t"<<j-i << "\t" <<sub << endl; ans = max(ans, check(sub)); } } cout << ans << endl; }
[ "assignment.change" ]
900,043
900,044
u255001744
cpp
p03086
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) typedef long long ll; // Welcome to my source code! int main() { string s; cin >> s; int cnt = 0, maxc = 0; REP(i, s.size()) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') cnt++; else { maxc = max(maxc, cnt); cnt = 0; } } cout << maxc << endl; }
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) typedef long long ll; // Welcome to my source code! int main() { string s; cin >> s; int cnt = 0, maxc = 0; REP(i, s.size()) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { cnt++; maxc = max(maxc, cnt); } else cnt = 0; } cout << maxc << endl; }
[ "control_flow.branch.else.add" ]
900,045
900,046
u440217234
cpp
p03086
#include <bits/stdc++.h> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define printd(x) printf("%.12f\n", ans); #define print(x) cout << (x) << endl; #define Yes() cout << "Yes" << endl; #define No() cout << "No" << endl; #define YES() cout << "YES" << endl; #define NO() cout << "NO" << endl; #define all(x) (x).begin(), (x).end() #define printa(x, n) \ for (ll i = 0; i < n; i++) { \ cout << (x[i]) << " "; \ } \ cout << endl; template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; } template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } using namespace std; using ll = long long; using pll = pair<ll, ll>; int main(void) { string s; cin >> s; s += 'u'; int ans = 0; int num = 0; rep(i, s.size()) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { num++; } else chmax(ans, num); } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define printd(x) printf("%.12f\n", ans); #define print(x) cout << (x) << endl; #define Yes() cout << "Yes" << endl; #define No() cout << "No" << endl; #define YES() cout << "YES" << endl; #define NO() cout << "NO" << endl; #define all(x) (x).begin(), (x).end() #define printa(x, n) \ for (ll i = 0; i < n; i++) { \ cout << (x[i]) << " "; \ } \ cout << endl; template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; } template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } using namespace std; using ll = long long; using pll = pair<ll, ll>; int main(void) { string s; cin >> s; s += 'u'; int ans = 0; int num = 0; rep(i, s.size()) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { num++; } else { chmax(ans, num); num = 0; } } cout << ans << endl; return 0; }
[ "assignment.add" ]
900,066
900,067
u174509352
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main(void) { string s; cin >> s; int mx = 0; for (int i = 0; i < s.size(); i++) { for (int j = i + 1; j < s.size(); j++) { string t = s.substr(i, j - i); // cout << t << endl; bool check = true; for (int k = 0; k < t.size(); k++) { if (t[k] != 'A' && t[k] != 'C' && t[k] != 'G' && t[k] != 'T') check = false; } if (check) mx = max(mx, (int)t.size()); } } if ((s[0] == 'A' || s[0] == 'C' || s[0] == 'G' || s[0] == 'T') && s.size() == 1) mx = 1; cout << mx << endl; }
#include <bits/stdc++.h> using namespace std; int main(void) { string s; cin >> s; int mx = 0; for (int i = 0; i < s.size(); i++) { for (int j = i + 1; j < s.size() + 1; j++) { string t = s.substr(i, j - i); // cout << t << endl; bool check = true; for (int k = 0; k < t.size(); k++) { if (t[k] != 'A' && t[k] != 'C' && t[k] != 'G' && t[k] != 'T') check = false; } if (check) mx = max(mx, (int)t.size()); } } if ((s[0] == 'A' || s[0] == 'C' || s[0] == 'G' || s[0] == 'T') && s.size() == 1) mx = 1; cout << mx << endl; }
[ "control_flow.loop.for.condition.change", "misc.off_by_one" ]
900,074
900,075
u512624048
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main(void) { string s; cin >> s; int mx = 0; for (int i = 0; i < s.size() - 1; i++) { for (int j = i + 1; j < s.size(); j++) { string t = s.substr(i, j - i); bool check = true; for (int k = 0; k < t.size(); k++) { if (t[k] != 'A' && t[k] != 'C' && t[k] != 'G' && t[k] != 'T') check = false; } if (check) mx = max(mx, (int)t.size()); } } if ((s[0] == 'A' || s[0] == 'C' || s[0] == 'G' || s[0] == 'T') && s.size() == 1) mx = 1; cout << mx << endl; }
#include <bits/stdc++.h> using namespace std; int main(void) { string s; cin >> s; int mx = 0; for (int i = 0; i < s.size(); i++) { for (int j = i + 1; j < s.size() + 1; j++) { string t = s.substr(i, j - i); // cout << t << endl; bool check = true; for (int k = 0; k < t.size(); k++) { if (t[k] != 'A' && t[k] != 'C' && t[k] != 'G' && t[k] != 'T') check = false; } if (check) mx = max(mx, (int)t.size()); } } if ((s[0] == 'A' || s[0] == 'C' || s[0] == 'G' || s[0] == 'T') && s.size() == 1) mx = 1; cout << mx << endl; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove", "misc.off_by_one" ]
900,076
900,075
u512624048
cpp
p03086
// C++ includes used for precompiling -*- C++ -*- // Copyright (C) 2003-2013 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. /** @file stdc++.h * This is an implementation file for a precompiled header. */ // 17.4.1.2 Headers // C #ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #if __cplusplus >= 201103L #include <ccomplex> #include <cfenv> #include <cinttypes> // #include <cstdalign> #include <cstdbool> #include <cstdint> #include <ctgmath> #include <cwchar> #include <cwctype> #endif // C++ #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #if __cplusplus >= 201103L #include <array> #include <atomic> #include <chrono> #include <condition_variable> #include <forward_list> #include <future> #include <initializer_list> #include <mutex> #include <random> #include <ratio> #include <regex> #include <scoped_allocator> #include <system_error> #include <thread> #include <tuple> #include <type_traits> #include <typeindex> #include <unordered_map> #include <unordered_set> #endif using namespace std; typedef long long ll; int main() { string b; cin >> b; ll count = 0, max = 0; for (ll i = 0; i < b.length(); i++) { if (b[i] == 'A' || b[i] == 'C' || b[i] == 'G' || b[i] == 'T') { count++; } else { if (max <= count) { max = count; } count = 0; } } if (count != 0) { max = count; } cout << max << endl; return 0; }
// C++ includes used for precompiling -*- C++ -*- // Copyright (C) 2003-2013 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. /** @file stdc++.h * This is an implementation file for a precompiled header. */ // 17.4.1.2 Headers // C #ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #if __cplusplus >= 201103L #include <ccomplex> #include <cfenv> #include <cinttypes> // #include <cstdalign> #include <cstdbool> #include <cstdint> #include <ctgmath> #include <cwchar> #include <cwctype> #endif // C++ #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #if __cplusplus >= 201103L #include <array> #include <atomic> #include <chrono> #include <condition_variable> #include <forward_list> #include <future> #include <initializer_list> #include <mutex> #include <random> #include <ratio> #include <regex> #include <scoped_allocator> #include <system_error> #include <thread> #include <tuple> #include <type_traits> #include <typeindex> #include <unordered_map> #include <unordered_set> #endif using namespace std; typedef long long ll; int main() { string b; cin >> b; ll count = 0, max = 0; for (ll i = 0; i < b.length(); i++) { if (b[i] == 'A' || b[i] == 'C' || b[i] == 'G' || b[i] == 'T') { count++; } else { if (max <= count) { max = count; } count = 0; } } if (max <= count) { max = count; } cout << max << endl; return 0; }
[ "control_flow.branch.if.condition.change", "expression.operation.binary.remove" ]
900,077
900,078
u139458416
cpp
p03086
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<ll, ll> PL; const ll mod = 1000000007; const ll MOD = 1000000007; const ll INF = 1LL << 60; #define PI (acos(-1)) ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; } vector<ll> divisor(ll n) { vector<ll> ret; for (ll i = 1; i * i <= n; i++) { if (n % i == 0) { ret.push_back(i); if (i * i != n) ret.push_back(n / i); } } sort(begin(ret), end(ret)); return (ret); } const ll MAX = 510000; ll fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (ll i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 ll COM(ll n, ll k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } struct BIT { int n; vector<int> bit; BIT() { init(); } BIT(int n) : n(n) { init(); } void init() { bit.clear(); bit.resize(n + 1, 0); } int sum(int i) { int s = 0; while (i > 0) { s += bit[i]; i -= i & -i; } return s; } int sum(int x, int y) { return sum(y) - sum(x - 1); } void add(int i, int x) { while (i <= n) { bit[i] += x; i += i & -i; } } int lower_bound(int w) { if (w <= 0) return 0; int x = 0, r = 1; while (r < n) r <<= 1; for (int k = r; k > 0; k >>= 1) { if (x + k <= n && bit[x + k] < w) { w -= bit[x + k]; x += k; } } return x + 1; } }; // 文字列t ->整数 atoi(t.c_str()); // 文字列t ->long long整数 stoll(t); ローカルではつかえない long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } // a^{-1} mod を計算する long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); } struct UnionFind { vector<int> par; UnionFind(int n) : par(n, -1) {} void init(int n) { par.assign(n, -1); } int root(int x) { if (par[x] < 0) return x; else return par[x] = root(par[x]); } bool issame(int x, int y) { return root(x) == root(y); } bool merge(int x, int y) { x = root(x); y = root(y); if (x == y) return false; if (par[x] > par[y]) swap(x, y); // merge technique par[x] += par[y]; par[y] = x; return true; } int size(int x) { return -par[root(x)]; } }; struct LazySegmentTree { // private: ll n; vector<ll> node, lazy; // public: LazySegmentTree(vector<ll> v) { int sz = (int)v.size(); n = 1; while (n < sz) n *= 2; node.resize(2 * n - 1); lazy.resize(2 * n - 1, 0); for (int i = 0; i < sz; i++) node[i + n - 1] = v[i]; for (int i = n - 2; i >= 0; i--) node[i] = node[i * 2 + 1] + node[i * 2 + 2]; } void eval(int k, int l, int r) { if (lazy[k] != 0) { node[k] += lazy[k]; if (r - l > 1) { lazy[2 * k + 1] += lazy[k] / 2; lazy[2 * k + 2] += lazy[k] / 2; } lazy[k] = 0; } } void add(int a, int b, ll x, int k = 0, int l = 0, int r = -1) { if (r < 0) r = n; eval(k, l, r); if (b <= l || r <= a) return; if (a <= l && r <= b) { lazy[k] += (r - l) * x; eval(k, l, r); } else { add(a, b, x, 2 * k + 1, l, (l + r) / 2); add(a, b, x, 2 * k + 2, (l + r) / 2, r); node[k] = node[2 * k + 1] + node[2 * k + 2]; } } ll getsum(int a, int b, int k = 0, int l = 0, int r = -1) { if (r < 0) r = n; eval(k, l, r); if (b <= l || r <= a) return 0; if (a <= l && r <= b) return node[k]; ll vl = getsum(a, b, 2 * k + 1, l, (l + r) / 2); ll vr = getsum(a, b, 2 * k + 2, (l + r) / 2, r); return vl + vr; } }; ll digit_sum(ll v) { ll ret = 0; while (v) { ret += (v % 10); v /= 10; } return ret; } ll a[202020]; ll solve() { string s; cin >> s; ll ans = 0, cnt = 0; for (int i = 0; i < s.length(); i++) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { cnt++; } else { ans = max(ans, cnt); cnt = 0; } } cout << ans << endl; return 0; } int main() { // cout.precision(10); ios::sync_with_stdio(false); cin.tie(0); solve(); }
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<ll, ll> PL; const ll mod = 1000000007; const ll MOD = 1000000007; const ll INF = 1LL << 60; #define PI (acos(-1)) ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; } vector<ll> divisor(ll n) { vector<ll> ret; for (ll i = 1; i * i <= n; i++) { if (n % i == 0) { ret.push_back(i); if (i * i != n) ret.push_back(n / i); } } sort(begin(ret), end(ret)); return (ret); } const ll MAX = 510000; ll fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (ll i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 ll COM(ll n, ll k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } struct BIT { int n; vector<int> bit; BIT() { init(); } BIT(int n) : n(n) { init(); } void init() { bit.clear(); bit.resize(n + 1, 0); } int sum(int i) { int s = 0; while (i > 0) { s += bit[i]; i -= i & -i; } return s; } int sum(int x, int y) { return sum(y) - sum(x - 1); } void add(int i, int x) { while (i <= n) { bit[i] += x; i += i & -i; } } int lower_bound(int w) { if (w <= 0) return 0; int x = 0, r = 1; while (r < n) r <<= 1; for (int k = r; k > 0; k >>= 1) { if (x + k <= n && bit[x + k] < w) { w -= bit[x + k]; x += k; } } return x + 1; } }; // 文字列t ->整数 atoi(t.c_str()); // 文字列t ->long long整数 stoll(t); ローカルではつかえない long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } // a^{-1} mod を計算する long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); } struct UnionFind { vector<int> par; UnionFind(int n) : par(n, -1) {} void init(int n) { par.assign(n, -1); } int root(int x) { if (par[x] < 0) return x; else return par[x] = root(par[x]); } bool issame(int x, int y) { return root(x) == root(y); } bool merge(int x, int y) { x = root(x); y = root(y); if (x == y) return false; if (par[x] > par[y]) swap(x, y); // merge technique par[x] += par[y]; par[y] = x; return true; } int size(int x) { return -par[root(x)]; } }; struct LazySegmentTree { // private: ll n; vector<ll> node, lazy; // public: LazySegmentTree(vector<ll> v) { int sz = (int)v.size(); n = 1; while (n < sz) n *= 2; node.resize(2 * n - 1); lazy.resize(2 * n - 1, 0); for (int i = 0; i < sz; i++) node[i + n - 1] = v[i]; for (int i = n - 2; i >= 0; i--) node[i] = node[i * 2 + 1] + node[i * 2 + 2]; } void eval(int k, int l, int r) { if (lazy[k] != 0) { node[k] += lazy[k]; if (r - l > 1) { lazy[2 * k + 1] += lazy[k] / 2; lazy[2 * k + 2] += lazy[k] / 2; } lazy[k] = 0; } } void add(int a, int b, ll x, int k = 0, int l = 0, int r = -1) { if (r < 0) r = n; eval(k, l, r); if (b <= l || r <= a) return; if (a <= l && r <= b) { lazy[k] += (r - l) * x; eval(k, l, r); } else { add(a, b, x, 2 * k + 1, l, (l + r) / 2); add(a, b, x, 2 * k + 2, (l + r) / 2, r); node[k] = node[2 * k + 1] + node[2 * k + 2]; } } ll getsum(int a, int b, int k = 0, int l = 0, int r = -1) { if (r < 0) r = n; eval(k, l, r); if (b <= l || r <= a) return 0; if (a <= l && r <= b) return node[k]; ll vl = getsum(a, b, 2 * k + 1, l, (l + r) / 2); ll vr = getsum(a, b, 2 * k + 2, (l + r) / 2, r); return vl + vr; } }; ll digit_sum(ll v) { ll ret = 0; while (v) { ret += (v % 10); v /= 10; } return ret; } ll a[202020]; ll solve() { string s; cin >> s; ll ans = 0, cnt = 0; for (int i = 0; i < s.length(); i++) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { cnt++; } else { ans = max(ans, cnt); cnt = 0; } } cout << max(ans, cnt) << endl; return 0; } int main() { // cout.precision(10); ios::sync_with_stdio(false); cin.tie(0); solve(); }
[ "call.add", "call.arguments.add" ]
900,079
900,080
u644778646
cpp
p03086
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; ++i) #define rep1(i, n) for (int i = 1; i <= n; ++i) int MOD = 1000000007; bool judge(char s) { bool res = false; if (s == 'A') res = true; if (s == 'T') res = true; if (s == 'C') res = true; if (s == 'G') res = true; return res; } signed main() { string s; cin >> s; int n = (int)s.length(); int res = 0; char last = 'H'; int buf = 0; s += '.'; rep(i, n) { if (judge(s[i])) { buf++; } else { res = max(res, buf); buf = 0; } } cout << res << endl; return 0; }
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; ++i) #define rep1(i, n) for (int i = 1; i <= n; ++i) int MOD = 1000000007; bool judge(char s) { bool res = false; if (s == 'A') res = true; if (s == 'T') res = true; if (s == 'C') res = true; if (s == 'G') res = true; return res; } signed main() { string s; cin >> s; int n = (int)s.length(); int res = 0; char last = 'H'; int buf = 0; s += '.'; rep(i, n + 1) { if (judge(s[i])) { buf++; } else { res = max(res, buf); buf = 0; } } cout << res << endl; return 0; }
[ "expression.operation.binary.add" ]
900,084
900,085
u313043608
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { int ans = 0, res = 0; string s; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') { ans = max(ans, res); res = 0; } else res++; } cout << ans; }
#include <bits/stdc++.h> using namespace std; int main() { int ans = 0, res = 0; string s; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') { ans = max(ans, res); res = 0; } else res++; } cout << max(ans, res); }
[ "call.add", "call.arguments.add" ]
900,088
900,089
u873762144
cpp
p03086
#include <bits/stdc++.h> #define endl '\n' #define fastIO \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define int long long int #define trace1(x) cout << #x << ": " << x << endl #define trace2(x, y) cout << #x << ": " << x << " | " << #y << ": " << y << endl #define trace3(x, y, z) \ cout << #x << ":" << x << " | " << #y << ": " << y << " | " << #z << ": " \ << z << endl #define trace4(a, b, c, d) \ cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " \ << c << " | " << #d << ": " << d << endl #define trace5(a, b, c, d, e) \ cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " \ << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl #define trace6(a, b, c, d, e, f) \ cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " \ << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " \ << #f << ": " << f << endl #define pb push_back #define ff first #define ss second #define all(v) (v).begin(), (v).end() using namespace std; int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } int lcm(int a, int b) { return (a * b) / gcd(a, b); } int ncr(int n, int k) { int res = 1; if (k > n - k) k = n - k; for (int i = 0; i < k; ++i) { res *= (n - i); res /= (i + 1); } return res; } int fibonacci(int n) { double phi = (1LL + sqrt(5)) / (double)2; int nth_fib = round(pow(phi, n) / sqrt(5)); return nth_fib; } bool checkYear(int year) { if (year % 400 == 0) return true; if (year % 100 == 0) return false; if (year % 4 == 0) return true; return false; } signed main() { fastIO string s; cin >> s; int count = 0, 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); } } ans = max(ans, count); cout << ans; // int n; // cin >> n; // int ar[n]; // for(int i =0; i<n; i++) cin >> ar[i]; // sort(ar, ar+n); // int pre[n], suf[n]; // pre[0] = ar[0]; suf[n-1] = ar[n-1]; // bool same = false; // for(int i = 1; i < n; i++){ // pre[i] = gcd(pre[i-1], ar[i]); // suf[n-1-i] = gcd(suf[n-i], ar[n-1-i]); // } // int maxgcd = gcd(ar[0], ar[n-1]); // for(int i = 1; i < n-1; i++){ // maxgcd = max(maxgcd, gcd(pre[i-1],suf[i+1])); // // trace1(gcd(pre[i-1],suf[i+1])); // } // cout << maxgcd << endl; return 0; }
#include <bits/stdc++.h> #define endl '\n' #define fastIO \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define int long long int #define trace1(x) cout << #x << ": " << x << endl #define trace2(x, y) cout << #x << ": " << x << " | " << #y << ": " << y << endl #define trace3(x, y, z) \ cout << #x << ":" << x << " | " << #y << ": " << y << " | " << #z << ": " \ << z << endl #define trace4(a, b, c, d) \ cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " \ << c << " | " << #d << ": " << d << endl #define trace5(a, b, c, d, e) \ cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " \ << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl #define trace6(a, b, c, d, e, f) \ cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " \ << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " \ << #f << ": " << f << endl #define pb push_back #define ff first #define ss second #define all(v) (v).begin(), (v).end() using namespace std; int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } int lcm(int a, int b) { return (a * b) / gcd(a, b); } int ncr(int n, int k) { int res = 1; if (k > n - k) k = n - k; for (int i = 0; i < k; ++i) { res *= (n - i); res /= (i + 1); } return res; } int fibonacci(int n) { double phi = (1LL + sqrt(5)) / (double)2; int nth_fib = round(pow(phi, n) / sqrt(5)); return nth_fib; } bool checkYear(int year) { if (year % 400 == 0) return true; if (year % 100 == 0) return false; if (year % 4 == 0) return true; return false; } signed main() { fastIO string s; cin >> s; int count = 0, 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; } } ans = max(ans, count); cout << ans; // int n; // cin >> n; // int ar[n]; // for(int i =0; i<n; i++) cin >> ar[i]; // sort(ar, ar+n); // int pre[n], suf[n]; // pre[0] = ar[0]; suf[n-1] = ar[n-1]; // bool same = false; // for(int i = 1; i < n; i++){ // pre[i] = gcd(pre[i-1], ar[i]); // suf[n-1-i] = gcd(suf[n-i], ar[n-1-i]); // } // int maxgcd = gcd(ar[0], ar[n-1]); // for(int i = 1; i < n-1; i++){ // maxgcd = max(maxgcd, gcd(pre[i-1],suf[i+1])); // // trace1(gcd(pre[i-1],suf[i+1])); // } // cout << maxgcd << endl; return 0; }
[ "assignment.add" ]
900,090
900,091
u007291572
cpp
p03086
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <vector> using namespace std; #define ll long long #define ld long double constexpr double EPS = 1e-16; void preambule() { cin.tie(0); cout.precision(16); cout << fixed; } string s; void input() { cin >> s; } void solve1() { int ans = 0; string good = "ACGT"; int cur = 0; for (auto &&i : s) { if (good.find(i) != string::npos) { ++cur; } else { ans = max(ans, cur); cur = 0; } } cout << ans; } int main() { #ifdef _DEBUG freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif preambule(); input(); solve1(); }
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <vector> using namespace std; #define ll long long #define ld long double constexpr double EPS = 1e-16; void preambule() { cin.tie(0); cout.precision(16); cout << fixed; } string s; void input() { cin >> s; } void solve1() { int ans = 0; string good = "ACGT"; int cur = 0; for (auto &&i : s) { if (good.find(i) != string::npos) { ++cur; } else { ans = max(ans, cur); cur = 0; } } cout << max(ans, cur); } int main() { #ifdef _DEBUG freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif preambule(); input(); solve1(); }
[ "call.add", "call.arguments.add" ]
900,096
900,097
u358815527
cpp
p03086
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) typedef long long ll; int main() { string s; cin >> s; int d[] = {'A', 'C', 'G', 'T'}; int ans = 0; int x = 0; rep(i, s.size()) { rep(j, 4) { if (s[i] == d[j]) { x++; break; } } if (s[i] != d[0] && s[i] != d[1] && s[i] != d[2] && s[i] != d[3] || i == s.size() - 1) ans = max(x, ans); } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) typedef long long ll; int main() { string s; cin >> s; int d[] = {'A', 'C', 'G', 'T'}; int ans = 0; int x = 0; rep(i, s.size()) { rep(j, 4) { if (s[i] == d[j]) { x++; break; } } if (s[i] != d[0] && s[i] != d[1] && s[i] != d[2] && s[i] != d[3] || i == s.size() - 1) { ans = max(x, ans); x = 0; } } cout << ans << endl; }
[ "assignment.add" ]
900,111
900,112
u902803949
cpp
p03086
#include <iostream> using namespace std; int main() { int t = 0, b; string a; cin >> a; for (int k = 0; k < a.size(); k++) { if (a[k] == 'A' || a[k] == 'T' || a[k] == 'C' || a[k] == 'G') { t++; if (b < t) b = t; } else t = 0; } cout << b; return 0; }
#include <iostream> using namespace std; int main() { int t = 0, b = 0; string a; cin >> a; for (int k = 0; k < a.size(); k++) { if (a[k] == 'A' || a[k] == 'T' || a[k] == 'C' || a[k] == 'G') { t++; if (b < t) b = t; } else t = 0; } cout << b; return 0; }
[ "variable_declaration.value.change" ]
900,120
900,121
u311255336
cpp
p03086
#include <iomanip> #include <iostream> using namespace std; #define rep(i, a, n) for (int i = (a); i < (n); ++i) int main() { std::cin.tie(nullptr); // 標準入出力高速化 std::ios_base::sync_with_stdio(false); // SとS++の入出力出力を非同期 string s; cin >> s; int num = 0, ans = 0; rep(i, 0, s.size()) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') num++; if (ans < num) ans = num; else num = 0; } cout << ans << endl; }
#include <iomanip> #include <iostream> using namespace std; #define rep(i, a, n) for (int i = (a); i < (n); ++i) int main() { std::cin.tie(nullptr); // 標準入出力高速化 std::ios_base::sync_with_stdio(false); // SとS++の入出力出力を非同期 string s; cin >> s; int num = 0, ans = 0; rep(i, 0, s.size()) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { num++; if (ans < num) { ans = num; } } else { num = 0; } } cout << ans << endl; }
[]
900,129
900,130
u277956366
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { int i = 0; string s; cin >> s; int count = 0; int maxi = 0; for (int i = 0; i < s.size(); i++) { if (s.at(i) == 'A' || s.at(i) == 'G' || s.at(i) == 'T' || s.at(i) == 'C') { count++; } else { maxi = max(maxi, count); count = 0; } } cout << maxi << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int i = 0; string s; cin >> s; int count = 0; int maxi = 0; for (int i = 0; i < s.size(); i++) { if (s.at(i) == 'A' || s.at(i) == 'G' || s.at(i) == 'T' || s.at(i) == 'C') { count++; } else { maxi = max(maxi, count); count = 0; } } cout << max(maxi, count) << endl; }
[ "call.add", "call.arguments.add" ]
900,138
900,139
u990037841
cpp
p03086
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; using vv = vector<vector<ll>>; template <class _t> inline bool chmax(_t &a, _t b) { if (a < b) { a = b; return true; } return false; } template <class _t> inline bool chmin(_t &a, _t b) { if (a > b) { a = b; return true; } return false; } const long long inf = 1ll << 60; const long long mod = 1000000007; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, -1, 0, 1}; int main() { string s; cin >> s; int ans = 0; for (int i = 1; i <= s.size(); i++) { for (int j = 0; j < s.size() - i; j++) { bool ok = true; for (int k = 0; k < i; k++) { if (s[j + k] != 'A' && s[j + k] != 'C' && s[j + k] != 'G' && s[j + k] != 'T') ok = false; } if (ok) ans = max(ans, i); } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; using vv = vector<vector<ll>>; template <class _t> inline bool chmax(_t &a, _t b) { if (a < b) { a = b; return true; } return false; } template <class _t> inline bool chmin(_t &a, _t b) { if (a > b) { a = b; return true; } return false; } const long long inf = 1ll << 60; const long long mod = 1000000007; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, -1, 0, 1}; int main() { string s; cin >> s; int ans = 0; for (int i = 1; i <= s.size(); i++) { for (int j = 0; j <= s.size() - i; j++) { bool ok = true; for (int k = 0; k < i; k++) { if (s[j + k] != 'A' && s[j + k] != 'C' && s[j + k] != 'G' && s[j + k] != 'T') ok = false; } if (ok) ans = max(ans, i); } } cout << ans << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
900,146
900,147
u807394250
cpp
p03086
#include <algorithm> #include <bitset> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define INF 100000000000 #define MOD 1000000007 // 10^9+7 using namespace std; using ll = long long; using P = pair<int, int>; // 負の数にも対応した % 演算 long long mod(long long val, long long m) { long long res = val % m; if (res < 0) res += m; return res; } int main() { string s; cin >> s; int ans = 0; rep(i, s.length()) { int tmp = 0; for (int j = i; j < s.length() - 1; j++) { if (s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T') { tmp++; if (s[j + 1] != 'A' && s[j + 1] != 'C' && s[j + 1] != 'G' && s[j + 1] != 'T') { break; } } } ans = max(ans, tmp); } cout << ans; cout << endl; return 0; }
#include <algorithm> #include <bitset> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define INF 100000000000 #define MOD 1000000007 // 10^9+7 using namespace std; using ll = long long; using P = pair<int, int>; // 負の数にも対応した % 演算 long long mod(long long val, long long m) { long long res = val % m; if (res < 0) res += m; return res; } int main() { string s; cin >> s; int ans = 0; rep(i, s.length()) { int tmp = 0; for (int j = i; j < s.length() - 0; j++) { if (s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T') { tmp++; if (s[j + 1] != 'A' && s[j + 1] != 'C' && s[j + 1] != 'G' && s[j + 1] != 'T') { break; } } } ans = max(ans, tmp); } cout << ans; cout << endl; return 0; }
[ "literal.number.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
900,150
900,151
u366581326
cpp
p03086
#include <iostream> #include <math.h> #include <string> using namespace std; int main(void) { string S; cin >> S; int count = 0; int max = 0; for (int i = 0; i < S.length() - 1; i++) { if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') { count++; if (count > max) { max = count; } } else { count = 0; } } cout << max << endl; }
#include <iostream> #include <math.h> #include <string> using namespace std; int main(void) { string S; cin >> S; int count = 0; int max = 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 > max) { max = count; } } else { count = 0; } } cout << max << endl; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
900,165
900,166
u479060428
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int i = 0; int j = 0; int k = 0; for (i = 0; i < S.size() - 1; i++) { if (S[i] == 'A' || S[i] == 'T' || S[i] == 'C' || S[i] == 'G') { j += 1; } else { k = max(k, j); j = 0; } } cout << max(k, j) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int i = 0; int j = 0; int k = 0; for (i = 0; i <= S.size() - 1; i++) { if (S[i] == 'A' || S[i] == 'T' || S[i] == 'C' || S[i] == 'G') { j += 1; } else { k = max(k, j); j = 0; } } cout << max(k, j) << endl; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
900,167
900,168
u511837039
cpp
p03086
#include <bits/stdc++.h> using namespace std; #define rep0(i, n) for (i = 0; i < n; i++) #define test(a) cout << "*" << a << endl int main() { string s; int i, j; int sLongMax = 0; int sLong = 0; cin >> s; rep0(i, s.size()) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { sLong++; if (i == s.size() - 1) sLongMax = sLong; } else { if (sLongMax < sLong) { sLongMax = sLong; } sLong = 0; } } cout << sLongMax << endl; }
#include <bits/stdc++.h> using namespace std; #define rep0(i, n) for (i = 0; i < n; i++) #define test(a) cout << "*" << a << endl int main() { string s; int i, j; int sLongMax = 0; int sLong = 0; cin >> s; rep0(i, s.size()) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { sLong++; if (i == s.size() - 1 && sLongMax < sLong) { /*超注意*/ sLongMax = sLong; } } else { if (sLongMax < sLong) { sLongMax = sLong; } sLong = 0; } } cout << sLongMax << endl; }
[ "control_flow.branch.if.condition.change" ]
900,203
900,204
u302234425
cpp
p03086
#define _USE_MATH_DEFINES #include <algorithm> #include <cstdlib> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <stdio.h> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) int main() { string S; cin >> S; ll N = S.length(); ll out = 0; rep(i, N) { ll tmp = 0; if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') { tmp++; for (ll j = i + 1; j < N - i; j++) { if (S[j] == 'A' || S[j] == 'C' || S[j] == 'G' || S[j] == 'T') tmp++; else break; } if (tmp > out) out = tmp; } } cout << out << endl; return 0; }
#define _USE_MATH_DEFINES #include <algorithm> #include <cstdlib> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <stdio.h> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) int main() { string S; cin >> S; ll N = S.length(); ll out = 0; rep(i, N) { ll tmp = 0; if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') { tmp++; for (ll j = i + 1; j < N; j++) { if (S[j] == 'A' || S[j] == 'C' || S[j] == 'G' || S[j] == 'T') tmp++; else break; } if (tmp > out) out = tmp; } } cout << out << endl; return 0; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
900,211
900,212
u742595961
cpp
p03086
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long int ll; typedef vector<int> vi; #define rep(i, n) for (int i = 0; i < (n); ++i) #define Sort(a) sort(a.begin(), a.end()) const int INF = 1 << 30; const ll MOD = 1000000007; int check(string s) { rep(i, s.size()) { if (!(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')) return -1; } return s.size(); } int main(void) { string s; cin >> s; int ans = 0; for (int i = 0; i < s.size(); i++) { for (int j = i + 1; j <= s.size(); j++) { string str = s.substr(i, j); ans = max(ans, check(str)); // if (check(str) > 0) cout << str << endl; } } cout << ans << endl; return 0; }
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long int ll; typedef vector<int> vi; #define rep(i, n) for (int i = 0; i < (n); ++i) #define Sort(a) sort(a.begin(), a.end()) const int INF = 1 << 30; const ll MOD = 1000000007; int check(string s) { rep(i, s.size()) { if (!(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')) return -1; } return s.size(); } int main(void) { string s; cin >> s; int ans = 0; for (int i = 0; i < s.size(); i++) { for (int j = 1; j <= s.size() - i; j++) { string str = s.substr(i, j); ans = max(ans, check(str)); // cout << str << " " << check(str) << endl; } } cout << ans << endl; return 0; }
[ "control_flow.loop.for.initializer.change", "expression.operation.binary.remove", "control_flow.loop.for.condition.change" ]
900,215
900,216
u086294406
cpp
p03086
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long int ll; typedef vector<int> vi; #define rep(i, n) for (int i = 0; i < (n); ++i) #define Sort(a) sort(a.begin(), a.end()) const int INF = 1 << 30; const ll MOD = 1000000007; int check(string s) { rep(i, s.size()) { if (!(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')) return -1; } return s.size(); } int main(void) { string s; cin >> s; int ans = 0; for (int i = 0; i < s.size(); i++) { for (int j = i + 1; j < s.size(); j++) { string str = s.substr(i, j); ans = max(ans, check(str)); // if (check(str) > 0) cout << str << endl; } } cout << ans << endl; return 0; }
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long int ll; typedef vector<int> vi; #define rep(i, n) for (int i = 0; i < (n); ++i) #define Sort(a) sort(a.begin(), a.end()) const int INF = 1 << 30; const ll MOD = 1000000007; int check(string s) { rep(i, s.size()) { if (!(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')) return -1; } return s.size(); } int main(void) { string s; cin >> s; int ans = 0; for (int i = 0; i < s.size(); i++) { for (int j = 1; j <= s.size() - i; j++) { string str = s.substr(i, j); ans = max(ans, check(str)); // cout << str << " " << check(str) << endl; } } cout << ans << 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" ]
900,217
900,216
u086294406
cpp
p03086
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long int ll; typedef vector<int> vi; #define rep(i, n) for (int i = 0; i < (n); ++i) #define Sort(a) sort(a.begin(), a.end()) const int INF = 1 << 30; const ll MOD = 1000000007; int check(string s) { rep(i, s.size()) { if (!(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')) return -1; } return s.size(); } int main(void) { string s; cin >> s; int ans = 0; for (int i = 0; i < s.size(); i++) { for (int j = i + 1; j < s.size(); j++) { string str = s.substr(i, j); ans = max(ans, check(str)); } } cout << ans << endl; return 0; }
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long int ll; typedef vector<int> vi; #define rep(i, n) for (int i = 0; i < (n); ++i) #define Sort(a) sort(a.begin(), a.end()) const int INF = 1 << 30; const ll MOD = 1000000007; int check(string s) { rep(i, s.size()) { if (!(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')) return -1; } return s.size(); } int main(void) { string s; cin >> s; int ans = 0; for (int i = 0; i < s.size(); i++) { for (int j = 1; j <= s.size() - i; j++) { string str = s.substr(i, j); ans = max(ans, check(str)); // cout << str << " " << check(str) << endl; } } cout << ans << 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" ]
900,218
900,216
u086294406
cpp
p03086
#include <bits/stdc++.h> #include <numeric> #define REP(i, s, n) for (int i = s; i < n; ++i) #define rep(i, n) REP(i, 0, n) #define SORT(c) sort((c).begin(), (c).end()) #define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>()) #define IINF INT_MAX #define LLINF LLONG_MAX #define DEBUG false #define LL long long #define Dev 1000000007 // cout << (c)?"Yay!":":(" << endl; // sort(a.begin(), a.end(), std::greater<int>()); using namespace std; int main() { string s; cin >> s; int ans = 0; rep(i, s.size()) { REP(j, i + 1, s.size() - i) { string temp = s.substr(i, j); bool flag = false; rep(i, temp.size()) { if (temp[i] == 'A' || temp[i] == 'C' || temp[i] == 'G' || temp[i] == 'T') { continue; } else { flag = true; } } if (flag == false) ans = max(ans, (int)temp.size()); } } cout << ans << endl; }
#include <bits/stdc++.h> #include <numeric> #define REP(i, s, n) for (int i = s; i < n; ++i) #define rep(i, n) REP(i, 0, n) #define SORT(c) sort((c).begin(), (c).end()) #define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>()) #define IINF INT_MAX #define LLINF LLONG_MAX #define DEBUG false #define LL long long #define Dev 1000000007 // cout << (c)?"Yay!":":(" << endl; // sort(a.begin(), a.end(), std::greater<int>()); using namespace std; int main() { string s; cin >> s; int ans = 0; rep(i, s.size()) { REP(j, 1, s.size() - i + 1) { string temp = s.substr(i, j); // cout << temp << endl; bool flag = false; rep(i, temp.size()) { if (temp[i] == 'A' || temp[i] == 'C' || temp[i] == 'G' || temp[i] == 'T') { continue; } else { flag = true; } } if (flag == false) ans = max(ans, (int)temp.size()); } } cout << ans << endl; }
[ "expression.operation.binary.remove" ]
900,221
900,222
u393086221
cpp
p03086
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < (b); i++) #define rrep(i, a, b) for (int i = a; i >= (b); i--) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long; using P = pair<int, int>; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } const int INF = 2e9; const int MOD = 1e9 + 7; int main() { string s; cin >> s; string t = "ACGT"; int ans = 0; int cnt = 0; rep(i, 0, s.size()) { bool isACGT = false; rep(j, 0, t.size()) { if (s[i] == t[j]) isACGT = true; } if (isACGT) cnt++; else { chmax(ans, cnt); cnt = 0; } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < (b); i++) #define rrep(i, a, b) for (int i = a; i >= (b); i--) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long; using P = pair<int, int>; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } const int INF = 2e9; const int MOD = 1e9 + 7; int main() { string s; cin >> s; string t = "ACGT"; int ans = 0; int cnt = 0; rep(i, 0, s.size()) { bool isACGT = false; rep(j, 0, t.size()) { if (s[i] == t[j]) isACGT = true; } if (isACGT) { cnt++; chmax(ans, cnt); } else { cnt = 0; } } cout << ans << endl; return 0; }
[ "control_flow.branch.else.add" ]
900,228
900,229
u748577909
cpp
p03086
#include <stdio.h> int main() { char s[11]; scanf("%s", s); int max = 0; int count = 0; for (int i = 0; s[i] != '\0'; i++) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { count++; } else { if (max < count) { max = count; } count = 0; } } printf("%d", max); return 0; }
#include <stdio.h> int main() { char s[11]; scanf("%s", s); int max = 0; int count = 0; for (int i = 0; s[i] != '\0'; i++) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { count++; if (max < count) { max = count; } } else { count = 0; } } printf("%d", max); return 0; }
[ "control_flow.branch.else.add" ]
900,232
900,233
u527105447
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n; n = int(s.size()); int answer = 0; for (int i = 0; i < n; i++) { int tmp; for (int j = i; j < n; j++) { if (s.at(j) != 'A' and s.at(j) != 'T' and s.at(j) != 'G' and s.at(j) != 'C') { tmp = j - 1; break; } } answer = max(answer, tmp - i + 1); } cout << answer << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n; n = int(s.size()); int answer = 0; for (int i = 0; i < n; i++) { int tmp = n - 1; for (int j = i; j < n; j++) { if (s.at(j) != 'A' and s.at(j) != 'T' and s.at(j) != 'G' and s.at(j) != 'C') { tmp = j - 1; break; } } answer = max(answer, tmp - i + 1); } cout << answer << endl; }
[ "variable_declaration.value.change" ]
900,234
900,235
u391250239
cpp
p03086
#include <bits/stdc++.h> using namespace std; bool acgt(string st) { bool flag = 1; for (char c : st) { if (c != 'A' and c != 'C' and c != 'G' and c != 'T') flag = 0; } return flag; } int main() { string s; cin >> s; string ans = "0"; for (int i = 0; i < s.size(); i++) { for (int j = i; j < s.size(); j++) { string tmp = s.substr(i, j - i + 1); if (acgt(tmp)) { ans = (ans.size() > tmp.size() ? ans : tmp); } } } cout << ans.size() << endl; }
#include <bits/stdc++.h> using namespace std; bool acgt(string st) { bool flag = 1; for (char c : st) { if (c != 'A' and c != 'C' and c != 'G' and c != 'T') flag = 0; } return flag; } int main() { string s; cin >> s; string ans = ""; for (int i = 0; i < s.size(); i++) { for (int j = i; j < s.size(); j++) { string tmp = s.substr(i, j - i + 1); if (acgt(tmp)) { ans = (ans.size() > tmp.size() ? ans : tmp); } } } cout << ans.size() << endl; }
[ "literal.string.change" ]
900,238
900,239
u732578115
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main(void) { string S; cin >> S; int L, L_MAX; L = L_MAX = 0; for (int i = 0; i < S.size(); i++) { if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') { L++; // cout << S[i] << endl; } else { L_MAX = max(L_MAX, L); L = 0; } } cout << L_MAX << endl; }
#include <bits/stdc++.h> using namespace std; int main(void) { string S; cin >> S; int L, L_MAX; L = L_MAX = 0; for (int i = 0; i < S.size(); i++) { if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') { L++; L_MAX = max(L_MAX, L); // cout << S[i] << endl; } else { L = 0; } } cout << L_MAX << endl; }
[ "control_flow.branch.else.add" ]
900,240
900,241
u406634703
cpp
p03086
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string s; cin >> s; int ans = 0; int tmp = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') { tmp++; } else { ans = max(ans, tmp); tmp = 0; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string s; cin >> s; int ans = 0; int tmp = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') { tmp++; } else { ans = max(ans, tmp); tmp = 0; } } cout << max(ans, tmp) << endl; }
[ "call.add", "call.arguments.add" ]
900,242
900,243
u410878763
cpp
p03086
// Ruthless Coding #include <bits/stdc++.h> #define uni(x) (x).resize(unique(all(x)) - (x).begin()) #define fprint(v) \ for (auto x : v) \ cout << x << ' ' #define ALL(x) (x).begin(), (x).end() #define MP(x, y) make_pair(x, y) #define PII pair<int, int> #define SZ(x) int((x).size()) #define PB(x) push_back(x) #define ll long long #define S second #define F first #define nl '\n' using namespace std; void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } void __print(unsigned long long x) { cerr << x; } void __print(float x) { cerr << x; } void __print(double x) { cerr << x; } void __print(long double x) { cerr << x; } void __print(char x) { cerr << '\'' << x << '\''; } void __print(const char *x) { cerr << '\"' << x << '\"'; } void __print(const string &x) { cerr << '\"' << x << '\"'; } void __print(bool x) { cerr << (x ? "true" : "false"); } template <typename T, typename V> void __print(const pair<T, V> &x) { cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}'; } template <typename T> void __print(const T &x) { int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}"; } void _print() { cerr << "]\n"; } template <typename T, typename... V> void _print(T t, V... v) { __print(t); if (sizeof...(v)) cerr << ", "; _print(v...); } #ifndef ONLINE_JUDGE #define debug(x...) \ cerr << "[" << #x << "] = ["; \ _print(x) #else #define debug(x...) #endif mt19937_64 rnd; const int N = 2e5 + 5; int main() { ios_base::sync_with_stdio(0); cin.tie(0); string s; cin >> s; set<char> acgt = {'A', 'C', 'G', 'T'}; int n = SZ(s); int ans = 0; int ct = 0; for (int i = 0; i < n; i++) { if (acgt.find(s[i]) != acgt.end()) { ct++; } else { ans = max(ans, ct); } } ans = max(ans, ct); cout << ans; return 0; }
// Ruthless Coding #include <bits/stdc++.h> #define uni(x) (x).resize(unique(all(x)) - (x).begin()) #define fprint(v) \ for (auto x : v) \ cout << x << ' ' #define ALL(x) (x).begin(), (x).end() #define MP(x, y) make_pair(x, y) #define PII pair<int, int> #define SZ(x) int((x).size()) #define PB(x) push_back(x) #define ll long long #define S second #define F first #define nl '\n' using namespace std; void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } void __print(unsigned long long x) { cerr << x; } void __print(float x) { cerr << x; } void __print(double x) { cerr << x; } void __print(long double x) { cerr << x; } void __print(char x) { cerr << '\'' << x << '\''; } void __print(const char *x) { cerr << '\"' << x << '\"'; } void __print(const string &x) { cerr << '\"' << x << '\"'; } void __print(bool x) { cerr << (x ? "true" : "false"); } template <typename T, typename V> void __print(const pair<T, V> &x) { cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}'; } template <typename T> void __print(const T &x) { int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}"; } void _print() { cerr << "]\n"; } template <typename T, typename... V> void _print(T t, V... v) { __print(t); if (sizeof...(v)) cerr << ", "; _print(v...); } #ifndef ONLINE_JUDGE #define debug(x...) \ cerr << "[" << #x << "] = ["; \ _print(x) #else #define debug(x...) #endif mt19937_64 rnd; const int N = 2e5 + 5; int main() { ios_base::sync_with_stdio(0); cin.tie(0); string s; cin >> s; set<char> acgt = {'A', 'C', 'G', 'T'}; int n = SZ(s); int ans = 0; int ct = 0; for (int i = 0; i < n; i++) { if (acgt.find(s[i]) != acgt.end()) { ct++; } else { ans = max(ans, ct); ct = 0; } } ans = max(ans, ct); cout << ans; return 0; }
[ "assignment.add" ]
900,250
900,251
u048400646
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int max = 0; for (int i = 0; i < S.size() - 1; i++) { if ((S.at(i) == 'A') || (S.at(i) == 'C') || (S.at(i) == 'G') || (S.at(i) == 'T')) { if (max == 0) { max = 1; } for (int i2 = i + 1; i2 < S.size(); i2++) { if (!((S.at(i2) == 'A') || (S.at(i2) == 'C') || (S.at(i2) == 'G') || (S.at(i2) == 'T'))) { if (i2 - i > max) { max = i2 - i; } break; } else { if (i2 == S.size() - 1) { if (i2 + 1 - i > max) { max = i2 + 1 - i; } } } } } } cout << max << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int max = 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')) { if (max == 0) { max = 1; } for (int i2 = i + 1; i2 < S.size(); i2++) { if (!((S.at(i2) == 'A') || (S.at(i2) == 'C') || (S.at(i2) == 'G') || (S.at(i2) == 'T'))) { if (i2 - i > max) { max = i2 - i; } break; } else { if (i2 == S.size() - 1) { if (i2 + 1 - i > max) { max = i2 + 1 - i; } } } } } } cout << max << endl; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
900,258
900,259
u327750344
cpp
p03086
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = (int)(n); i > 0; i++) const int MOD = 1e9 + 7; int main() { string s; cin >> s; int cnt = 0; int ans = 0; int res = 0; rep(i, s.size()) { if (s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') cnt++; else { res = cnt; ans = max(res, ans); cnt = 0; } } ans = max(res, ans); cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = (int)(n); i > 0; i++) const int MOD = 1e9 + 7; int main() { string s; cin >> s; int cnt = 0; int ans = 0; int res = 0; rep(i, s.size()) { if (s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') cnt++; else { res = cnt; ans = max(res, ans); cnt = 0; } } ans = max(cnt, ans); cout << ans << endl; }
[ "assignment.value.change", "identifier.change", "call.arguments.change" ]
900,260
900,261
u297398560
cpp
p03086
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i) #define rep(i, n) REP(i, 0, n) #define square(x) pow(x 2.0) #define all(x) (x).begin(), (x).end() #define F first #define S second #define max_queue(x) priority_queue<x> #define min_queue(x) priority_queue<x, vector<x>, greater<x>> #define big_sort(v) \ sort(all(v), [](int a, int b) { return a > b; }) //大きい順にソート using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vs = vector<string>; #define co(x) cout << x << endl; #define cins(n, v) \ rep(i, n) { cin >> v.at(i); } #define couts(v) \ rep(i, v.size()) { cout << v.at(i) << endl; } // aよりもbが大きいならばaをbで更新する // (更新されたならばtrueを返す) template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; // aをbで更新 return true; } return false; } // aよりもbが小さいならばaをbで更新する // (更新されたならばtrueを返す) template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; // aをbで更新 return true; } return false; } /* #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <string> // string, to_string, stoi #include <tuple> // tuple, make_tuple #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <utility> // pair, make_pair #include <vector> // vector */ int main() { string str, sub; int len, ans; bool flag = true; cin >> str; len = str.size(); rep(i, len) { rep(j, len - i) { sub = str.substr(j, i + 1); rep(i, sub.size()) { if (sub[i] != 'A' && sub[i] != 'T' && sub[i] != 'G' && sub[i] != 'C') { flag = false; break; } } if (flag) { ans = i + 1; } flag = true; } } cout << ans << endl; }
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i) #define rep(i, n) REP(i, 0, n) #define square(x) pow(x 2.0) #define all(x) (x).begin(), (x).end() #define F first #define S second #define max_queue(x) priority_queue<x> #define min_queue(x) priority_queue<x, vector<x>, greater<x>> #define big_sort(v) \ sort(all(v), [](int a, int b) { return a > b; }) //大きい順にソート using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vs = vector<string>; #define co(x) cout << x << endl; #define cins(n, v) \ rep(i, n) { cin >> v.at(i); } #define couts(v) \ rep(i, v.size()) { cout << v.at(i) << endl; } // aよりもbが大きいならばaをbで更新する // (更新されたならばtrueを返す) template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; // aをbで更新 return true; } return false; } // aよりもbが小さいならばaをbで更新する // (更新されたならばtrueを返す) template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; // aをbで更新 return true; } return false; } /* #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <string> // string, to_string, stoi #include <tuple> // tuple, make_tuple #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <utility> // pair, make_pair #include <vector> // vector */ int main() { string str, sub; int len, ans = 0; bool flag = true; cin >> str; len = str.size(); rep(i, len) { rep(j, len - i) { sub = str.substr(j, i + 1); rep(i, sub.size()) { if (sub[i] != 'A' && sub[i] != 'T' && sub[i] != 'G' && sub[i] != 'C') { flag = false; break; } } if (flag) { ans = i + 1; } flag = true; } } cout << ans << endl; }
[ "variable_declaration.value.change" ]
900,262
900,263
u951112139
cpp
p03086
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> using namespace std; typedef long long ll; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) int main(int argc, char **argv) { string S; cin >> S; int l = S.length(); int m = 0; for (int i = 0; i < l; ++i) { for (int j = i + 1; j < l; ++j) { string sub = S.substr(i, j - i); bool f = true; for (int k = 0; k < sub.length(); ++k) { if (sub[k] != 'A' && sub[k] != 'C' && sub[k] != 'G' && sub[k] != 'T') { f = false; break; } } if (f) { if (m < sub.length()) m = sub.length(); } } } cout << m << endl; return 0; }
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> using namespace std; typedef long long ll; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) int main(int argc, char **argv) { string S; cin >> S; int l = S.length(); int m = 0; for (int i = 0; i < l; ++i) { for (int j = i + 1; j < l + 1; ++j) { string sub = S.substr(i, j - i); bool f = true; for (int k = 0; k < sub.length(); ++k) { if (sub[k] != 'A' && sub[k] != 'C' && sub[k] != 'G' && sub[k] != 'T') { f = false; break; } } if (f) { if (m < sub.length()) m = sub.length(); } } } cout << m << endl; return 0; }
[ "control_flow.loop.for.condition.change", "misc.off_by_one" ]
900,264
900,265
u001534842
cpp
p03086
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> using namespace std; typedef long long ll; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) int main(int argc, char **argv) { string S; cin >> S; int l = S.length(); int m = 0; for (int i = 0; i < l - 1; ++i) { for (int j = i + 1; j < l; ++j) { string sub = S.substr(i, j - i); bool f = true; for (int k = 0; k < sub.length(); ++k) { if (sub[k] != 'A' && sub[k] != 'C' && sub[k] != 'G' && sub[k] != 'T') { f = false; break; } } if (f) { if (m < sub.length()) m = sub.length(); } } } cout << m << endl; return 0; }
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> using namespace std; typedef long long ll; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) int main(int argc, char **argv) { string S; cin >> S; int l = S.length(); int m = 0; for (int i = 0; i < l; ++i) { for (int j = i + 1; j < l + 1; ++j) { string sub = S.substr(i, j - i); bool f = true; for (int k = 0; k < sub.length(); ++k) { if (sub[k] != 'A' && sub[k] != 'C' && sub[k] != 'G' && sub[k] != 'T') { f = false; break; } } if (f) { if (m < sub.length()) m = sub.length(); } } } cout << m << endl; return 0; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove", "misc.off_by_one" ]
900,266
900,265
u001534842
cpp
p03086
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = int(a); i < int(b); ++i) #define SIZE 200005 #define INF 1000000005LL #define MOD 1000000007 using namespace std; typedef long long int ll; typedef pair<int, int> P; string s; int cnt; string a = "ACGT"; int main() { cin >> s; int n = s.size(); rep(i, 0, n) rep(j, i + 1, n) { bool t = true; rep(l, i, j + 1) { bool u = false; rep(p, 0, 4) u |= (s[l] == a[p]); t &= u; } if (t) cnt = max(cnt, j - i + 1); } cout << cnt << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = int(a); i < int(b); ++i) #define SIZE 200005 #define INF 1000000005LL #define MOD 1000000007 using namespace std; typedef long long int ll; typedef pair<int, int> P; string s; int cnt; string a = "ACGT"; int main() { cin >> s; int n = s.size(); rep(i, 0, n) rep(j, i + 1, n + 1) { bool t = true; rep(l, i, j) { bool u = false; rep(p, 0, 4) u |= (s[l] == a[p]); t &= u; } if (t) cnt = max(cnt, j - i); } cout << cnt << endl; return 0; }
[ "expression.operation.binary.remove" ]
900,267
900,268
u124087379
cpp
p03086
#include <iostream> #include <string> using namespace std; int main(void) { string S; int count = 0, ans = 0; cin >> S; for (int i = 0; i < S.size(); i++) { if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') { count++; } else { if (count > ans) { ans = count; } } } cout << ans << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main(void) { string S; int count = 0, ans = 0; cin >> S; for (int i = 0; i < S.size(); i++) { if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') { count++; } else { count = 0; } if (count > ans) { ans = count; } } cout << ans << endl; return 0; }
[ "assignment.add" ]
900,271
900,272
u715722875
cpp
p03086
#include <algorithm> #include <bitset> #include <climits> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string S; cin >> S; int ans = 0; int count = 0; for (int i = 0; i < S.size(); i++) { if (S[i] == 'A' || S[i] == 'C' || S[i] == 'T' || S[i] == 'G') { count++; ans = (ans, count); } else { ans = max(ans, count); count = 0; } } cout << ans << endl; return 0; }
#include <algorithm> #include <bitset> #include <climits> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string S; cin >> S; int ans = 0; int count = 0; for (int i = 0; i < S.size(); i++) { if (S[i] == 'A' || S[i] == 'C' || S[i] == 'T' || S[i] == 'G') { count++; ans = max(ans, count); } else { ans = max(ans, count); count = 0; } } cout << ans << endl; return 0; }
[ "call.add" ]
900,273
900,274
u963353562
cpp
p03086
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdint> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <limits> #include <numeric> #include <stdlib.h> #include <type_traits> using namespace std; int main() { string a; cin >> a; int max = 0; int n = (int)a.length(); for (int i = 0; i < n; i++) { int t = 0; if (a[i] == 'A' || a[i] == 'C' || a[i] == 'G' || a[i] == 'T') { t++; for (int j = i + 1; j < n; j++) { if (a[j] != 'A' && a[j] != 'C' && a[j] != 'G' && a[j] != 'T') { break; } else { t++; } if (t >= max) { max = t; } } } } cout << max; return 0; }
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdint> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <limits> #include <numeric> #include <stdlib.h> #include <type_traits> using namespace std; int main() { string a; cin >> a; int max = 0; int n = (int)a.length(); for (int i = 0; i < n; i++) { int t = 0; if (a[i] == 'A' || a[i] == 'C' || a[i] == 'G' || a[i] == 'T') { t++; for (int j = i + 1; j < n; j++) { if (a[j] != 'A' && a[j] != 'C' && a[j] != 'G' && a[j] != 'T') { break; } else { t++; } } } if (t >= max) { max = t; } } cout << max; return 0; }
[]
900,279
900,280
u596979123
cpp
p03086
#include <bits/stdc++.h> using namespace std; #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 ALL(v) v.begin(), v.end() #define CMAX(m, x) m = max(m, x); #define CMIN(m, x) m = min(m, x); #define itn int typedef long long lint; const int INF = 1e9; const lint LINF = 1e18; int main() { string s; cin >> s; int n = s.size(); int len = 0; REP(i, n) { FOR(j, 1, n - i) { string a = s.substr(i, j); bool flag = true; int cnt = 0; REP(k, a.size()) { if (a[k] == 'A' || a[k] == 'C' || a[k] == 'G' || a[k] == 'T') { cnt++; } else flag = false; } if (flag) CMAX(len, cnt); cnt = 0; flag = true; } } cout << len << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #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 ALL(v) v.begin(), v.end() #define CMAX(m, x) m = max(m, x); #define CMIN(m, x) m = min(m, x); #define itn int typedef long long lint; const int INF = 1e9; const lint LINF = 1e18; int main() { string s; cin >> s; int n = s.size(); int len = 0; REP(i, n) { FOR(j, 1, n - i + 1) { string a = s.substr(i, j); bool flag = true; int cnt = 0; REP(k, a.size()) { if (a[k] == 'A' || a[k] == 'C' || a[k] == 'G' || a[k] == 'T') { cnt++; } else flag = false; } if (flag) CMAX(len, cnt); cnt = 0; flag = true; } } cout << len << endl; return 0; }
[ "expression.operation.binary.add" ]
900,283
900,284
u777602533
cpp
p03086
#include <bits/stdc++.h> using namespace std; #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 ALL(v) v.begin(), v.end() #define CMAX(m, x) m = max(m, x); #define CMIN(m, x) m = min(m, x); #define itn int typedef long long lint; const int INF = 1e9; const lint LINF = 1e18; int main() { string s; cin >> s; int n = s.size(); int len = 0; REP(i, n) { REP(j, n - i) { string a = s.substr(i, j); bool flag = true; int cnt = 0; REP(k, a.size()) { if (a[k] == 'A' || a[k] == 'C' || a[k] == 'G' || a[k] == 'T') { cnt++; } else flag = false; } if (flag) CMAX(len, cnt); cnt = 0; flag = true; } } cout << len << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #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 ALL(v) v.begin(), v.end() #define CMAX(m, x) m = max(m, x); #define CMIN(m, x) m = min(m, x); #define itn int typedef long long lint; const int INF = 1e9; const lint LINF = 1e18; int main() { string s; cin >> s; int n = s.size(); int len = 0; REP(i, n) { FOR(j, 1, n - i + 1) { string a = s.substr(i, j); bool flag = true; int cnt = 0; REP(k, a.size()) { if (a[k] == 'A' || a[k] == 'C' || a[k] == 'G' || a[k] == 'T') { cnt++; } else flag = false; } if (flag) CMAX(len, cnt); cnt = 0; flag = true; } } cout << len << endl; return 0; }
[ "identifier.change", "call.function.change", "call.arguments.add" ]
900,285
900,284
u777602533
cpp
p03086
#include <bits/stdc++.h> #include <math.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define ALL(v) (v).begin(), (v).end() using namespace std; typedef long long ll; typedef pair<int, int> P; const int INF = 1001001001; const int mINF = -1001001001; int main() { char s[11]; cin >> s; int num = strlen(s); int a[num] = {0}; REP(i, num) { if (s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') a[i] = 1; } int ans = 0; int temp = 0; REP(i, num - 1) { if (a[i] == 1) { temp++; } else if (a[i] == 0) { temp = 0; } ans = max(ans, temp); } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #include <math.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define ALL(v) (v).begin(), (v).end() using namespace std; typedef long long ll; typedef pair<int, int> P; const int INF = 1001001001; const int mINF = -1001001001; int main() { char s[11]; cin >> s; int num = strlen(s); int a[num] = {0}; REP(i, num) { if (s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') a[i] = 1; } int ans = 0; int temp = 0; REP(i, num) { if (a[i] == 1) { temp++; } else if (a[i] == 0) { temp = 0; } ans = max(ans, temp); } cout << ans << endl; return 0; }
[ "expression.operation.binary.remove" ]
900,290
900,291
u281876921
cpp
p03086
#include <bits/stdc++.h> using namespace std; int n, i, j, a, c; string s; int main() { for (cin >> s; i < s.size() - 1; i++) { for (c = 0, j = i; j < s.size() && (s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T'); j++) c++; a = max(a, c); } cout << a; }
#include <bits/stdc++.h> using namespace std; int n, i, j, a, c; string s; int main() { for (cin >> s; i < s.size(); i++) { for (c = 0, j = i; j < s.size() && (s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T'); j++) c++; a = max(a, c); } cout << a; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
900,294
900,295
u303621502
cpp
p03086
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define all(x) (x).begin(), (x).end() #define endl "\n" using ll = long long; using P = pair<int, int>; using mp = map<char, int>; const int MOD = 1e9 + 7; const int INF = 1001001001; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string s; cin >> s; int ans = 0, cnt = 0; rep(i, s.size()) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { cnt++; } else { ans = max(ans, cnt); cnt = 0; } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define all(x) (x).begin(), (x).end() #define endl "\n" using ll = long long; using P = pair<int, int>; using mp = map<char, int>; const int MOD = 1e9 + 7; const int INF = 1001001001; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string s; cin >> s; int ans = 0, cnt = 0; rep(i, s.size()) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { cnt++; } else { ans = max(ans, cnt); cnt = 0; } } cout << max(ans, cnt) << endl; return 0; }
[ "call.add", "call.arguments.add" ]
900,296
900,297
u358859892
cpp
p03086
#include <iostream> using namespace std; int main() { char b[10]; cin >> b; int length = 0; int max = 0; for (int i = 0; i < 10; i++) { if (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C') length++; else if (max <= length) { max = length; length = 0; } else length = 0; } if (length == 10) max = length; cout << max; }
#include <iostream> using namespace std; int main() { char b[10]; cin >> b; int length = 0; int max = 0; for (int i = 0; i < 10; i++) { if (b[i] == 'A' || b[i] == 'T' || b[i] == 'G' || b[i] == 'C') length++; else if (max <= length) { max = length; length = 0; } else length = 0; } if (length > max) max = length; cout << max; }
[]
900,303
900,304
u120564432
cpp
p03086
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; using P = pair<int, int>; int main() { string s; int ans = 0, count = 0; cin >> s; for (int i = 0; i < s.size(); 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; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; using P = pair<int, int>; int main() { string s; int ans = 0, count = 0; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') { count++; ans = max(ans, count); } else { count = 0; } } cout << ans << endl; }
[ "control_flow.branch.else.add" ]
900,309
900,310
u147331814
cpp
p03086
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = sizeof(s); int sum = 0; int maxv = 0; for (int i = 0; i < n; i++) { char ch = s[i]; if (ch == 'A' || ch == 'C' || ch == 'G' || ch == 'T') { sum++; } else { sum = 0; } maxv = max(maxv, sum); } cout << maxv << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.length(); int sum = 0; int maxv = 0; for (int i = 0; i < n; i++) { char ch = s[i]; if (ch == 'A' || ch == 'C' || ch == 'G' || ch == 'T') { sum++; } else { sum = 0; } maxv = max(maxv, sum); } cout << maxv << endl; return 0; }
[ "call.add" ]
900,311
900,312
u384768892
cpp
p03086
#include <iostream> #include <queue> #include <string> #include <vector> using namespace std; string str; int n; vector<int> index; priority_queue<int> diff; void solve() { index.push_back(0); for (int i = 0; i < str.length(); i++) { if (str[i] != 'A' && str[i] != 'C' && str[i] != 'G' && str[i] != 'T') { index.push_back(i); } } index.push_back(str.length() - 1); for (int i = 0; i < index.size() - 1; i++) { diff.push(index[i + 1] - index[i]); } cout << diff.top() << endl; } int main() { cin >> str; solve(); return EXIT_SUCCESS; }
#include <iostream> #include <queue> #include <string> #include <vector> using namespace std; string str; int n; vector<int> index; priority_queue<int> diff; void solve() { index.push_back(-1); for (int i = 0; i < str.length(); i++) { if (str[i] != 'A' && str[i] != 'C' && str[i] != 'G' && str[i] != 'T') { index.push_back(i); // cout << i << endl; } } index.push_back(str.length()); for (int i = 0; i < index.size() - 1; i++) { diff.push(index[i + 1] - index[i] - 1); // cout << index[i+1] - index[i] << endl; } cout << diff.top() << endl; } int main() { cin >> str; solve(); return EXIT_SUCCESS; }
[ "literal.number.change", "call.arguments.change", "expression.operation.binary.remove" ]
900,313
900,314
u083997787
cpp