akhauriyash/Code-Regression huggingface dataset:
#define __mode_debug__
/*   ξ
     ll
   ＿ll＿
 ／  ∞  ＼
│*  Ａ  *│
│*  Ｃ  *│
│*  祈  *│
│*  願  *│
│*      *│
 ￣￣￣￣￣    */
//C++14 (GCC 5.4.1)
#include <bits/stdc++.h>
using namespace std;
#ifdef __mode_debug__
    #define DBG
#else
    #define DBG if(false)
#endif

#define LLINF (1LL<<60)
using ll = long long;
#define mod  1000000007

#define whole(a) (a).begin(),(a).end()
#define rwhole(a) (a).rbegin(),(a).rend()

#define repd(i,a,b) for (ll i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define rrepd(i,a,b) for(ll i=(a);i>=(b);i--)
#define each(itr,ds) for(auto itr=(ds).begin();itr!=(ds).end();itr++)

template<typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); }

//DUMP
//  ostream vector<T> , vector<vector<T>> , set<T> ,queue<T> , priority_queue<T> , pair<T,U> , map<T,U>
template<class T> ostream& operator<<(ostream&os,vector<T>&vec){os<<"{ ";rep(i,vec.size()) os<<((i==0)?"":", ")<<i<<":"<<vec[i];os<<" }";return os;}
template<class T> ostream& operator<<(ostream&os,vector<vector<T>>&vec){os<<"{"<<endl;rep(i,vec.size())os<<"\t   "<<i<<":"<<vec[i]<<((i==vec.size()-1)? "":",")<<endl;os<<"\t }";return os;}
template<class T> ostream& operator<<(ostream&os,set<T>&p){os<<"{ ";each(itr,p)  os<<((itr==p.begin())?"":", ")<<*itr;os<<" }";return os;}
template<class T> ostream& operator<<(ostream&os,queue<T>&p){queue<T> q(p);os<<"[< "<<(q.empty()?" <]":"");while(!q.empty()){os<<q.front();q.pop();os<< (q.empty() ? " <]" : ", ");}return os;}
template<class T> ostream& operator<<(ostream&os,priority_queue<T>&p){priority_queue<T> q(p);os<<"[< "<<(q.empty()?" <]":"");while(!q.empty()){os<<q.top();q.pop();os<< (q.empty() ? " <]" : ", ");}return os;}
template<class T,class U> ostream& operator<<(ostream&os,pair<T,U>&p){os<<"("<<p.first<<","<<p.second<<")";return os;}
template<class T,class U> ostream& operator<<(ostream&os,map<T,U>&p){os<<"{ ";each(itr,p)os<<((itr==p.begin())?"":", ")<<itr->first<<":"<<itr->second;os<<" }";return os;}
void dump_f(string &nm,char t){cerr<<endl;}
template<class T,class... Ts> void dump_f(string &nm,char t,T &&x,Ts&&... ts){int l=nm.find_first_of(',');string name(nm,0,l),nx(nm,l+1,-1);if(t=='\n') cerr<<"  "<<name<<"\t: "<<x<<t;else cerr << name<<": "<<x<<","<<t;dump_f(nx,t,forward<Ts>(ts)...);}
template<class... Ts> void dump_m(int &&ln,string &&nm,char t,Ts&&... ts){cerr<<"[ln: "<<ln<<"]"<<t;dump_f(nm,t,forward<Ts>(ts)...);}
#define dump(...) DBG dump_m(__LINE__,#__VA_ARGS__,'\n',__VA_ARGS__)
#define dl(...) DBG dump_m(__LINE__,#__VA_ARGS__,'\t',__VA_ARGS__)

#define lower_bound_idx(V,c) distance(V.begin(),lower_bound(whole(V),c))

int main() {
    ios::sync_with_stdio(false);//printf<=>cout
    cin.tie(nullptr);//cin<=>cout


    string S;
    cin >>S;
   

    //-----------------------------------

    if(S[S.size()-1] == 's'){
        cout<<S<<"es"<<endl;
    }else{
        cout<<S<<"s"<<endl;
    }

    return (0);
}

Measured memory_bytes: 3652
#include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include <tuple>
#include <time.h>
#include <random>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;

long long int INF = 3e18;
double Pi = 3.1415926535897932384626;

vector<ll> G[500005];
//vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop

int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//ll bit[500005];
//↓,→,↑,←


#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<(x)<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define deba(x) cout<< #x << " = " << x <<endl


ll mod = 1000000007;
ll rui(ll number1,ll number2){

    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){

    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}
void YES(bool condition){

    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){

    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}

/*
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=800000; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
	rfact[800000] = rui(fact[800000],mod - 2);
	for(ll i=800000; i>=1; i--){
	   rfact[i-1] = rfact[i] * i;
	   rfact[i-1] %= mod;
	}
	return;}
ll c3(ll n,ll r){
    return (((fact[n] * rfact[r]) % mod) * rfact[n-r]) % mod;}
*/

ll n,m,num,sum,ans,a,b,c,d,e,g,h,w,i,j,k,q,l,r,idx;
ll x[500005],y[500005],z[500005];
char s[500005],t[500005];
//bool used[500005];
bool flag,dame;


int main(){
	cin >> n >> m;
    for(i=0;i<m;i++){
        cin >> x[i];
    }
    y[0] = 1;
    num = 0;
    for(i=1;i<=n;i++){
        if(i >= 2){
            y[i] += y[i-1] + y[i-2];
        }else{
            y[i] += y[i-1];
        }
        y[i] %= mod;
        if(i == x[num]){
            y[i] = 0;
            num++;
        }
    }
    p(y[n]);


	return 0;
}

Measured memory_bytes: 16512
#include <iostream>
#include <vector>

using namespace std;
int main() {

  //a+b a-b a*b
  string str;
  cin >> str;
  char a, t, g, c;
  int n = 0;
  int result = 0;
  a = 'A';
  t = 'T';
  g = 'G';
  c = 'C';
for(int i=0; i<str.length();i++){
  char x = str[i];
  if((x==a)||(x==t)||(x==g)||(x==c)){
    n++;
    if(result<n){
      result = n;
    }
  }
  else{
  	n=0;
  }
  
}

cout << result;

return 0;
}

