akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll inf=1e9+7;
const ll mod=998244353;
signed main(){
    ll a;cin>>a;
    cout<<a+a*a+a*a*a<<endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
#define ll long long int
#define li long int
#define ull unsigned long long int
#define rep(i,a,b) for(i=a;i<b;i++)
#define db double
#define MOD 1000000007
#define MAX 1000001
#define pb push_back
#define mp make_pair
#define nl "\n"
using namespace std;
int main(int argc, char const *argv[]) {
    ll n;
    cin>>n;
    ll sum=0,i;
    rep(i,1,n+1)
    {
        if(i%3!=0 && i%5!=0)
            sum+=i;
    }
    cout<<sum<<nl;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int n,m,K,a[300100];
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>K>>n;m=n;
	if(K&1){
		for(int i=1;i<=n;++i)a[i]=K/2+1;
		for(int i=1;i<=n/2;++i)
			if(!--a[m])--m;
			else fill(a+m+1,a+n+1,K),m=n;
	}else for(int i=1;i<=n;++i)a[i]=(i==1?K/2:K);
	for(int i=1;i<=m;++i)cout<<a[i]<<" \n"[i==m];
	return 0;
}


Measured memory_bytes: 3456
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<utility>
#include<vector>
#include<string>
#include<iostream>

using namespace std;

int main(void){
    int N;
    cin >> N;
    int A[N];
    for(int i=0;i<N;i++){
        cin >> A[i];
    }
    int flg = 0;
    for(int i=0;i<N;i++){
        if(A[i]%2==0){
            if(A[i]%3 != 0 && A[i]%5 != 0){
                    cout << "DENIED" << endl;
                    return 0;
            }
        }
    }

        cout << "APPROVED" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  int p[N];
  FOR(i,0,N) cin >> p[i];
  sort(p, p + N);
  p[N-1] /= 2;
  int ans = 0;
  FOR(i,0,N) {
    ans += p[i];
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void) {
	int a, b, c, d, e, heikin;
	scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
	if(a < 40)
		a = 40;
	if(b < 40)
		b = 40;
	if(c < 40)
		c = 40;
	if(d < 40)
		d = 40;
	if(e < 40)
		e = 40;
	
	heikin = (a + b + c + d + e) / 5;
	printf("%d\n",heikin);
	
	return 0;
}

Measured memory_bytes: 600
#include<bits/stdc++.h>
typedef long long ll;
#define pii pair<int,int>
#define ff first
#define ss second
using namespace std;
void fast()
{
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
}
int main()
{
    ll n,i,j;
    ll a[105],ans1=0,sum=0,temp,ans=100000000;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(i=-100;i<=100;i++)
    {
        temp=0;
        for(j=0;j<n;j++)
        {
            temp+=(i-a[j])*(i-a[j]);
        }
        ans=min(ans,temp);
    }
    cout<<ans<<endl;

}

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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) max((a),-(a))
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define RET return 0
#define MOD 1000000007
#define INF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  vector<vector<int>> l={
    {-1,3,1,4,2,-1},
    {2,-1,5,0,-1,3},
    {4,0,-1,-1,5,1},
    {1,5,-1,-1,0,4},
    {3,-1,0,5,-1,2},
    {-1,2,4,1,3,-1},
  };
  while(1){
    int n;
    cin >> n;
    if(n==0) return 0;
    vector<int> ans(6,0);
    vector<vector<int>> height(101,vector<int>(101,-1)),num(101,vector<int>(101,-1));
    int t,f;
    int x,y;
    vector<int> vx={0,-1,0,1},vy={1,0,-1,0};
    for(int i=0;i<n;i++){
      cin >> t >> f;
      t--,f--;
      x=y=50;
      while(1){
        vector<pair<int,int>> mm={{f,0},{l[t][f],1},{5-f,2},{5-l[t][f],3}};
        sort(all(mm),greater<pair<int,int>>());
        // for(int j=0;j<4;j++) cout << mm[j].first SP mm[j].second << endl;
        bool moved=false;
        for(int j=0;j<4;j++){
          if(mm[j].first<3) break;
          if(height[y][x]>height[y+vy[mm[j].second]][x+vx[mm[j].second]]){
            y=y+vy[mm[j].second];
            x=x+vx[mm[j].second];
            moved=true;
            if(mm[j].second==0) f=t;
            if(mm[j].second==2) f=5-t;
            t=5-mm[j].first;
            break;
          }
        }
        // cout << t SP f << endl;
        if(!moved) break;
      }
      if(num[y][x]>=0) ans[num[y][x]]--;
      num[y][x]=t;
      height[y][x]++;
      ans[t]++;
    }
    for(int i=0;i<=4;i++){
      cout << ans[i] << " ";
    }
    cout << ans[5] << endl;
  }
  return 0;
}



Measured memory_bytes: 3144
#include<stdio.h>

int main(){
  int a,b;
  scanf("%d %d",&a,&b);
  // scnaf("%d",&b);
  if(a<b){
    printf("a < b\n");
  }
  if(a>b){
    printf("a > b\n");
  }
  if(a==b){
    printf("a == b\n");
  }
}

Measured memory_bytes: 1004
import collections
s = input()
t = input()