Measured memory_bytes: 256
fun main(array: Array<String>) {
    var (a, b, c) = readLine()!!.split(" ").map { it.toInt() }
    var cnt = 0
    var tempA = 0
    var tempB = 0
    var tempC = 0

    if(a % 2 != 0 || b % 2 != 0 || c % 2 != 0) {
        print(0)
        return
    }
    if(a == b && b == c) {
        print(-1)
        return
    }
    while (true) {
            if(a % 2 != 0 || b % 2 != 0 || c % 2 != 0) {
                print(cnt)
                return
            }
        tempA = b/2 + c/2
        tempB = a/2 + c/2
        tempC = a/2 + b/2
        a = tempA
        b = tempB
        c = tempC
            cnt++

    }
    print(cnt)
}

Measured memory_bytes: 37872
/* ex4_2 KitamoriFumiya */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define PI 3.14159265359

//  余弦定理で長針と短針の先端の距離を出力する関数
void cosine(double length_hour, double length_minute, double hour, double minute){
	double angle_hour, angle_minute, difference_angle; // angle_hour(長針の角度), angle_minute(短針の角度), difference_angle(長針と短針の角度の差)をdouble型の変数として宣言
	angle_hour = 360 * hour / 12 + 30 * minute / 60; // 長針の角度を計算
	angle_minute = 360 * minute / 60; // 短針の角度を計算
	difference_angle = angle_hour - angle_minute; // 長針と短針の角度の差を計算
	difference_angle = (difference_angle / 180) * PI ; // 角度の差を弧度法で表す
	double distance; // 長針と短針の先端の距離をdouble型の変数として宣言
	distance = length_hour * length_hour + length_minute * length_minute - 2 * length_hour * length_minute * cos(difference_angle); // 距離の2乗を余弦定理で求める
	distance = sqrt(distance); // 距離をルートに入れて戻す
	printf("%.10lf\n", distance); // 距離を少数第10位まで出力する
}

int main(){
	double length_hour, length_minute, hour, minute; // length_hour(長針の長さ), length_minute(短針の長さ), hour(時間), minute(分数)をdouble型の変数として宣言
	scanf("%lf %lf %lf %lf", &length_hour, &length_minute, &hour, &minute); // length_hour, length_minute, hour, minuteを入力
	
	cosine(length_hour, length_minute, hour, minute); // 余弦定理で長針と短針の先端の距離を出力する関数を実行
	
	return 0;
}

Measured memory_bytes: 2452
#include <stdio.h>
#include <stdlib.h>

#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <stdint.h>
#include <string.h>

//#define _USE_MATH_DEFINES
//#include <math.h>

#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <deque>
#include <string>

#include <algorithm>
#include <functional>
#include <bitset>
#include <functional>
#include <chrono>
#include <random>
#define sqr(x) (x) * (x)

typedef unsigned int u32;
typedef int i32;
typedef unsigned long long int u64;
typedef int i64;
typedef uint16_t u16;
typedef int16_t i16;
typedef uint8_t u8;
typedef int8_t i8;

using namespace std;
using namespace std::chrono;

const i64 mod = 1000000007ll;
const i64 smod = 998244353ll;
const i64 inf = 1000000007; // 10000000000000007ll;

const double eps = 1e-8;

const i64 MAXN = 300004;

i64 n;
i64 a[MAXN];

int main(int argc, char* argv[]) {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(15); cout.setf(ios::fixed);

    string s;
    cin >> s;
    
    stringstream ss;
    for (i64 i = 0; i < s.size(); i++) {
        ss << 'x';
    }

    cout << ss.str() << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using vec = vector<ll>;
using vect = vector<double>;
using Graph = vector<vector<ll>>;
#define loop(i, n) for (ll i = 0; i < n; i++)
#define Loop(i, m, n) for (ll i = m; i < n; i++)
#define pool(i, n) for (ll i = n; i >= 0; i--)
#define Pool(i, m, n) for (ll i = n; i >= m; i--)
#define mod 1000000007ll
#define flagcount __builtin_popcount
#define flag(x) (1 << x)
#define flagadd(bit, x) bit |= flag(x)
#define flagpop(bit, x) bit &= ~flag(x)
#define flagon(bit, i) bit &flag(i)
#define flagoff(bit, i) !(bit & (1 << i))
#define all(v) v.begin(), v.end()
#define low2way(v, x) lower_bound(all(v), x)
#define high2way(v, x) upper_bound(all(v), x)
#define idx_lower(v, x) (distance(v.begin(), low2way(v, x)))  //配列vでx未満の要素数を返す
#define idx_upper(v, x) (distance(v.begin(), high2way(v, x))) //配列vでx以下の要素数を返す
#define idx_lower2(v, x) (v.size() - idx_lower(v, x))         //配列vでx以上の要素数を返す
#define idx_upper2(v, x) (v.size() - idx_upper(v, x))         //配列vでxより大きい要素の数を返す
#define putout(a) cout << a << endl
#define Gput(a, b) G[a].push_back(b)
#define Sum(v) accumulate(all(v), 0ll)
#define gcd(x, y) __gcd(x, y)
ll ctoi(char c)
{
    if (c >= '0' && c <= '9')
    {
        return c - '0';
    }
    return 0;
}
template <typename T>
T lcm(T x, T y)
{
    T z = gcd(x, y);
    return x * y / z;
}
template <typename T>
bool primejudge(T n)
{
    if (n < 2)
        return false;
    else if (n == 2)
        return true;
    else if (n % 2 == 0)
        return false;
    double sqrtn = sqrt(n);
    for (T i = 3; i < sqrtn + 1; i++)
    {
        if (n % i == 0)
        {
            return false;
        }
        i++;
    }
    return true;
}
//場合によって使い分ける
//const ll dx[4]={1,0,-1,0};
//const ll dy[4]={0,1,0,-1};
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//2次元配列の宣言
//vector<vector<ll>> field(h, vector<ll>(w));

int main()
{
    cout << fixed << setprecision(30);
   ll x;
  cin>>x;
  putout(lcm(360ll,x)/x);
    return 0;
}


Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define ll long long int
#define __ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pi acos(-1)
using namespace std;


int main ()
{
__

int a;

cin >> a;

string s;

cin >> s;

if(a>=3200) cout << s;

else cout <<"red";


return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using     ll=long long;
using    vll=vector<   ll>;
using   vvll=vector<  vll>;
using  vvvll=vector< vvll>;
using vvvvll=vector<vvvll>;
constexpr ll INF = 1LL << 60;
struct Fast{ //cin,cout高速化のおまじない＋桁数指定
	Fast(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(std::numeric_limits<double>::max_digits10); }
} fast;
#define REPS(i, S, E) for (ll i = (S); i <= (E); i++)
#define REP(i, N) REPS(i, 0, (N)-1)
#define DEPS(i, S, E) for (ll i = (E); i >= (S); i--)
#define DEP(i, N) DEPS(i, 0, (N)-1)
#define EACH(e, v) for (auto&& e : v)
#define rep(i, S, E)  for (ll i = (S); i <= (E); i++)
#define dep(i, E, S)  for (ll i = (E); i >= (S); i--)
#define each(e, v) for (auto&& e : v)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
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; }
template<class T> inline T MaxE(vector<T>&v,ll S,ll E){ T m=v[S]; rep(i,S,E)chmax(m,v[i]); return m; }
template<class T> inline T MinE(vector<T>&v,ll S,ll E){ T m=v[S]; rep(i,S,E)chmin(m,v[i]); return m; }
template<class T> inline T MaxE(vector<T> &v) { return MaxE(v,0,(ll)v.size()-1); }
template<class T> inline T MinE(vector<T> &v) { return MinE(v,0,(ll)v.size()-1); }
template<class T> inline T Sum(vector<T> &v,ll S,ll E){ T s=T(); rep(i,S,E)s+=v[i]; return s; }
template<class T> inline T Sum(vector<T> &v) { return Sum(v,0,v.size()-1); }
template<class T> inline ll sz(T &v){ return (ll)v.size(); }
template<class T> inline T POW(T a, ll n){ T r=1; for (; n>0; n>>=1, a*=a){ if (n&1)r*=a; } return r; }
inline ll POW(int a, ll n){ return POW((ll)a, n); }
inline ll CEIL(ll a, ll b){ return (a+b-1)/b; }



void solve()
{
	vector<vector<ll>> a(3,vector<ll>(3));
	rep(i,0,3-1)rep(j,0,3-1){ ll a_; cin>>a_; a[i][j]=a_; }
	ll n;  cin >> n;
	vector<ll> b(n);  rep(i,0,n-1){ ll b_; cin>>b_; b[i]=b_; }

	vvll p(3,vll(3));
	rep(i,0,2){
		rep(j,0,2){
			if (find(ALL(b),a[i][j])!=b.end()){
				p[i][j]=1;
			}
		}
	}

	rep(i,0,2){
		bool isall=true;
		rep(j,0,2) if (!(p[i][j]==1)) {isall=false; break;}
		if (isall){
			cout << "Yes" << '\n'; return;
		}
	}
	rep(i,0,2){
		bool isall=true;
		rep(j,0,2) if (!(p[j][i]==1)) {isall=false; break;}
		if (isall){
			cout << "Yes" << '\n'; return;
		}
	}
	{
		bool isall=true;
		rep(i,0,2) if (!(p[i][i]==1)) { isall=false; break; }
		if (isall){
			cout << "Yes" << '\n'; return;
		}
	}
	{
		bool isall=true;
		rep(i,0,2) if (!(p[i][2-i]==1)) { isall=false; break; }
		if (isall){
			cout << "Yes" << '\n'; return;
		}
	}
	cout << "No" << '\n';
}


int main(){
#if 1
	solve();
#else
	ll t;  cin >> t;
	rep(i, 0, t-1){
		solve();
	}
#endif
	return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B,C;
  cin>>A>>B>>C;
  if(A>=B && A>=C && B>=C){
    cout<<A-C<<endl;
  }
  else if(B>=A && B>=C && C<=A){
    cout<<B-C<<endl;
  }
  else if(C>=A && B<=C && B<=A){
    cout<<C-B<<endl;
  }
  else if(C>=A && B<=A && B<=C){
    cout<<A-B<<endl;
  }
  else if(C<=B && B>=A && C>=A){
    cout<<B-A<<endl;
  }
  else if(C>=A && B<=C && A<=B){
    cout<<C-A<<endl;
  }
}


Measured memory_bytes: 3588
#include<iomanip>
#include <string>
#include<iostream>
#include<vector>
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
#include<math.h>
#include <ctype.h>
#include <algorithm> // sort
#include <map> // pair
using namespace std;
#define nin(n) int n; cin >> n;
#define kin(k) int k; cin >> k;
int main() {
  int n,k;
  string s;
  cin >> n >> k >>s;
  s.at(k-1)=s.at(k-1)+0x20;
  cout << s << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define vll vector<ll>
#define lll pair<ll,ll>
#define ii pair<int, int>
#define vii vector<ii>
#define vi vector<int>
#define ff first
#define ss second
#define pb(a) push_back(a)
#define ppb() pop_back()
#define mkp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define vs vector<string>
#define vc vector<char>
#define deb1(a) cout<<#a<<" "<<a<<"\n"
#define deb2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<"\n";
#define deb3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<"\n"
#define mms0(a) memset(a,0,sizeof(a))
#define mms1(a) memset(a,-1,sizeof(a))
#define FOR(a,b,c) for(int i=(a);i<(b);i+=(c))
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define mod 1000000007
#define _ 0

using namespace std;




void solve(){
   int H,W;
   cin>>H>>W;
   vs data(H+1);
   FOR(1,H+1,1) cin>>data[i];

   int dp[H+1][W+1];
   mms0(dp);
   int pos = 1;
   for(int i=W;i>0;i--){
      if(data[H][i-1] == '#') pos = 0;
      dp[H][i] = pos;
   }
   pos = 1;
   for(int i=H;i>0;i--){
      if(data[i][W-1] == '#') pos = 0;
      dp[i][W] = pos;
   }

   for(int i=H-1;i>0;i--){
      for(int j=W-1;j>0;j--){
         if(data[i][j-1] == '.') dp[i][j] = (dp[i+1][j]%mod + dp[i][j+1]%mod)%mod;
      }
   }
   // for(int i=0;i<=H;i++){
   //    for(int j=0;j<=W;j++) cout<<dp[i][j]<<" ";cout<<"\n";
   // }
   cout<<dp[1][1];
}




int main(){
   int t = 1;
  // cin>>t;
   while(t--){
      solve();
   }
   return 0;
}

Measured memory_bytes: 9444
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int N, M;
    cin >> N >> M;
    // NC2
    cout << N * (N - 1) / 2 + M * (M - 1) / 2 << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;

struct Swimmer {
    int t,c;
    Swimmer(int t,int c) : t(t) , c(c) {;}
};

bool operator<(const Swimmer &s,const Swimmer &t) {
    return s.t < t.t;
}

int main() {
    int n,t,c;
    while(cin>>n, n) {
        vector<Swimmer> vs;
        for(int i=0; i<n; ++i) {
            cin>>t>>c;
            vs.push_back(Swimmer(t,c));
        }
        sort(vs.begin(), vs.end());

        queue<pair<int,int> > q1,q2;
        for(int i=0; i<n; ++i) q1.push(make_pair(vs[i].t,i));

        int time,ans = 0;
        for(time = 0; time < 1000000; time++) {
            if(!q1.empty()) {
                if(q1.front().first == time) {
                    vector<pair<int,int> > wait;
                    while(!q1.empty() && q1.front().first <= time) {
                        wait.push_back(make_pair(vs[q1.front().second].t,q1.front().second));
                        q1.pop();
                    }

                    if(q1.empty()) {
                        while(!q2.empty() && q2.front().first+vs[q2.front().second].t <= time) {
                            vs[q2.front().second].c--;
                            if(vs[q2.front().second].c == 0) ans = max(ans,q2.front().first);
                            else wait.push_back(make_pair(vs[q2.front().second].t,q2.front().second));
                            q2.pop();
                        }
                    }

                    sort(wait.begin(), wait.end());
                    for(int i=0; i<wait.size(); ++i) {
                        q2.push(make_pair(time+wait[i].first,wait[i].second));
                    }
                }
            }
            if(!q2.empty()) {
                if(q2.front().first == time) {
                    vector<pair<int,int> > wait;
                    while(!q2.empty() && q2.front().first <= time) {
                        vs[q2.front().second].c--;
                        if(vs[q2.front().second].c == 0) ans = max(ans,q2.front().first);
                        else wait.push_back(make_pair(vs[q2.front().second].t,q2.front().second));
                        q2.pop();
                    }

                    if(q2.empty()) {
                        while(!q1.empty() && q1.front().first+vs[q1.front().second].t <= time) {
                            wait.push_back(make_pair(vs[q1.front().second].t,q1.front().second));
                            q1.pop();
                        }
                    }

                    sort(wait.begin(),wait.end());
                    for(int i=0; i<wait.size(); ++i)
                        q1.push(make_pair(time+wait[i].first,wait[i].second));
                }
            }
        }
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 912
#include <stdio.h>

int main(void){
	int n;
	int i,j;
	int counter;
	while(1){
		scanf("%d",&n);
		if(n == 0){break;}
		counter = 0;
		for(i = 1; i <= n; i++){
			for(j = 2; i + j - 1 <= n; j++){
				if( (i * 2 + j - 1) * j / 2 == n){
					counter++;
					break;
				}
			}
		}
		printf("%d\n",counter);
	}
	return 0;
}

Measured memory_bytes: 408
//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//~ #pragma GCC target ("avx2")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define shandom_ruffle random_shuffle

using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
const int nax=5007;
const int vax=10*1007*1007;
const ll mod=1000*1000*1000+7;

int n, k;

int dp[nax][nax];

ll sil[vax];
ll odw[nax];

ll wyn;

void sdod(ll &a, ll b)
{
	a=(a+b)%mod;
}
 
void sdod(int &a, ll b)
{
	a=(a+b)%mod;
}

ll dziel(ll a, ll b)
{
	ll wyk=mod-2;
	while(wyk)
	{
		if (wyk&1)
			a=(a*b)%mod;
		b=(b*b)%mod;
		wyk>>=1;
	}
	return a;
}

ll kom(int a, int b)
{
	if (b<0 || b>a)
		return 0;
	return (sil[a]*(odw[b]*odw[a-b]%mod))%mod;
}

int spo[nax][nax];

void ogar(int moge, int musze, ll mno)
{
	if (!mno || !moge)
		return;
	int jest=n-k;
	if (jest<musze)
		return;
	wyn=(wyn+mno*spo[moge][musze])%mod;
	//~ debug() << imie(moge) << imie(musze) << imie(mno);
}

int pchaj[nax][nax];

int main()
{
	sil[0]=1;
	for (int i=1; i<vax; i++)
		sil[i]=(sil[i-1]*i)%mod;
	odw[nax-1]=dziel(1, sil[nax-1]);
	for (int i=nax-2; i>=0; i--)
		odw[i]=(odw[i+1]*(i+1))%mod;
	scanf("%d%d", &n, &k);
	int poza=n-k;
	for (int j=0; j<=k; j++)
	{
		for (int i=max(1, j); i<=k; i++)
		{
			if (!j)
			{
				spo[i][j]=(sil[i+poza-1]*odw[i-1])%mod;
				continue;
			}
			spo[i][j]=(spo[i][j-1]-spo[i-1][j-1]+mod)%mod;
		}
	}
	dp[k][0]=1;
	for (int i=k; i>=0; i--)
	{
		for (int j=0; j<=k; j++)
		{
			sdod(dp[i][j], pchaj[i][j]);
			if (i)
				sdod(pchaj[i-1][j], pchaj[i][j]*(ll)i);
			if (!dp[i][j] || !i)
				continue;
			sdod(dp[i-1][j+1], dp[i][j]);
			
			if (i>=2)
				sdod(pchaj[i-2][j], dp[i][j]*(i-1LL));
			
			ogar(k-i, j, dp[i][j]*sil[i-1]%mod);
		}
	}
	for (int i=0; i<=k; i++)
		ogar(k, i, dp[0][i]);
	printf("%lld\n", wyn);
	return 0;
}


Measured memory_bytes: 345452
#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;

#define X first
#define Y second

//#include <boost/unordered_map.hpp>
//using namespace boost;

/*
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> rbtree;
rbtree T;
*/

namespace io{
	const int L = (1 << 20) + 1;
	
	char buf[L], *S , *T, c;
	 
	char getchar() {
		if(S == T) {
			T = (S = buf) + fread(buf, 1, L, stdin);
			return (S == T ? EOF : *S++);
		}
		return *S++;
	}
	
	int inp() {
		int x = 0, f = 1; char ch;
		for(ch = getchar(); !isdigit(ch); ch = getchar())
			if(ch == '-') f = -1;
		for(; isdigit(ch); x = x * 10 + ch - '0', ch = getchar());
		return x * f;
	}
	
	ll inp_ll() {
		ll x = 0; int f = 1; char ch;
		for(ch = getchar(); !isdigit(ch); ch = getchar())
			if(ch == '-') f = -1;
		for(; isdigit(ch); x = x * 10 + ch - '0', ch = getchar());
		return x * f;
	}
	
	char B[25], *outs=B+20, *outr=B+20;
	template<class T>
	inline void print(register T a,register char x=0){
		if(x) *--outs = x, x = 0;
		
		if(!a)*--outs = '0';
		else 
			while(a)
				*--outs = (a % 10) + 48, a /= 10;
		
		if(x)
			*--outs = x;
		
		fwrite(outs, outr - outs , 1, stdout);
		outs = outr;
	}
};

using io :: print;
using io :: inp;
using io :: inp_ll;

const int MAXN = 100010;
const int MAXM = 1000010;
const int INF = 1000000000;
const int MOD = 998244353;

ll power(ll a, ll b, ll p)
{
	if (!b) return 1;
	ll t = power(a, b/2, p);
	t = t*t%p;
	if (b&1) t = t*a%p;
	return t;
}

int s[MAXN];

int main()
{
	
	int n, k;
	cin >> n >> k;
	puts((n%k == 0) ? "0" : "1");
	
	return 0;
}


Measured memory_bytes: 256
//-------------------------------------------
//-               Train Fare                -
//-                                         -
//-       autumn_eel niha katemasen!        -
//-------------------------------------------
#include<iostream>
#include<functional>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
#pragma warning(disable:4996)
int n, m, q, a[200001], b[200001], c[200001], d[200001], e[100001], dist[100001], E[200001];
vector<pair<int, int>>z[100001]; vector<int> x[100001];
vector<int>D[100001];
void reader(int *x) {
	int k = getchar(); *x = k - '0';
	while (true) {
		k = getchar();
		if (k < '0' || k > '9') break;
		*x = ((*x) << 1) + ((*x) << 3) + k - '0';
	}
}
int main() {
	reader(&n); reader(&m); reader(&q);
	fill(d, d + m + 1, 1 << 30);
	for (int i = 1; i <= m; i++) reader(&a[i]), reader(&b[i]);
	for (int i = 1; i <= q; i++) reader(&c[i]), d[c[i]] = i;
	for (int i = 1; i <= m; i++) {
		x[a[i]].push_back(b[i]);
		x[b[i]].push_back(a[i]);
	}
	fill(dist, dist + n + 1, -1); dist[1] = 0;
	queue<int> Q1; Q1.push(1);
	while (!Q1.empty()) {
		int a1 = Q1.front(); Q1.pop();
		for (int i : x[a1]) {
			if (dist[i] == -1) {
				dist[i] = dist[a1] + 1;
				Q1.push(i);
			}
		}
	}
	for (int i = 1; i <= m; i++) {
		if (dist[a[i]] > dist[b[i]])z[a[i]].push_back(make_pair(b[i], d[i]));
		if (dist[b[i]] > dist[a[i]])z[b[i]].push_back(make_pair(a[i], d[i]));
	}
	for (int i = 1; i <= n; i++) {
		D[dist[i]].push_back(i);
	}
	e[1] = (1 << 30);
	for (int i = 1; i < n; i++) {
		for (int j : D[i]) {
			for (pair<int, int>k : z[j]) {
				e[j] = max(e[j], min(e[k.first], k.second));
			}
		}
	}
	for (int i = 2; i <= n; i++) { if (e[i] < 300000)E[e[i]]++; }
	for (int i = 1; i <= q; i++)E[i] += E[i - 1];
	for (int i = 1; i <= q; i++) {
		printf("%d\n", E[i]);
	}
	return 0;
}

Measured memory_bytes: 23444
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T &a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T &a, const T& b) { if (b > a) a = b; }
/* clang-format on */

int main() {
#ifdef DEBUG
  ifstream ifs("in.txt");
  cin.rdbuf(ifs.rdbuf());
#endif
  string S;
  while (cin >> S) {
    cout << string(S.size(), 'x') << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <array>
#include <set>
#include <cmath>
#include <string>
#include <queue> //std::priority_queue<int> que; // 4, 3, 2, 1 (defualt, less) : 
#include <list>
#include <stack>
#include <unordered_map>
#include <algorithm>
#include <numeric>  // std::accumulate(m.begin(), m.end(), 0LL);
#include <functional>
#include <cassert>
#include <cctype>  // std::islower(), std::isupper(), std::tolower, std::toupper
#include <iomanip> // std::setprecision(X)
#include <limits>  //std::numeric_limits<int>::max(), min()

typedef long long ll;

int main (void) {
  int N; std::cin >> N;
  std::vector<int> A(N); for(int i=0; i<N; i++) std::cin >> A[i];

  int sums = 0;
  for(int i=0; i<=N; i++) {
    if ( i == 0 ) sums += std::abs(A[0]);
    else if ( i == N ) sums += std::abs(A[N-1]);
    else sums += std::abs(A[i]-A[i-1]);
  }

  for(int i=0; i<N; i++) {
    int isin, isout;
    if ( i == 0 ) {
      isin = std::abs(0-A[i]) + std::abs(A[i]-A[i+1]);
      isout = std::abs(0-A[i+1]);
    }
    else if ( i == N-1 ) {
      isin  = std::abs(A[i-1]-A[i]) + std::abs(A[i]-0);
      isout = std::abs(A[i-1]-0);

    }
    else {
      isin  = std::abs(A[i-1]-A[i]) + std::abs(A[i]-A[i+1]);
      isout = std::abs(A[i-1]-A[i+1]);
    }
    std::cout << sums - isin + isout << std::endl;
  }
  return 0;
}


Measured memory_bytes: 1664
A ,B = map(int,input().split())
c = -1
#int(0.08N) = A で int(0.1N) = B である
i = 10*B
Flag = True
while i < 10*(B+1) and Flag == True:
  if (i*8/100)//1 == A:
    c = i
    Flag = False
  i += 1
print(c)

Measured memory_bytes: 3064
num, time = gets.chomp.split.map(&:to_i)
time -= 1
things = []
num.times { things << gets.split.map(&:to_i) }
things.sort!

# 許容時間ごとの価値の最大値を格納（順次更新）
dp = Array.new(time + 1, 0)

ans = []
# num個目までの料理を、ナップサックに入れるべきか順番に確認する
num.times do |n|
  # n個目の時間をtmp_time、価値をtmp_valueとする
  tmp_time, tmp_value = things[n]
  # n個目の料理を最後に食べると仮定し、答えの選択肢に追加する
  ans << dp[time] + tmp_value
  # 許容時間がtimeからtmp_timeまでの場合を、順番に確認する
  # （許容時間がtmp_time未満の場合、ナップサックに入れることはできないため確認の必要なし）
  # なお、uptoを用いて逆向きに確認すると、ループ中に既に更新した数値を参照してしまうため、正常に動作しない
  time.downto(tmp_time) do |t_accepted|
    # 「許容時間がtmp_time分少ない時の価値 + tmp_value」が「現在格納されている値」よりも大きければ格納する
    sum_value = dp[t_accepted - tmp_time] + tmp_value
    dp[t_accepted] = sum_value if dp[t_accepted] < sum_value
  end
end

puts ans.max


Measured memory_bytes: 2172
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp20
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] HW = Console.ReadLine().Split().Select(int.Parse).ToArray();
            string[] S = new string[HW[0]];
            string ans = "Yes";
            for (int i = 0; i < HW[0]; i++)
            {
                S[i] = Console.ReadLine();
            }
            for (int i = 0; i < S.Length; i++)
            {
                S[i] = "." + S[i] + ".";
            }
            for (int i = 1; i < S[0].Length-1; i++)
            {
                if (S[0][i] == '#')
                {
                    if (S[0][i - 1] == '.' && S[0][i + 1] == '.' && S[1][i] == '.') ans = "No";
                }
            }
            for (int i = 1; i < HW[0] - 1; i++)
            {
                for (int j = 1; j < S[i].Length - 1; j++)
                {
                    if (S[i][j] == '#')
                    {
                        if (S[i][j - 1] == '.' && S[i][j + 1] == '.' && S[i + 1][j] == '.' && S[i - 1][j] == '.') ans = "No";
                    }
                }
            }
            for (int i = 1; i < S[HW[0]-1].Length-1; i++)
            {
                if (S[HW[0] - 1][i] == '#')
                {
                    if (S[HW[0] - 1][i - 1] == '.' && S[HW[0] - 1][i + 1] == '.' && S[HW[0] - 2][i] == '.') ans = "No";
                }
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13396
/*
 *  author : Atul Anand   
 *  created on : Tue Mar 31 2020
 */

import java.io.*;
import java.util.*;

public class Main{

    public static void main(String[] args) throws IOException {
        double L = in.nextInt();
        double volume = (L/3) * (L/3) * (L/3);
        println(volume);
        in.close();
        out.close();
    }

    static int MIN = Integer.MIN_VALUE;
    static int MAX = Integer.MAX_VALUE;
    static Reader in = new Reader();
    static PrintWriter out = new PrintWriter(System.out);

    static void read(int arr[], int N) throws IOException { 
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextInt(); 
    	} 
    }
    
    static void read(long arr[], int N) throws IOException { 
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextLong(); 
    	} 
    }
    
    static void read(String arr[], int N) throws IOException { 
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.next(); 
    	} 
    }
    
    static void print(Object O) {  
    	out.print(O); 
    }
    
    static void println(Object O) { 
    	out.println(O); 
    }
    
    static void println(int arr[]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		print(arr[i]+" "); 
    	} 
    	println(""); 
    }

    static void println(int arr[][]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		println(arr[i]); 
    	}
    }
    
    static void debug(Object O) { 
    	System.out.println(O); 
    }
}