dic1 = {}
dic2 = {}
f = True
for i,j in zip(s,t):
    if i in dic1:
        if dic1[i] != j:
            f = False
    else:
        dic1[i] = j
    if j in dic2:
        if dic2[j] != i:
            f = False
    else:
        dic2[j] = i
if f:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 4144
#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <cassert>
#include <utility>
#include <iomanip>
#include <chrono>
#include <random>
#include <bitset>

using namespace std;

#define sz(x) (int) x.size()
#define unique(x) x.erase(unique(x.begin(), x.end()), x.end())
#define all(a) a.begin(), a.end()
#define sqr(x) ((x) * (x)) 
#define y1 aksjdaskdjksjfksdjf
#define left kdnvldvoiwejifejg
#define right lkdsjflksdjfdjfk
#define prev asdasfsadjkjsdfjs
#define tm aklsjdasjdasjdkdjjf
#define lcm hddalkwjeidjjhasda
#define random_shuffle asdasdd

const int MAXN = 105000;

int n, m;
int a[MAXN];
long long stupid = 0;
vector<int> startHere[MAXN], endHere[MAXN];
vector<int> startHere2[MAXN], endHere2[MAXN];

int jump(int from, int to) {
  if (to > from) {
    return to - from;
  }
  return m - from + to;
}