class Reader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    Reader() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { 
            tokenizer = new StringTokenizer(reader.readLine()); 
        }
        return tokenizer.nextToken();
    }

    int nextInt() throws IOException { 
        return Integer.parseInt(next()); 
    }
    
    double nextDouble() throws IOException { 
        return Double.parseDouble(next());
    }
    
    long nextLong() throws IOException { 
        return Long.parseLong(next()); 
    }
    
    String nextLine() throws IOException { 
        return reader.readLine(); 
    }
    
    void close() throws IOException { 
        reader.close(); 
    }
}

Measured memory_bytes: 21204
#include <bits/stdc++.h>
#define MOD 1000000007
//for(int i=0; i<n; ++i)
using namespace std;

int main()
{
    int l, r;
    string st;
    cin >> st;
    l = (st[0] - '0') * 10 + (st[1] - '0');
    r = (st[2] - '0') * 10 + (st[3] - '0');

    if (l <= 12 && l >= 1)
    {
        if (r <= 12 && r >= 1)
            cout << "AMBIGUOUS";
        else
            cout << "MMYY";
    }
    else
    {
        if (r <= 12 && r >= 1)
            cout << "YYMM";
        else
            cout << "NA";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
//#define cerr if(false) cerr
#define show(...) cerr << #__VA_ARGS__ << " = ",debug(__VA_ARGS__);
using namespace std;
using ll = long long;
using pii = pair<int,int>;
template<typename T, typename S>
ostream &operator<<(ostream &os,pair<T,S>a){
    os << '(' << a.first << ',' << a.second << ')';
    return os;
}
template<typename T>
ostream &operator<<(ostream &os, vector<T> v){
    for(auto x:v)os << x << ' ';
    return os;
}
void debug(){cerr << '\n';}
template<typename H, typename... T>
void debug(H a, T... b){
    cerr << a;
    if(sizeof...(b))cerr << ", ";
    debug(b...);
}
ll mod=1000000007;
ll combi(ll N_, ll C_) {
    const int NUM_=400001;
    static ll fact[NUM_+1],factr[NUM_+1],inv[NUM_+1];
    if (fact[0]==0) {
        inv[1]=fact[0]=factr[0]=1;
        for (int i=2;i<=NUM_;++i) inv[i] = inv[mod % i] * (mod - mod / i) % mod;
        for (int i=1;i<=NUM_;++i) fact[i]=fact[i-1]*i%mod, factr[i]=factr[i-1]*inv[i]%mod;
    }
    if(C_<0 || C_>N_) return 0;
    return factr[C_]*fact[N_]%mod*factr[N_-C_]%mod;
}
ll hcomb(ll P_, ll Q_) { return (P_==0&&Q_==0)?1:combi(P_+Q_-1,Q_);}

ll modpow(ll a, ll n = mod-2) {
    ll r=1;
    while(n) r=r*((n%2)?a:1)%mod,a=a*a%mod,n>>=1;
    return r;
}
ll dp[223456];
vector<int>b[200005];
int main(){
    int n;
    cin >> n;
    vector<int>a;
    rep(i,n){
        int x;
        cin >> x;
        if(a.size() and a.back() == x)continue;
        a.push_back(x);
    }
    n = (int)a.size();
    dp[0] = 1;
    rep(i,n){
        dp[i+1] = dp[i];
        if(b[a[i]].size()){
            dp[i+1] += dp[b[a[i]].back()+1];
        }
        b[a[i]].push_back(i);
        dp[i+1] %= mod;
    }
    cout << dp[n] << endl;
}

Measured memory_bytes: 15476
#include <iostream>
#include <cmath>

using namespace std;
static const int MAX = 10000;

int isPrime (int x);

int main() {
        int i, n, A[MAX], c = 0;

        cin >> n;
        for (i = 0; i < n; i++)
                cin >> A[i];

        for (i = 0; i < n; i++) {
                c += isPrime(A[i]);
        }

        cout << c << endl;

        return 0;
}

int isPrime (int x) {
        int r, i;

        if (x < 2)
                return 0;

        if (x == 2)
                return 1;

        if (x % 2 == 0)
                return 0;

        r = sqrt(x);
        for (i = 3; i <= r; i = i + 2) {
                if (x % i == 0)
                        return 0;
        }

        return 1;
}

Measured memory_bytes: 3084
import math
a, b, h, m = map(int, input().split())
m_h = m
if h ==0:
    h = 12
if m == 0:
    m_h = 0
    m = 60
sub_degrees = abs((360/12) * h + (30/12) * (m_h/5)  - (360/60) * m )
print(math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(math.radians(sub_degrees))))

Measured memory_bytes: 9496
#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
	ll n,w;
	cin>>n>>w;
	ll a[n][2];
	for(int i=0;i<=n;i++)
	{
		cin>>a[i][0]>>a[i][1];
	}

	ll dp[n+1][100001];
	for(int i=0;i<=n;i++)
	{
		for(int j=0;j<=w;j++)
		{
			if(i==0 || w==0)
				dp[i][j]=0;
			else if(a[i-1][0]<=j)
			{
				dp[i][j]=max(dp[i-1][j],a[i-1][1]+dp[i-1][j-a[i-1][0]]);
			}
			else
				dp[i][j]=dp[i-1][j];
		}
	}
	cout<<dp[n][w]<<endl;
}

Measured memory_bytes: 79104
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
#define fore(i,a,b) for(ll i=(a);i<=(b);++i)
#define rep(i,n) fore(i,0,(n)-1)
#define rfore(i,a,b) for(ll i=(b);i>=(a);--i)
#define rrep(i,n) rfore(i,0,(n)-1)
#define all(x) (x).begin(),(x).end()
const ll INF=1001001001;
const ll LINF=1001001001001001001;
const ll D4[]={0,1,0,-1,0};
const ll D8[]={0,1,1,0,-1,-1,1,-1,0};
template<class T>
bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>
bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
template<class T>
ll sum(const T& a){return accumulate(all(a),0LL);}

void solve(){
    string s;cin>>s;
    ll ans=0,cnt=0;
    rep(i,s.size()){
        if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T')cnt++;
        else cnt=0;
        chmax(ans,cnt);
    }
    cout<<ans<<endl;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    solve();
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<algorithm>
#define int long long
using namespace std;
typedef pair<int,int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1000000000000

int MOD=1000000007;
int modpow(int a,int x){
  if(a<0)a+=MOD;
  int ans=1;
  while(x>0){
    if(x&1) ans=ans*a%MOD;
      a=a*a%MOD;
      x>>=1;
  }
  return ans;
}

int gyaku(int n){
    return modpow(n,MOD-2);
}
signed main() {
  rep(i,5){
    int t;
    cin>>t;
    if(t==0)cout<<i+1<<endl;
  }
}


Measured memory_bytes: 3520
import sys
readline = sys.stdin.readline

N, K = map(int, readline().split())
A = list(map(int, readline().split()))

Ans = ['Yes']*(N-K)
for i in range(N-K):
    if A[i] >= A[K+i]:
        Ans[i] = 'No'

print('\n'.join(Ans))

Measured memory_bytes: 92196
#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define N 1000000007
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,i,ans = 0,j,a,b,c;
    string s;
    cin>>n>>s;
    for(int i=0;i<1000;i++)
    {
        c = i%10;
        b = (i/10)%10;
        a = i/100;
        for(j=0;j<n;j++)
            if(s[j] == a +'0')
                break;
        for(j++;j<n;j++)
            if(s[j] == b + '0')
                break;
        for(j++;j<n;j++)
            if(s[j] == c + '0')
                break;
        if(j < n)
            ans++;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);

    string s,t;
    cin>>s>>t;
    if(s+t.back()==t)cout<<"Yes"<<endl;
    else             cout<<"No"<<endl;
}