int main() { 

  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }

  for (int i = 1; i < n; i++) {
    stupid += jump(a[i - 1], a[i]);
  }

  for (int i = 1; i < n; i++) {
    if (a[i] > a[i - 1]) {
      startHere[a[i - 1]].push_back(i);
      endHere[a[i]].push_back(i);
    } else {
      startHere2[a[i - 1]].push_back(i);
      endHere2[a[i]].push_back(i);
    }
  }

  long long ans = stupid;
  long long rem = 0, add = 0;
  int cnt1 = 0, cnt2 = 0, cnt3 = 0;
  for (int x = 1; x <= m; x++) {
    for (int i : endHere2[x]) {
      rem += jump(a[i - 1], a[i]);
      add += 1 + a[i];
      cnt1++;
    }
  }

  // cerr << stupid << endl;
  for (int x = 1; x <= m; x++) {
    // cerr << x << " " << stupid - rem + add - 1ll * x * (cnt1 + cnt2 + cnt3) << endl;
    // cerr << rem << " " << add << " " << cnt1 << " " << cnt2 << " " << cnt3 << endl;
    ans = min(ans, stupid - rem + add - 1ll * x * (cnt1 + cnt2 + cnt3));

    for (int i : startHere2[x]) {
      rem += jump(a[i - 1], a[i]);
      add += 1 + m + a[i];
      cnt2++;
    }
    for (int i : endHere[x]) {
      rem -= jump(a[i - 1], a[i]);
      add -= 1 + a[i];
      cnt3--;
    }
    for (int i : endHere2[x]) {
      rem -= jump(a[i - 1], a[i]);
      add -= 1 + a[i];
      cnt1--;
    }
    for (int i : startHere[x]) {
      rem += jump(a[i - 1], a[i]);
      add += 1 + a[i];
      cnt3++;
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 15232
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(std::unique(all(x)), x.end());
typedef long long ll;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
const double PI = acos(-1);
using namespace std;
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>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

int main() {
    int l;
    cin >> l;
    int n;
    rrep(i, 25) {
        if (l & (1 << i)) {
            n = i + 1;
            break;
        }
    }

    int m = 0;
    int total = 0;
    vector<tuple<int, int, int>> ans;
    for (int i = 1; i < n; i++) {
        ans.emplace_back(i, i + 1, 0);
        ans.emplace_back(i, i + 1, (1 << (i - 1)));
        m += 2;
        total += (1 << (i - 1));
    }

    int now = l - 1;
    for (int i = 1; i < n; i++) {
        if (l & (1 << (i - 1))) {
            ans.emplace_back(i, n, now - (1 << (i - 1)) + 1);
            now -= (1 << (i - 1));
            m++;
        }
    }

    cout << n << " " << m << endl;
    for (auto t : ans) {
        int u, v, w;
        tie(u, v, w) = t;
        cout << u << " " << v << " " << w << endl;
    }
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define all(a) a.begin(),a.end()
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
llfor;ll mod=1000000007;
/*pi*/double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll ans=1;rep(i,0,n){ans*=x;ans%=mod;}return ans;}
/*階乗*/ll fact(ll x){ll ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){ll ans=1;rrp(i,n-r+1,n+1){ans*=i;ans%=mod;}return ans/=fact(r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*Fibonacci数列*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
/*桁数*/ll dig(ll n){ll d=1,tmp=n;while(tmp/10>0){tmp/=10;d++;}return d;}
double ans=0;
////////////////////////////////////////////////////////////
int main(){
 ll n,k;sc(n);sc(k);
 double a[n+10];
 ll b;
 rep(i,0,n){
  sc(b);
  a[i]=(b+1)/2.00000;
 }
 double sum=0;
 rep(i,0,k){
  sum+=a[i];
 }
 ans=sum;
 rep(i,1,n-k+1){
  sum+=a[i+k-1]-a[i-1];
  ans=max(sum,ans);
 }
 printf("%.10lf\n",ans);
return 0;}


Measured memory_bytes: 5260
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  vector< int > time;
  for(int k = 0; k < 2; k++){
    scanf("%d", &N);
    while(N--){
      int h, m;
      scanf("%d %d", &h, &m);
      time.push_back(h * 60 + m);
    }
  }
  sort( time.begin(), time.end());
  time.erase( unique(time.begin(), time.end()), time.end());
  for(int i = 0; i < time.size(); i++){
    if(i > 0) putchar(' ');
    printf("%d:%02d", time[i] / 60, time[i] % 60);
  }
  putchar('\n');
}


Measured memory_bytes: 3264
#define pb push_back
#define MX 1e18
#define mod 1000000009
#define ff first
#define ss second
#define for1(i,n) for(int i=1;i<=n;i++)
#define for0(i,n) for(int i=0;i<n;i++)
#include <bits/stdc++.h>
using namespace std;
typedef long long unsigned  ll;

int main(int argc, char const *argv[]) {
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  if((abs(b-a)<=d && abs(c-b)<=d) ||(abs(a-c)<=d) ) cout<<"Yes";
  else cout<<"No";
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }



int a, b, n;

int main() {
    while (cin >> a >> b >> n) {
        int res = 0;
        int r = a % b;
        for (int i = 0; i < n; ++i) {
            r *= 10;
            res += r / b;
            r %= b;
        }
        cout << res << endl;
    }
    
    return 0;
}


Measured memory_bytes: 1160
#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-11;

ll dp[110][100010];

int main() {
    ll N, W;
    cin >> N >> W;
    ll w[N], v[N];
    REP(i, 0, N) {
        cin >> w[i] >> v[i];
    }
    REP(i, 0, 110) {
        fill(dp[i], dp[i] + 100010, -1);
    }
    dp[0][0] = 0;
    REP(i, 0, N) {
        REP(j, 0, W) {
            if (dp[i][j] >= 0) {
                dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
            }
            if (dp[i][j] >= 0 && j + w[i] <= W) {
                dp[i + 1][j + w[i]] = max(dp[i + 1][j + w[i]], dp[i][j] + v[i]);
            }
        }
    }
    // REP(i, 0, N + 1) {
    //     REP(j, 0, W + 1) {
    //         cout << dp[i][j] << " ";
    //     }
    //     cout << endl;
    // }
    ll ans = 0;
    REP(i, 0, W + 1) {
        ans = max(ans, dp[N][i]);
    }
    cout << ans << endl;
}


Measured memory_bytes: 86144
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void strInit(char str[]){
    int len=strlen(str);
    for(int i=0;i<len;i++){
        str[i]=0;
    }
}

void extIntStr(char str[],int data[]){
    int length=strlen(str);
    str[length-1]=' ';
    char buff[12];
    int j,index;
    index=j=0;
    for(int i=0;i<length;i++){
        if(str[i]!=' '){
            buff[j++]=str[i];
        }else{
            data[index++]=atoi(buff);
            strInit(buff);
            j=0;
        }
    }
}



int main(){
    int N;
    scanf("%d ",&N);
    int *data;
    char *str;
    data=(int*)malloc(sizeof(int)*N);
    str=(char*)malloc(sizeof(char)*N*10+1);
    fgets(str,N*10+N+1,stdin);
    extIntStr(str,data);
    double ans=0;
    for(int i=0;i<N;i++){
        ans+=1/(double)data[i];
    }
    ans=1/ans;
    printf("%f",ans);
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
const int maxn = 505;
char mp[maxn][maxn];

int main(){
    int n, m;
    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; i++){
        scanf("%s", mp[i]);
    }
    for(int i = 0; i < n; i++){
        putchar('#');
        for(int j = 1; j < m - 1; j++){
            putchar((i & 1) ? mp[i][j] : '#');
        }
        puts(".");
    }
    puts("");
    for(int i = 0; i < n; i++){
        putchar('.');
        for(int j = 1; j < m - 1; j++){
            putchar((i & 1) ? '#' : mp[i][j]);
        }
        puts("#");
    }

    return 0;
}


Measured memory_bytes: 1024
A, B = map(int,input().split())
if A != 1 and B != 1:
    if A > B:
        print('Alice')
    elif A < B:
        print('Bob')
    else:
        print('Draw')
else:
    if A == 1 and B == 1:
        print('Draw')
    elif A == 1:
        print('Alice')
    else:
        print('Bob')

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

using namespace std;
double circle(int r){
    return 2* 3.14159 * r;
}
int main() {
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    int r;
    cin >> r;
    cout << circle(r);

}

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

#define double long double
#define int long long
#define vec vector
#define pb push_back
#define unset unordered_set
#define ii pair<int, int>
#define X first
#define Y second
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORE(i, a, b) for(int i = (a); i <= (b); i++)
#define FORD(i, a, b) for(int i = (a); i >= (b); i--)
#define bitcount(n) __builtin_popcountll(n)
template <typename T,typename U>
std::pair<T,U> operator+(const std::pair<T,U> & l,const std::pair<T,U> & r) {
  return {l.first+r.first,l.second+r.second};
} 
typedef void (*callback_function)(void); // type for conciseness
const long long ZERO = 0LL;
const long long INF64 = 1e18;
const int INF32 = 1e9;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0L);
const double EPS = static_cast<double>(1e-9);
typedef long long ll;

inline int Pow(int a, int k) {
  int s = 1; 
  for(; k; k >>= 1) {
    k & 1 ? s = 1LL * s * a % MOD : 0;
    a = 1LL * a * a % MOD;
  }
  return s;
}

const int N = 1e6 + 7;

void input() {
  //freopen("??.in", "r", stdin);
  //freopen("??.out", "w", stdout);
}

void preprocess() {
}

void debug() {
  //  44gg
  if (true) {
  
  }
}



void solve() {
  preprocess();
  // 50gg
  string s;
  cin >> s;
  string ACGT = "ACGT";
  int prev = 0;
  bool found = false;
  int res = 0;
  int n = s.length();
  FOR(i, 0, n) {
    if (!found and ACGT.find(s[i]) != string::npos) {
      prev = i;
      found = true;
    }
    if (ACGT.find(s[i]) != string::npos) {
      res = max(res, i - prev + 1);
    } else {
      found = false;
    }
  }
  cout << res << endl;
  //debug();
  // read the question correctly (is y a vowel?)
  // look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)
}

void output() {

}

#undef int
int main() {
#define int long long
	ios_base::sync_with_stdio(false);
	cin.tie();
  //auto beginProgram = chrono::steady_clock::now();

  //int t; cin >> t;
  //while (t--) 
  {
    input();
    solve();
    output();
  }

  //auto endProgram = chrono::steady_clock::now();

  return 0;
}


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

typedef long long ll;
typedef pair<int,int> P;
int dx[] = {-1, 1, 0,  0};
int dy[] = { 0, 0, 1, -1};
 
int main(){
  int n, k;
  cin >> n >> k;
  vector<ll> mx, x;
  for(int i=0; i<n; i++){
    ll a;
    cin >> a;
    if(a<0) mx.push_back(abs(a));
    else x.push_back(a);
  }
  sort(mx.begin(), mx.end());
  sort(x.begin(), x.end());
  ll ans = 1000000000009;
  for(int i=0; i<=mx.size(); i++){
    if(i==0){
      if(k>x.size()) continue;
      ans = min(x[k-1], ans);
      continue;
    }
    if(k-i>x.size()) continue;
    if(k<i) continue;
    ll tmp;
    if(k==i) tmp = mx[k-1];
    else tmp = min(mx[i-1], x[k-i-1]) + mx[i-1] + x[k-i-1];
    ans = min(tmp, ans);
  }
  for(int i=0; i<=x.size(); i++){
    if(i==0){
      if(k>mx.size()) continue;
      ans = min(mx[k-1], ans);
      continue;
    }
    if(k-i>mx.size()) continue;
    if(k<i) continue;
    ll tmp;
    if(k==i) tmp = x[k-1];
    else tmp = min(x[i-1], mx[k-i-1]) + x[i-1] + mx[k-i-1];
    ans = min(tmp, ans);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1656
/**
 *    author:  tourist
 *    created: 20.05.2018 16:16:39       
**/
#undef _GLIBCXX_DEBUG
#undef LOCAL

#include <bits/stdc++.h>

using namespace std;

string to_string(string s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector< vector<int> > x(n + 1);
  for (int i = 0; i <= n; i++) {
    string foo;
    cin >> foo;
    assert((int) foo.size() == (1 << i));
    x[i].resize(1 << i);
    for (int j = 0; j < (1 << i); j++) {
      x[i][j] = (foo[j] == '1' ? 1 : 0);
    }
  }
  vector<int> y[22][22];
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= i; j++) {
      y[i][j].resize(1 << i);
    }
    for (int j = 0; j < (1 << i); j++) {
      y[i][0][j] = x[i][j];
    }
  }
  for (int i = n; i >= 0; i--) {
    for (int j = 0; j < i; j++) {
      for (int t = 0; t < (1 << i); t++) {
        int yt = y[i][j][t];
        if (yt == 0) {
          continue;
        }
        debug(i, j, t, yt);
        {
          int nt = (t & ((1 << j) - 1));
          y[j][j][nt] += y[i][j][t];
        }
        for (int bit = 0; bit < 2; bit++) {
          int nxt = -1;
          for (int pos = j; pos < i; pos++) {
            if (((t >> pos) & 1) == bit) {
              nxt = pos;
              break;
            }
          }
          if (nxt == -1) {
            continue;
          }
          int nt = (t & ((1 << j) - 1));
          nt |= ((t >> nxt) << j);
          debug(i - (nxt - j), j + 1, nt);
          y[i - (nxt - j)][j + 1][nt] += y[i][j][t];
        }
      }
    }
    for (int t = 0; t < (1 << i); t++) {
      if (y[i][i][t] >= k) {
        for (int pos = i - 1; pos >= 0; pos--) {
          cout << ((t >> pos) & 1);
        }
        cout << '\n';
        return 0;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 174496
#include <iostream>
using namespace std;

int main(){
  int n,x;
  cin >> n >> x;
  int a[n];
  for(int i=0;i<n;i++) cin >> a[i];
  int count=1;
  int d=0;
  for(int i=0;i<n;i++){
    d+=a[i];
    if(d<=x) count++;
  }
  cout << count << endl;
}

Measured memory_bytes: 256
#include <vector>
#include <functional>
#include <deque>
#include <stdexcept>

template<typename T, typename Container = ::std::vector<T>, typename Compare = ::std::greater<typename Container::value_type>>
class sliding_window {
    using iterator_type = typename Container::const_iterator;
    using value_compare = Compare;
    using value_type = T;
    using const_reference = const value_type &;

    iterator_type right_bound, left_bound, end;
    value_compare comp;
    size_t length;
    ::std::deque<value_type> val;

public:
    void push() {
        if (left_bound == end) {
            throw ::std::runtime_error("already reached to the end");
        }
        const auto &tmp = *left_bound;
        while (!val.empty() && comp(val.back(), tmp))val.pop_back();
        val.push_back(tmp);
        ++left_bound;
        ++length;
    }

    void pop() {
        if (right_bound == left_bound) {
            throw ::std::runtime_error("interval is empty");
        }
        const auto &tmp = *right_bound;
        if (tmp == val.front())val.pop_front();
        ++right_bound;
        --length;
    }

    sliding_window(iterator_type _begin, iterator_type _end, const Compare &_comp = Compare()) : length(0),
                                                                                                 right_bound(_begin),
                                                                                                 left_bound(_begin),
                                                                                                 end(_end), comp(_comp),
                                                                                                 val({}) {}

    const size_t size() const {
        return length;
    }

    const_reference top() const {
        return val.front();
    }

    void resize(size_t n) {
        if (n < length) {
            while (n < length) {
                pop();
            }
        } else {
            while (n > length) {
                push();
            }
        }
    }

    void forward() {
        if (left_bound != end)push();
        pop();
    }

};

#include <iostream>
#include <algorithm>

int main() {
    unsigned long long N, M, K;
    scanf("%llu%llu%llu", &N, &M, &K);

    std::vector<unsigned long long> A(N), dp1(N), dp2(N);
    for (auto &i : A)scanf("%llu", &i);

    std::copy(A.begin(), A.end(), dp1.begin());

    for (unsigned long long i = 1; i != K; ++i) {
        sliding_window<unsigned long long, std::vector<unsigned long long>, std::less<>> slidingWindow(
                dp1.begin(), dp1.end());
        std::transform(A.begin(), A.end(), dp2.begin(), [&i](auto a) { return a * (i + 1); });

        for (unsigned long long j = 0; j != N; ++j) {
            if (j >= i)dp2[j] += slidingWindow.top();
            if (slidingWindow.size() == M)slidingWindow.pop();
            slidingWindow.push();
        }

        std::swap(dp1, dp2);
    }

    std::cout << *std::max_element(dp1.begin(), dp1.end()) << std::endl;

    return 0;
}


Measured memory_bytes: 2560
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	var input string
	fmt.Scan(&input)

	output := 0
	last := ""
	for _, v := range input {
		if (last == string(v)) {
			last = string(v)
			continue
		}
		last = string(v)
		output++
	}
	fmt.Println(output)
}

Measured memory_bytes: 1664
#include <stdio.h>

int main(void){

  int a, b, c;

  scanf("%d %d %d",&a,&b,&c);

  if(a==b||a==c||b==c){

    if(a==b&&b==c){

      printf("1\n");

    }else{

      printf("2\n");

    }

  }else{

      printf("3\n");

    }

    return 0;

}


Measured memory_bytes: 1592
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int,int>;

vector<int>bitSearch(int bit,int n){
    vector<int>S;
    rep(i,n)if(bit&(1<<i))S.push_back(i);
    return S;
}

int main(){
    int n,m;cin>>n>>m;
    Graph G(n);
    rep(i,m){
        int a,b;cin>>a>>b;
        a--;b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    vector<int>d(n,0);
    vector<bool>seen(n,false);
    queue<int>que;
    que.push(0);
    bool f = false;
    while(!que.empty()){
        int v = que.front();que.pop();
        if(v==n-1)f = true;
        seen[v] = true;
        for(auto nv : G[v]){
            if(seen[nv])continue;
            d[nv] = d[v]+1;
            if(d[nv]>2)continue;
            que.push(nv);
        }
    }
    cout<<(f?"POSSIBLE":"IMPOSSIBLE");
}



Measured memory_bytes: 13168
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <string>
using namespace std;

int main()
{
	int ans, n,m;
	cin >> n >> m;

	cout << n-m+1 << endl;
}

Measured memory_bytes: 3600
#include <iostream>
#include <math.h>
#include <algorithm>
#include <functional> 
#include <string>
#include <vector>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>

using namespace std;

typedef long long LL;

#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 
#define rep(i,n) for (int i = 0; i < (n); ++i)


int main()
{
    int N;
    cin >> N;
    vector<int> W(N);
    rep(i, N) cin >> W[i];

    int i = 0;
    int sumI = W[i];
    int j = N-1;
    int sumJ = W[j];

    while (i + 1 < j) {
        if (sumI < sumJ) {
            ++i;
            sumI += W[i];
        } else {
            --j;
            sumJ += W[j];
        }
    } 

    cout << abs(sumI-sumJ) << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 10;
char s[105][105];
int main() {
    int h, w;
    while(~scanf("%d %d", &h, &w)) {
        memset(s, 0, sizeof s);
        for(int i = 0; i < 50; i++) {
            for(int j = 0; j < 100; j++) s[i][j] = '#';
        }
        for(int i = 50; i < 100; i++) {
            for(int j = 0; j < 100; j++) s[i][j] = '.';
        }
        printf("100 100\n");
        h--; w--;
        int cnt = 0;
        for(int i = 0; i < 50 && h; i++) {
            for(int j = cnt + 1; j < 99 && h; j += 3) {
                s[i][j] = '.'; h--;
            }
            cnt = (cnt + 1) % 3;
        }
        for(int i = 99; i >= 50 && w; i--) {
            for(int j = cnt + 1; j < 99 && w; j += 3) {
                s[i][j] = '#'; w--;
            }
            cnt = (cnt + 1) % 3;
        }
        for(int i = 0; i < 100; i++) printf("%s\n", s[i]);
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <unordered_map>
typedef long long ll;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " \n"[i == n-1];}
#define printp(x,n) for(ll i = 0; i < n; i++){ cout << "(" << x[i].first << ", " << x[i].second << ") "; } cout << endl;
#define INF (1e18)
using namespace std;
const ll MOD = 1e9 + 7;
typedef pair<ll, ll> lpair;
ll f(ll n){
    return (n*n + 4) / 8;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    ll ans = 0;
    rep(i,0,N){
        ll l,r;
        cin >> l >> r;
        ans += r-l+1;

    }
    print(ans);

}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[n];
        int b[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
            b[i] = a[i];
        }
        Arrays.sort(a);
        for (int i = 0; i < n; i++) {
            if (b[i] == a[n - 1]) {
                System.out.println(a[n - 2]);
            } else {
                System.out.println(a[n - 1]);
            }
        }
        sc.close();
    }
}


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

int solve(int n, int t, int *a){
  int max = 0;
  int count = 0;
  int minA[n];
  int profit[n];
  minA[0]=a[0];
  for(int i=1; i<n; i++){
    if(a[i]<minA[i-1]){
      minA[i]=a[i];
    }else{
      minA[i]=minA[i-1];
    }
  }
  for(int i=1; i<n; i++){
    if(a[i] > minA[i-1]){
      profit[i] = a[i]- minA[i-1];
      if(profit[i] > max){
        max = profit[i];
      }
    }
  }
  for(int i=1; i<n; i++){
    if(profit[i] == max){
      count += 1;
    }
  }
  return count;
}

int main(){
  int n,t;
  cin >> n >> t ;
  int a[n];
  for(int i=0; i<n; i++){
    cin >> a[i];
  }
  cout << solve(n,t,a) << endl;
  return 0;
}


Measured memory_bytes: 1408
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";

		while (!(line = br.readLine()).equals("0")) {

			int n = Integer.parseInt(line);
			int[] prog;
			prog = new int[n];

			line = br.readLine();
			StringTokenizer st = new StringTokenizer(line);

			for (int i = 0; i < n; i++) {
				prog[i] = Integer.parseInt(st.nextToken());
			}

			// 出現頻度操作
			int op = 0;
			while (true) {

				// 数え上げ
				int[] freq = new int[n];
				boolean[] chk = new boolean[n];

				for (int i = 0; i < n; i++) {
					if (!chk[i]) {
						int f = 1, t = 1;
						int[] idx = new int[n];
						chk[i] = true;
						idx[0] = i;
						for (int j = 0; j < n; j++) {
							if (!chk[j] && prog[i] == prog[j]) {
								chk[j] = true;
								f++;
								idx[t] = j;
								t++;
							}
						}
						for (int j = 0; j < t; j++) {
							freq[idx[j]] = f;
						}
					}
				}
				//
				if (!Arrays.equals(prog, freq)) {
					prog = freq;
					op++;
				} else {
					prog = freq;
					break;
				}
			}
			System.out.println(op);
			for (int i = 0; i < n; i++) {
				if (i != n - 1) {
					System.out.print(prog[i] + " ");
				} else
					System.out.println(prog[i]);
			}
		}
	}
}

Measured memory_bytes: 20904
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SIZE 32

int main() {
    char line[SIZE];
    long a, b, c, d, e, f;
    while (~scanf("%ld %ld %ld %ld %ld %ld", &a, &b, &c, &d, &e, &f)) {
        if (*line == '\n')
            continue;
        long denom = a * e - b * d;
        float ans_x = (float)(e * c - b * f) / denom;
        float ans_y = (float)(a * f - d * c) / denom;

        //Avoid -0
        ans_x += 0;
        ans_y += 0;
        printf("%.3f %.3f\n", ans_x, ans_y);
    }
}



Measured memory_bytes: 2096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
ll inf = LLONG_MAX;
long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
        string a, b;
        cin >> a >> b;
        ll n = a.size(), m = b.size();
        if (n > m) cout << "GREATER" << endl;
        else if (n < m) cout << "LESS" << endl;
        else if (a > b) cout << "GREATER" << endl;
        else if (a < b) cout << "LESS" << endl;
        else cout << "EQUAL" << endl;
}

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

int main() {
	string S;
	cin >> S;
	long long streaks = 0;
	long long max_streaks = 0;
	for (auto s : S) {
		if (s == 'R') {
			++streaks;
		}
		else {
			max_streaks = max(streaks, max_streaks);
			streaks = 0;
		}
	}
	max_streaks = max(streaks, max_streaks);

	cout << max_streaks << endl;
	return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second

using namespace std;

ll solve(ll arr[], int n)
{
   
    ll ans = arr[0];
 
    for (int i=1; i<n; i++)
    {
      ll p=( ((arr[i]*1)) /
                (__gcd(arr[i], ans)) );
        ans *=p;
	}
 
    return ans;
}
 
int main()
{

 ll a,b,c,d,i,p,n;
 
   cin>>n;
   
   ll ar[n+2];
   
   ll gc;
   
   cin>>gc;
   
   ar[0]=gc;
   
   
   p=n-1;
   
   i=1;
   
   while(p--)
   {
   	cin>>a;
   	ar[i++]=a;
   }
   
  cout<<solve(ar,n);
   
	return 0;
 
} 

Measured memory_bytes: 764
#include <iostream>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <sstream>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <complex>
#include <vector>
#include <bitset>
#include <cstdio>
#include <cmath>
#include <time.h>
#include <tuple>
#define all(c) ((c).begin(),(c).end())
#define rall(c) ((c).rbegin(),(c).rend())
//#define sort(v,n) sort(v,v+n)
#define ll long long
#define fi first
#define se second
#define inf 999999999
using namespace std;
const ll MOD = 1e9 + 7;
const double PI = acos(-1.0);
//---------------------------------------------------------------------------------------------//
int b[7];
int a, l;

inline void digit(int a) {
	int now = 0;
	int nowl = 0;
	for (int i = 0; i < 7; i++)b[i] = 0;
	while (a > 0 && nowl<l) {
		if (a <= 0) {
			b[now] = 0;
			continue;
		}
		b[now++] = a % 10;
		a /= 10;
		nowl++;
	}
}

inline int tsunagu() {
	int ans=0;
	for (int now = 0; now < l; now++) {
		ans *= 10;
		ans += b[now];
	}
	return ans;
}

int main() {
	while (cin >> a >> l, l) {
		map<int, int> mp;
		mp[a] = 1;
		for (int i = 0; i < 7; i++) {
			b[i] = 0;
		}
		int cont = 2;
		while (1) {
			//cout << a << endl;
			digit(a);
			sort(b, b + l);
			int mi = tsunagu();
			reverse(b, b + l);
			int ma = tsunagu();
			//cout << "ma" << ma << "mi" << mi <<"cont"<<cont<< endl;
			a = ma - mi;
			if (mp[a] > 0) {
				cout << mp[a]-1 << " " << a << " " << cont-mp[a] << endl;
				break;
			}
			else {
				mp[a] = cont++;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 3120
n=int(input())
a=list(map(int,input().split()))
cnt=0
ans=1000
for i in range(1,n):
    if a[i-1]<a[i]:
        cnt+=ans//a[i-1]
        ans-=cnt*a[i-1]
        ans+=cnt*a[i]
        cnt=0
print(ans)

Measured memory_bytes: 9148
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	s := nextStr()

	if s[0] == 'R' && s[1] == 'R' && s[2] == 'R' {
		fmt.Println(3)
		return
	}
	if s[0] == 'R' && s[1] == 'R' {
		fmt.Println(2)
		return
	}
	if s[1] == 'R' && s[2] == 'R' {
		fmt.Println(2)
		return
	}
	if s[0] == 'R' || s[1] == 'R' || s[2] == 'R' {
		fmt.Println(1)
		return
	}

	fmt.Println(0)

}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // default=64*1024
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


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

int main() {
  int a, b, c, count = 0;
  while( cin >> a >> b){
  c = a + b;
    b = 1;
    for(int i = 1; i <= 7; i++){
      b *= 10;
      if(c < b){
        cout << i << endl;
        break;
      }
    }
  }
}


Measured memory_bytes: 2980
#include<iostream>
#include<cstdlib>
using namespace std;
long long kj(int z){
  long long ans; int i;
  ans = 1;
  for(i=1;i<=z;i++) ans = (ans*i)%1000000007;
  return ans;
}
int main(){
  int n,m; long long count;
  cin >> n >> m;
  if (abs(n-m) > 1) {
    count = 0;
  } else if (n-m == 0) {
    count = (kj(n)*kj(m)*2)%1000000007;
  } else {
    count = (kj(n)*kj(m))%1000000007;
  }
  cout << count << endl;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int x = sc.nextInt();
        out.println(1 - x);
        out.close();
    }


    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }


    }

}

Measured memory_bytes: 32876
#include <iostream>
using namespace std;
int a, b, c, k, mx;
int main(){
  cin>>a>>b>>c>>k;
  if(k>=a){
    mx+=a;
    k-=a;
  }
  else{
cout<<k<<endl;
    return 0;
  }
  if(k>=b){
k-=b;
  }
  else{
    cout<<mx<<endl;
    return 0;
  }
  mx-=k;
  cout<<mx<<endl;
}

Measured memory_bytes: 3160
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tuple>
#include <map>
#include<set>
using namespace std;

int main() {
	int N;
	cin >> N;
	vector<int> A(N);
	for (int i = 0;i < N;i++) {
		cin >> A.at(i);
	}

	for (int k = 0; k < N;k++) {
		cout << A.at(k);
		if (k < N - 1)cout << " ";
		else cout << endl;
	}
	for (int i = 1;i < N; i++) {
		int v = A.at(i);
		for (int j = i - 1;j >= 0;j--) {
			if (v < A.at(j)) {
				A.at(j + 1) = A.at(j);
				A.at(j) = v;
			}
		}
		for (int k = 0; k < N;k++) {
				cout << A.at(k);
				if (k < N - 1)cout << " ";
				else cout << endl;
		}
			
		
		
	}
}



Measured memory_bytes: 3068
#include<stdio.h>

#define MIN(v0,v1) (v0<v1?v0:v1)
#define MAX(v0,v1) (v0>v1?v0:v1)

int main(){
	int N = 0, i = 0;
	unsigned long t = 0, a = 0, base = 0;
	scanf("%d", &N);
	int T[N], A[N];
	for( i = 0; i < N; i++ ){
		scanf("%d %d", &T[i], &A[i]);
	}
	t = T[0];
	a = A[0];
	for( i = 1; i < N; i++ ){
		unsigned long ts = t/T[i];
		if( t%T[i]!=0 ){ ts++; }
		unsigned long as = a/A[i];
		if(a%A[i]!=0){as++;}
		base = MAX(ts,as);
		t = base * T[i];
		a = base * A[i];
		//printf("%lu, %lu, %lu, %lu, %lu\n", ts, as, base, t, a);
	}
	printf("%lu\n", t + a);
	return 0;
}


Measured memory_bytes: 128
#!/usr/bin/env python3
import sys
import math

def solve(A: int, B: int):
    for i in range(1,1001):
        if A == math.floor(0.08*float(i)) and B == math.floor(0.1*float(i)):
            print(i)
            return
    print(-1)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()


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


int main() {
long N,K;
cin>>N>>K;
vector<long> v(N);
for(int i=0;i<N;i++) cin>>v[i];
long ans=0;
for(int i=0;i<=K;i++){
  for(int j=0;j<=K-i;j++){
    int k=K-i-j;
    if(i+j>N) continue;
    if(k<0) continue;

    priority_queue<long> q;
    for(int a=0;a<i;a++) q.push(-v[a]);
    for(int a=0;a<j;a++) q.push(-v[N-1-a]);
    int now=0;
    while(!q.empty()&&now<k){
      long t=q.top();
      if(t<0) break;
      q.pop();
      now++;
    }
    long tmp=0;
    while(!q.empty()){
      long t=q.top();
      tmp+= -t;
      q.pop();

  }
  
  ans=max(tmp,ans);
}

}
cout<<ans<<endl;
}


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

int main() {
    int n;
    string a, b, ans = "";
    cin >> n >> a >> b;
    rep(i, n) {
        ans += a.at(i);
        ans += b.at(i);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
//https://atcoder.jp/contests/arc031/tasks/arc031_2 
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
#include <deque>
#include <stdio.h>
#include <string>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
	string a;
	cin >> a;
	if (a.back() == 's') {
		a.push_back('e');
		a.push_back('s');
	}
	else {
		a.push_back('s');
	}
	cout << a << endl;
	return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define debug(x) cerr<<#x<<": "<<x<<endl;
#define MOD 1000000007ULL;
#define rep(i,n) for(int i=0;i<n;i++)

const int INF= 1001001001;
vector<int> to[100005];

int main() {
	ll n,m;
  	cin>>n>>m;
  	
  	rep(i,m){
		int a,b;
      	cin>>a>>b;
      	--a;--b;
      	to[a].push_back(b);
      	to[b].push_back(a);
    }
  	
  	queue<int> q;
  	vector<int> dist(n,INF);
  	vector<int> pre(n,-1);
  	dist[0] =0;
  	q.push(0);
  	
  	while(!q.empty()){
     	int v = q.front();
      	q.pop();
      	for(int u:to[v]){
         	if(dist[u]!=INF) continue;
          	dist[u] = dist[v]+1;
          	pre[u] = v;
          	q.push(u);
        }
    }
  	cout<<"Yes"<<endl;
  
  	rep(i,n){
     	if(i==0) continue;
      	int ans=pre[i];
      	++ans;
      	cout<<ans<<endl;
    }
  
}

Measured memory_bytes: 10732
n = int(input())
t, a = map(int, input().split())
h = [int(i) for i in input().split()]
x = 10000000
ans = -100
for i in range(n):
	kion = t - h[i] * 0.006
	if abs(a - kion) < x:
		x = abs(a - kion)
		ans = i
print(ans + 1)

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

int main() {
  string S;
  cin >> S;
  
  if (S.at(S.size()-1) == '0' || S.at(S.size()-1) == '1' || S.at(S.size()-1) == '6' || S.at(S.size()-1) == '8'){
    cout << "pon" << endl;
  }
  else if (S.at(S.size()-1) == '3'){
    cout << "bon" << endl;
  }
  else {
    cout << "hon" << endl;
  }
}



Measured memory_bytes: 3584