Measured memory_bytes: 3612
#include<iostream>
#include<vector>
#include<queue>
#include <string>
#include <sstream>
#include <queue>
#include <map>
#include <algorithm>
using namespace std;

const long MOD = 1e9 + 7;
int main()
{
  string s;
  cin >> s;

  char stone = s[0];
  long ans = 0;
  for (int i = 1; i < s.size(); i++) {
    if (stone != s[i]){
      ans++;
      stone = s[i];
    }
  }


  cout << ans << endl;
  return 0;
}






Measured memory_bytes: 512
import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

L, R = MAP()
l = L/2019
r = R/2019

if R-L>2019:
	print(0)
	sys.exit()
elif str(l)[0]!=str(r)[0]:
	print(0)
	sys.exit()
else:
	min = float('INF')
	l = 0
	r = 0
	for i in range(L, R+1):
		for j in range(i, R+1):
			if i==j: continue
			mo = (i*j) % 2019
			if mo < min:
				min = mo
				l = i
				r = j
print(min)

Measured memory_bytes: 3064
#include <bits/stdc++.h>

using namespace std;

#ifndef ONLINE_JUDGE
	#define W(x, y) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << y;
#else
	#define W(x, y)
#endif

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<pii>;
using vl = vector<ll>;
using vll = vector<pll>;
using ld = long double;
#define ff first
#define ss second
const ld pi = acosl(-1);
const ll prime = 1000000000 + 7;
const ll INF = 1000000000;



int main(){
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    ll q;
    cin >> q;
    vector<pair<ll, pll>> vet1(q);
    multiset<ll, greater<ll>> conj1;
    multiset<ll, less<ll>> conj2;
    ll qtd = 0;
    for(int i = 0; i < q; ++i){
        cin >> vet1[i].ff;
        if(vet1[i].ff == 1){
            cin >> vet1[i].ss.ff >> vet1[i].ss.ss;
        }
    }
    ll flag = 0;
    ll aam = 0;
    ll aaM = 0;
    ll bb = 0;
    ll val1 = 0, val2 = 0, aux = 0;
    for(int i = 0; i < q; ++i){
        ll t = vet1[i].ff;
        if(t == 1){
            ll a = vet1[i].ss.ff;
            ll b = vet1[i].ss.ss;
            qtd++;
            // if(qtd == 1){
            //     val1 = a;
            // } else if(qtd == 2){
            //     val2 = a;
            //     if(val1 > val2){
            //         swap(val1, val2);
            //     }
            // } else 
            if(qtd%2 == 1){
                val2 += a;
                conj2.insert(a);
                aux = *conj2.begin();
                val1 += aux;
                val2 -= aux;
                conj1.insert(*conj2.begin());
                conj2.erase(conj2.begin());
            } else{
                val1 += a;
                conj1.insert(a);
                aux = *conj1.begin();
                val2 += aux;
                val1 -= aux;
                conj2.insert(*conj1.begin());
                conj1.erase(conj1.begin());
            }
            bb += b;
        } else{
            aux = *conj1.begin();
            ll res = (aux * conj1.size()) - (aux * conj2.size()) - val1 + val2 + bb;
            cout << aux << " " << res << "\n";
        }
    }
    return 0;
}

/*
10
10 9 7 8 6 5 3 4 2 1
*/
// 0 1 2 3 4 5 6 7 8 9 10
// 0 2 0 0 0 4 0 0 0 2 0 

Measured memory_bytes: 17060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define SZ(i) int(i.size())
#ifdef tmd
#define IOS()
#define debug(...) fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);_do(__VA_ARGS__);
template<typename T> void _do(T &&x){cerr<<x<<endl;}
template<typename T, typename ...S> void _do(T &&x, S &&...y){cerr<<x<<", ";_do(y...);}
#else
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define debug(...)
#endif

const int MAXN = 500005;
const ll MOD = 1000000007;

ll n, x, y;
struct Critical {
    ll mn, mx;
    Critical () {
        mn = 0x3f3f3f3f, mx = -(0x3f3f3f3f);
    }

    void upd (ll v) {
        mn = min(mn, v);
        mx = max(mx, v);
    }
} ctp[4], sta[2]; // r, l, u, d

/*********************GoodLuck***********************/
int main () {
    IOS();

    cin >> n;

    REP (i, n) {
        cin >> x >> y;
        x *= 2, y *= 2;
        char d;
        cin >> d;
        if (d == 'R') {
            ctp[0].upd(x);
            sta[1].upd(y);
        } else if (d == 'L') {
            ctp[1].upd(x);
            sta[1].upd(y);
        } else if (d == 'U') {
            sta[0].upd(x);
            ctp[2].upd(y);
        } else {
            sta[0].upd(x);
            ctp[3].upd(y);
        }
    }

    ll ans = 0x3f3f3f3f3f3f3f3f;
    REP (i, 800000050) {
        ll mnx = min({sta[0].mn, ctp[0].mn+i, ctp[1].mn-i});
        ll mxx = max({sta[0].mx, ctp[0].mx+i, ctp[1].mx-i});
        ll mny = min({sta[1].mn, ctp[2].mn+i, ctp[3].mn-i});
        ll mxy = max({sta[1].mx, ctp[2].mx+i, ctp[3].mx-i});

        ans = min(ans, (mxx-mnx)*(mxy-mny));
    }
    if (ans % 4 == 0) {
        cout << ans/4 << endl;
    } else {
        if (ans % 4 == 1 || ans % 4 == 3) {
            cout << ans/4 << "." << ans%4*25 << endl;
        } else {
            cout << ans/4 << ".5" << endl;
        }
    }

}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin >> n;

	bool ans = true;
	for (int i = 0; i < n; ++i) {
		int a;
		cin >> a;

		if (a % 2 == 0) {
			if (a % 3 != 0 && a % 5 != 0) {
				ans = false;
				break;
			}
		}
	}

	cout << (ans ? "APPROVED" : "DENIED");
	
	return 0;
}
	

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main(){
 int N;
 cin >> N;
 
 if(N/100 == 7){
   cout << "Yes" << endl;
 }
 else if((N%100)/10 == 7){
   cout << "Yes" << endl;
 }
 else if( ((N%100)%10) == 7){
   cout << "Yes" << endl;
 }
 else{
   cout << "No" << endl;
 }
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;

bool IsPrime(int num){
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0){
            return false;
        }
    }
    // 素数である
    return true;
}

int main(){
    int x; cin >> x;
    bool searched = false;
    while(!searched){
        searched = IsPrime(x);
        if(!searched){
            x += 1;
        }
    }
    cout << x << endl;
    return 0;
}

Measured memory_bytes: 256