akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int (i) = 0; (i) <(int)n; ++(i))



int main(){
    int a, b,c,k;
    cin >> a >> b >> c >> k;
    int sum = 0;
    if(a >= k) {
        cout << k;
        exit(0);
    }
    else {
        sum += 1*a;
        k -= a;
    }

    if(b >= k) {
        cout << sum;
        exit(0);
    }
    else {
        k -= b;
    }
    sum -= k;
    cout << sum;

    
        
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
                                        #include<iostream>
                                        #include<cstdio>
                                        #include<vector>
                                        #include<queue>
                                        #include<map>
                                        #include<cstring>
                                        #include<string>
                                        #include <math.h>
                                        #include<algorithm>
                                    //    #include <boost/multiprecision/cpp_int.hpp>
                                        #include<functional>
                           //     #define int long long
                                        #define inf  1000000007
                                        #define pa pair<int,int>
                                        #define ll long long
                                        #define pal pair<double,pa>
                                        #define ppa pair<int,int>
                                        #define ppap pair<pa,pa>
                                        #define ssa pair<string,int>
                                        #define  mp make_pair
                                        #define  pb push_back
                                        #define EPS (1e-10)
                                        #define equals(a,b) (fabs((a)-(b))<EPS)
                                  #define VI vector<int>
                                        using namespace std;
                                        
                                  class pas{
                                    	public:
                                    	int x,y;
                                    	pas(int x=0,int y=0):x(x),y(y) {}
                                    	pas operator + (pas p) {return pas(x+p.x,y+p.y);}
                                    	pas operator - (pas p) {return pas(x-p.x,y-p.y);}
                                    	pas operator * (int a) {return pas(x*a,y*a);}
                                    	pas operator / (int a) {return pas(x/a,y/a);}
                                    //	double absv() {return sqrt(norm());}
                                    	int norm() {return x*x+y*y;}
                                    	bool operator < (const pas &p) const{
                                    		return x != p.x ? x<p.x: y<p.y;
                                    	}
                                    	bool operator == (const pas &p) const{
                                    		return x==p.x && y==p.y;
                                    	}
                                    };
int a[60];
           signed main(){
        
          int x,y,z;
           	cin>>x>>y>>z;
           	
           	if(abs(x-y)>abs(x-z)) cout<<"B"<<endl;
           	else cout<<"A"<<endl;
           	
           	return 0;
           	
           	
           }
             

Measured memory_bytes: 256
N = int(input())
P = list(map(float, input().split()))

# 試行 x 表の回数
dp = [[0 for j in range(N + 1) ] for i in range(N + 1)]

# 0回目の試行は1
dp[0][0] = 1


for t_i in range(N):
    for o_i in range(N + 1):
        if dp[o_i][t_i] == 0:
            continue

        # 裏
        dp[o_i][t_i + 1] += dp[o_i][t_i] * (1-P[t_i])
        # 表
        dp[o_i + 1][t_i + 1] += dp[o_i][t_i] * P[t_i]


mid = N // 2 + 1
ans = 0
for o_i in range(mid, N+1):
    ans += dp[o_i][N]

print(ans)




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

const int N = (int) 1e5;
vector<int> whoSpeak[N];
int lab[N];

int get(int u) {
    return lab[u] < 0 ? u : lab[u] = get(lab[u]);
}

void join(int u, int v) {
    u = get(u); v = get(v);
    if (u == v) return;
    if (lab[u] < lab[v]) swap(u, v);
    lab[v] += lab[u];
    lab[u] = v;
}

int main() {
    ios::sync_with_stdio(false);
    int n, m; cin >> n >> m;
    for (int i = 0; i < n; ++i) {
        int k; cin >> k;
        for (int j = 0; j < k; ++j) {
            int l; cin >> l; --l;
            whoSpeak[l].push_back(i);
        }
    }
    for (int i = 0; i < n; ++i) lab[i] = -1;
    for (int l = 0; l < m; ++l) {
        for (int i = 1; i < (int) whoSpeak[l].size(); ++i) {
            join(whoSpeak[l][0], whoSpeak[l][i]);
        }
    }
    for (int i = 0; i < n; ++i) {
        if (get(i) != get(0)) {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;
}


Measured memory_bytes: 4608
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

public class MainApp
{
    static public void Main(string[] args)
    {
        string read = Console.ReadLine();
        int N = int.Parse(read);
        long[] a = new long[N + 2];
        string[] split = Console.ReadLine().Split(' ');
        long arai = 0;
        for (int i = 1; i <= N; i++)
        {
            a[i] = long.Parse(split[i-1]);
            arai += a[i];
        }
        long sunuke = a[1];
        arai -= a[1];
        long min = Math.Abs(sunuke - arai) ;
        for (int i = 2; i <= N - 1; i++)
        {
            sunuke += a[i];
            arai -= a[i];
            long ABS = Math.Abs(sunuke - arai);
            if (ABS < min) min = ABS;
            if (min == 0) break;
        }
        Console.WriteLine(min);
        

    }

}

Measured memory_bytes: 32220
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		List<Integer> calculator = new ArrayList<>();

		while (true) {
			String input = s.nextLine();
			String[] result = input.split(" ");
			int a = Integer.parseInt(result[0]);
			String op = result[1];
			int b = Integer.parseInt(result[2]);
			if (op.equals("?")) {
				break;
			}
			if (a >= 0 && a <= 20000 && b >= 0 && b <= 20000) {
				if (op.equals("+")) {
					calculator.add(a + b);
				} else if (op.equals("-")) {
					calculator.add(a - b);
				} else if (op.equals("*")) {
					calculator.add(a * b);
				} else if (op.equals("/")) {
					if (b != 0) {
						calculator.add(a / b);
					}
				}

			}

		}
		for (int i = 0; i < calculator.size(); i++) {
			System.out.println(calculator.get(i));
		}

	}
}

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

#define ll long long

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

  int a, b, c, k;
  cin >> a >> b >> c >> k;

  while (a >= b && k > 0){
    b *= 2;
    k -= 1;
  }
  while (b >= c && k > 0){
    c *= 2;
    k -= 1;
  }

  cout << ((b > a && c > b) ? "Yes" : "No") << endl;
  
  return 0;
}


Measured memory_bytes: 3652
const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const Arr = (input.trim()).split("\n");
const N1 = Number(Arr[0]);
const arr1 = Arr[1].split(" ").map(Number);
const arr2 = Arr[3].split(" ").map(Number);
console.log(arr2.map(key => {   
  let mid;
  let left = 0;
  let right = N1;
  if (key < arr1[0] || arr1[N1-1] < key) return 0;
  while (left < right) {
    mid = Math.floor((left + right) / 2);
    if (key < arr1[mid]) right = mid;
    else if (key > arr1[mid]) left = mid + 1;
    else return 1;
  }
  return 0;
}).reduce((a, b) => a + b, 0));



Measured memory_bytes: 34936
#include <bits/stdc++.h>
using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
//const int mod=998244353;
using P = pair<int,int>;
using Pl= pair<ll,ll>;
using ld=long double;
using V=vector<int>;
using Vl=vector<ll>;
using VV=vector<vector<int>>;
using VVl=vector<vector<ll>>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll x;cin >>x;
    ll ans=0;
    ans+=(x/11)*2;
    x%=11;
    if(x>=7)ans+=2;
    else if(x)ans++;
    cout <<ans<<"\n";
}

Measured memory_bytes: 3644
//#pragma GCC optimize "trapv"
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define S 1000001
#define M 1000000007
#define nl cout<<"\n";
#define er  cout<<"\n***********\n";
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define test lli t;  cin>>t; while(t--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define Y cout<<"Yes\n";
#define N cout<<"No\n";
#define print(x)                 cout<<#x<<": "<<x<<endl;
#define print2(x, y)             cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define print3(x, y, z)          cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define print4(a, b, c, d)       cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define print5(a, b, c, d, e)    cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl;
#define print6(a, b, c, d, e, f) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl;

int main()
{
    fast
    lli x,y,ans=-1;
    cin>>x>>y;
    for(lli i=0;i<=x;i++)
    {
            lli j=x-i;
            if((2*i+4*j)==y)
            {
                ans=i;
                break;
            }
    }
    if(ans==-1)
    {
        N
    }
    else
    {
        Y        
    }
}
//a+b=a⊕b+2∗(a&b)
//__builtin_popcount(number)
//cout<<fixed<<setprecision(8)<<output<<"\n";




Measured memory_bytes: 3596
# C
from collections import deque

H, W = map(int, input().split())

S_list = [list(input()) for _ in range(H)]
bw = [0]*(H*W)
visited = [0]*(H*W)

G = dict()

# edge .# or #.
vid = 0
for i in range(H):
    for j in range(W):
        G[vid] = dict()
        if i > 0:
            if S_list[i][j] != S_list[i-1][j]:
                G[vid][vid-W] = 1
        if i < H-1:
            if S_list[i][j] != S_list[i+1][j]:
                G[vid][vid+W] = 1
        if j > 0:
            if S_list[i][j] != S_list[i][j-1]:
                G[vid][vid-1] = 1
        if j < W-1:
            if S_list[i][j] != S_list[i][j+1]:
                G[vid][vid+1] = 1
        if S_list[i][j] == "#":
            bw[vid] = 1
        vid += 1

# connected components
res = 0



for st in range(H*W):
    
    if visited[st] == 1:
        continue
    
    queue = deque()
    queue.append(st)
    visited[st] = 1
    res_temp = 0
    res_temp_black = 0

    while len(queue) > 0:
        s = queue.popleft()
        res_temp += 1
        if bw[s] == 1:
            res_temp_black += 1
        for t in G[s].keys():
            if visited[t] == 0:
                visited[t] = 1
                queue.append(t)
    res += res_temp_black*(res_temp-res_temp_black)

print(res)

Measured memory_bytes: 86368
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const double PI=acos(-1);

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

    int a[4];
    rep(i,4) a[i] = n[i] - '0';

    bool ans = false;

    if (a[0] == a[1] && a[1] == a[2]) ans = true;
    if (a[1] == a[2] && a[2] == a[3]) ans = true;

    if(ans) cout << "Yes" << endl;
    if(!ans) cout << "No" << endl;

    return 0;
    
}

Measured memory_bytes: 256
#ifdef ONLINE_JUDGE
  #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#endif

#include "bits/stdc++.h"
using namespace std;
typedef unsigned long long ll;
typedef unsigned short int st;

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs\n", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))

int main() {
  #ifndef ONLINE_JUDGE
    ifstream cin("in");
  #endif
  ios_base::sync_with_stdio(0); cin.tie(0); // harris leung ioi gold calling it 18.09

  int n, k; cin >> n >> k;
  vector<int> v(n);
  for (int i = 0; i < n; i ++) cin >> v[i];
  vector<int> dp(n, 2147483647);
  dp[0] = 0;
  for (int i = 1; i < n; i ++) {
    for (int j = i - 1; j >= i - k && j >= 0; j --) {
      dp[i] = min(dp[i], dp[j] + abs(v[i] - v[j]));
    }
  }
  cout << dp[n - 1] << endl;
  return 0;
}

Measured memory_bytes: 3968
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define ll long long
using namespace std;

int main() {
  string s, t, r;
  cin >> s >> t >> r;
  char ss = s[0] - 0x20, tt = t[0] - 0x20, rr = r[0] - 0x20;
  cout << ss << tt << rr << "\n";
}

Measured memory_bytes: 3628
N = int(input())
N2 = 2**N
S = list(map(int, input().split()))
S.sort(reverse=True)

slimes = [S[0]]
INF = S[0] + 1
S[0] = INF
num = 1
min_idx = 1
for i in range(N):
  slimes.sort()
  n = num
  idx = min_idx
  is_continuous = True
  while n and idx<=N2-1:
    if S[idx] < slimes[n-1]:
      slimes.append(S[idx])
      S[idx] = INF
      idx += 1
      n -= 1
      min_idx += is_continuous
    else:
      if S[idx] < INF:
        is_continuous = False
      idx += 1
      min_idx += is_continuous
  
  if n:
    print('No')
    quit()
  
  num *= 2

print('Yes')

Measured memory_bytes: 34676
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

int main() {
	char s[101] = "";
	int len = 0;

	scanf("%s", s);

	for (int i = 0; s[i] != NULL; i++) {
		len++;
	}

	printf("%c%d%c\n", s[0], len - 2, s[len - 1]);

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <fstream>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define ll long long

int main() {
	//入力
	int d, t, s;
	cin >> d >> t >> s;

	//処理
	double l = (double)d / s;
	string ans;
	if (l <= t)
		ans = "Yes";
	else
		ans = "No";

	//出力
	cout << ans << endl;
}

Measured memory_bytes: 3620
#include<iostream>
#include<cstdio>
#include<ctype.h>
using namespace std;
inline int read(){
	int x=0,f=0;char ch=getchar();
	while(!isdigit(ch))f|=ch=='-',ch=getchar();
	while(isdigit(ch))x=x*10+(ch^48),ch=getchar();
	return f?-x:x;
}
int main(){
	int k=read(),s=read(),ans=0;
    for(int x=0;x<=k;x++){
        for(int y=0;y<=k;y++){
			int z=s-x-y;
            if(z>=0 && z<=k)ans++;
        }
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pb                push_back
#define int               long long
#define M                 1000000007
#define MM                998244353
#define fr                first
#define sc                second
#define vc                vector
#define pii               pair<int,int>
#define msi               map<string,int>
#define mii               map<int,int>
#define psi               pair<string,int>
#define pis               pair<int,string>
#define piii              pair<int,pii>

	signed main() {
	
		   int t=1;
		  //cin>>t;
		   while(t--)
		   {
		   		
		   	int n,k,w,mx=0,sum=0,xx=0;
		             string s;

		        cin>>n;
		        float i=3.14159;
		        float aa=2*i*n;
		        cout<<aa<<endl;
	
}
 
	} 

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

#define int         long long
#define uint        unsigned int
#define ld          long double
#define showoff     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb          push_back
#define pf          push_front
#define pii         pair<int,int>
#define FOR(i,a,b)  for(int i=a;i<b;++i)
#define RFOR(i,a,b) for(int i=a;i>b;--i)
#define f           first
#define se          second
#define maxn        200005
#define all(v)      v.begin(),v.end()
#define sz(x)       (int)x.size()
#define mod         1000000007
#define pqueue      priority_queue<int>
#define pdqueue     priority_queue< pii,vector<pii> ,greater< pii >>

using namespace std;


mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/*int power(int a,int n)
{
    if(n == 1)return a%mod;
    if(n == 0)return 1;
    if(n&1)return ((a%mod)*(power((a*a)%mod,n/2))%mod)%mod;
    return power((a*a)%mod,n/2)%mod;
}*/
//const int md = 998244353;



signed main()
{
    showoff;
    int n,fo = 0;
    cin >> n;
    FOR(i,1,n+1){
        int x;
        cin >> x;
        if(x&1)fo = 1;
    }
    if(fo)cout << "first";
    else cout << "second";
    return 0;
}
//*->for large size of matrix +around 1e7 memory take int not long long ......

Measured memory_bytes: 256
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)
#pragma GCC optimize("unroll-loops")
// -------------------</optimizations>--------------------
#include <iostream>
#include <bitset>
#include <algorithm>        // sort()
#include <vector>           // for vectors
#include <map>              // for ordered map
#include <unordered_map>
#include <list>             // for list
#include <iomanip>          // for setprecision()
#include <cmath>            // for pow(), sqrt(), log(), log10(), ....
#include <cstring>          // for memset()
#include <unordered_set>    // for unordered_set
#include <climits>          // for INT_MAX & INT_MIN
#include <set>              // for ordered set

#define C ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
typedef long long ll;
#define INF INT_MAX
#define NINF INT_MIN
#define MOD 1000000007
const double pi=acos(-1); // value of pi


bool isVowel(char ch) {
    if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u') {
        return 1;
    }
    return 0;
}

bool compare(pair<ll, ll> a, pair<ll, ll> b) {
    return a.second<b.second;
}


bool isPrime(ll n) {
    for(ll i=3; i*i<=n; i+=2) {
        if(n%i==0) {
            return false;
        }
    }
    return true;
}

ll binary_exp(ll x, ll n, ll mod)
{
    if (n == 0) {
        return 1;
    } else if (n == 1) {
        return x % mod;
    } else {
        ll temp = binary_exp(x, n / 2, mod);
        temp = (temp * temp) % mod;

        if (n % 2 == 0) {
            return temp;
        } else {
            return ((x % mod) * temp) % mod;
        }
    }
}

map<ll, list<ll>> m;
// map<ll, ll> m;

int main() {
    C
//     freopen("input.txt","r",stdin);
// 	freopen("output.txt","w",stdout);
    int t=1;
    // cin >> t;
    while(t--) {
        ll n, ans=0;
        cin >> n;
        ll arr[n];
        for(ll i=0; i<n; i++) {
            cin >> arr[i];
        }
        sort(arr, arr+n, greater<ll>());
        ans+=arr[0];
        ll x=1, y=1;
        while(x<n-1) {
            ans+=arr[y];
            x++;
            if(x<n-1) {
                ans+=arr[y];
                x++;
            }
            else {
                break;
            }
            y++;
        }
        cout << ans << endl;
    }
}


Measured memory_bytes: 4744
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
using namespace std;

int main(){
  int a,b;
  cin>>a>>b;
  long long int W[a+1],V[a+1],DP[a+1][b+1];
  //DP[i][j] i番目までの品物を、重さがj以下になるように選んだ時の価値の最大値
  
  for(int i=0; i<=a; ++i){
    if(i>0) cin>>W[i]>>V[i];
    for(int j=0; j<=b; ++j){
      DP[i][j]=0;
    }
  }
  
  for(int i=1; i<=a; ++i){
    for(int j=0; j<=b; ++j){
      if(j>=W[i]) DP[i][j]=max(DP[i-1][j],DP[i-1][j-W[i]]+V[i]);
      else DP[i][j]=DP[i-1][j];
    }
  }
  
  cout<<DP[a][b]<<endl;
}


Measured memory_bytes: 79104
def solve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    s = sum(A)
    b = s / (4 * M)
    
    c = 0
    for a in A:
        if a >= b:
            c+=1

    return 'Yes' if c >= M else 'No'

print(solve())

Measured memory_bytes: 3060
import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;

	void doIt() {
		int s = sc.nextInt();
		int fir = s / 100;
		int sec = s % 100;
		if(fir < 13 && fir > 0) {
			if(sec < 13 && sec > 0) {
				System.out.println("AMBIGUOUS");
			}
			else System.out.println("MMYY");
		}
		else {
			if(sec < 13 && sec > 0) {
				System.out.println("YYMM");
			}
			else System.out.println("NA");
		}
	}
	

	public static void main(String[] args) {
		new Main().doIt();
	}
}


Measured memory_bytes: 22356
#include<iostream>

using namespace std;

int main()
{
	int ank[100];
	int ans[100];
	int n,m;
	int i,j;
	
	for(;;)
	{
		cin >> n >> m ;
		if(n==0 && m==0)
			break;
		
		for(i=0;i<100;i++)
		{
			ank[i]=0;
			ans[i]=i+1;
		}
		for(i=0;i<n;i++)
		{
			for(j=0;j<m;j++)
			{
				int a;
				cin >> a ;
				ank[j]+=a;
			}
		}
		
		for(i=0;i<m;i++)
		{
			for(j=i;j<m;j++)
			{
				if(ank[i]<ank[j])
				{
					int b;
					b=ank[i];
					ank[i]=ank[j];
					ank[j]=b;
					b=ans[i];
					ans[i]=ans[j];
					ans[j]=b;
				}
			}
		}
		for(i=0;i<m;i++)
		{
			for(j=i;j<m;j++)
			{
				if(ank[i]==ank[j] && ans[i]>ans[j])
				{
					int b;
					b=ans[i];
					ans[i]=ans[j];
					ans[j]=b;
				}
			}
		}
		
		for(i=0;i<m;i++)
		{
			if(i!=m-1)
				cout << ans[i] << " " ;
			else
				cout << ans[i] << endl;
		}
	}
}

Measured memory_bytes: 864
N =int(input())
ans = 0
if N > 81:
    print("No")
elif N < 10:
    print("Yes")
else:
    for i in range(2,10):
        
        if N % i == 0:
            M = N/i
            if M < 10:
                ans += 1
    if ans > 0:
        print("Yes")
    else:
        print("No")
        

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n-1; i >= 0; i--)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
const int mod = 1e9+7;
const int INF = 1e9;
const int MAX = 1e6;

struct cusum {
    int n;
    vector<long long> s;
    cusum(vector<int> &a) {
        n = a.size();
        s.resize(n+1);
        s[0] = 0;
        for (int i = 1; i <= n; i++) {
            s[i] = s[i-1] + a[i-1];
        }
    }
    long long sum(int a, int b) { // 閉区間[a,b]の和(0-indexed)
        return s[b+1] - s[a];
    }
};
struct BIT {
    int MAX;
    vector<int> bit;
    BIT(int n) {
        MAX = n;
        bit.resize(MAX+1, 0);
    }
    void add(int i, int x) { // i番目(1-indexed)に値xを追加
        while (i <= MAX) {
            bit[i] += x;
            i += i & -i;
        }
    }
    long long sum(int i) { // 閉区間[1,i]の和
        long long s = 0;
        while (i > 0) {
            s += bit[i];
            i -= i & -i;
        }
        return s;
    }
    long long rsq(int a, int b) { // 閉区間[a,b]の和
        return sum(b) - sum(a-1);
    }
};

int main() {
    int n;
    cin >> n;
    vi a(n);
    rep(i, n) {
        cin >> a[i];
    }
    cusum s(a);
    ll ans;
    rep(i, n - 1) {
        ll x = s.sum(0, i); 
        ll y = s.sum(i + 1, n - 1);
        if (i == 0) ans = abs(x - y);
        else ans = min(ans, abs(x - y));
    }
    cout << ans << endl;
}

Measured memory_bytes: 5600
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <cmath>

using namespace std;

int main()
{
    int a, b, c;
    cin >> a >> b >> c;

    if (max(a, b) < c && min(b, c) > a)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}


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

int n;

static int sdig(int x) {
	int s = 0;
	while (x) {
		s+= x % 10;
		x/= 10; }
	return s; }


int main() {
#ifdef HOME
	freopen("agc25a.in", "r", stdin);
	freopen("agc25a.out", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	int ant = 1e9;

	cin >> n;
	for (int i = 1; i < n; ++i)
		ant = min(ant, sdig(i) + sdig(n - i));

	cout << ant << endl;

	return 0; }



Measured memory_bytes: 256
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    numbers=[]
    a,b = map(int,input().split())
    
    tmp1=int(a/0.08)
    tmp2=int(b/0.10)

    ans=[]

    for i in range(min(tmp1,tmp2),max(tmp1,tmp2)+2):
        if int(i*0.08) == a and int(i*0.10) == b:
            ans.append(i)

    if len(ans)>0:
        print(min(ans))
    else:
        print("-1")


if __name__=="__main__":
    main()

Measured memory_bytes: 9108
#include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <functional>
#include <cstring>
#include <regex>
#include <random>
#include <cassert>
#include <stack>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, s, n) for (int i = (s); i < (int)(n); i++)
#define revrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define revrepr(i, s, n) for (int i = (n) - 1; i >= s; i--)
#define debug(x) cerr << #x << ": " << x << "\n"
#define popcnt(x) __builtin_popcount(x)

const double PI = acos(-1.0);

using ll = long long;
using P = pair<int, int>;

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 T>
istream& operator >>(istream &is, vector<T> &v) {
    for (int i = 0; i < (int)v.size(); i++) cin >> v.at(i);
    return is;
}

template<class T, class U>
ostream& operator <<(ostream &os, pair<T, U> p) {
    cout << '(' << p.first << ", " << p.second << ')';
    return os;
}

template<class T>
void print(const vector<T> &v, const string &delimiter) { rep(i, v.size()) cout << (0 < i ? delimiter : "") << v.at(i); cout << endl; }

template<class T>
void print(const vector<vector<T>> &vv, const string &delimiter) { for (const auto &v: vv) print(v, delimiter); }


int main() {
    int n, m, x;
    cin >> n >> m >> x;
    vector<int> c(n);
    vector<vector<int>> a(n, vector<int>(m));
    rep(i, n) {
        cin >> c[i] >> a[i];
    }

    int INF = 1000000000;
    int ans = INF;
    rep(bit, 1 << n) {
        vector<int> rikaido(m);
        int cost = 0;
        rep(i, n) if (bit >> i & 1) {
            rep(j, m) rikaido[j] += a[i][j];
            cost += c[i];
        }
        sort(rikaido.begin(), rikaido.end());
        if (x <= rikaido[0]) chmin(ans, cost);
    }
    if (ans != INF) cout << ans << endl;
    else cout << -1 << endl;
}

Measured memory_bytes: 3632
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
using ll = long long;
using namespace std;
//LLONG_MAX = 90^18
#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define LOWER_BOUND(v,a) (lower_bound((v).begin(), (v).end(), (a)))
#define UPPER_BOUND(v,a) (upper_bound((v).begin(), (v).end(), (a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
void YesNo(bool b) { cout << (b ? "Yes" : "No"); }
void Yes() { cout << "Yes"; }
void No() { cout << "No"; }
//max_element




signed main()
{
	int A, B, H, M;
	cin >> A >> B >> H >> M;

	double h = (H + (M / 60.0)) / 12.0;
	double r1 = h * 2 * M_PI;
	double x1 =  -A * sin(r1);
	double y1 = A * cos(r1);

	double r2 = (M / 60.0) * 2 * M_PI;
	double x2 = -B * sin(r2);
	double y2 = B * cos(r2);

	double dx = x1 - x2;
	double dy = y1 - y2;
	double len = sqrt(dx * dx + dy * dy);

	cout << fixed << setprecision(10) << len << endl;
}




Measured memory_bytes: 4052
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  ll a, b, c;
  cin >> a >> b >> c;
  if (0 <= (c - a - b) && (4 * a * b) < (c - a - b) * (c - a - b)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

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

using namespace std;

int main(int argc, char const *argv[]) {
	int a,b;
	std::cin >> a >> b;
	if (a+b == 15) {
		std::cout << "+" << '\n';
	}
	else if (a*b == 15) {
		std::cout << "*" << '\n';
	}
	else {
		std::cout << "x" << '\n';
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double db;
#define fi first
#define se second
#define pi pair<ll,ll>
#define pii pair<ll,pi>
#define pb push_back
#define mk make_pair
int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin >> n;
	vector<vector<int>>v(3, vector<int>(n + 1));
	vector<vector<int>>dp(3, vector<int>(n + 1, 0));
	for (int i = 0; i < 2; i++) {
		for (int j = 0; j < n; j++) {
			cin >> v[i][j];
		}
	}
	dp[0][0] = v[0][0];
	dp[1][0] = v[1][0] + dp[0][0];
	for (int i = 1; i < n; i++) {
		dp[0][i] = dp[0][i - 1] + v[0][i];
	}
	for (int i = 1; i < n; i++) {
		dp[1][i] = max(dp[1][i - 1], dp[0][i]) + v[1][i];
	}
	cout << dp[1][n - 1] << endl;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repl(i,n) for(int64_t i=0;i<(int64_t)(n);i++)
#define ll int64_t
#define all(v) (v).begin(),(v).end()
#define P pair<int,int>
using namespace std;

int main() {
  ll l,r;
  cin >> l >> r;
  r = min (r,l+4038);
  int ans=2018;
  for(ll i=l;i<=r;i++) {
    for (ll j=i+1;j<=r;j++) {
      int x = i*j%2019;
      ans = min(ans,x);
    }
  }
  cout << ans << endl;
  return 0; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
/*
||||||||||||||||||||||||||||||||||||||||||||||||
   |      |||         |      ||||    ||||  |   |
  | |     |   |      | |     |   |  |      |   |
 |   |    |    |    |   |    |   |  |      |   |
|||||||   |    |   |||||||   |||     |||   |||||
|     |   |   |    |     |   | |        |  |   |
|     |   |||      |     |   |  ||  ||||   |   |
||||||||||||||||||||||||||||||||||||||||||||||||

*/
using namespace std;
#define ff first
#define ss second
#define mp make_pair
#define all(v) v.begin(),v.end()
#define int long long
#define ll long long
#define M 1000007

#define mii  map<ll int,ll int>
#define msi  map<string,ll int>
#define mis  map<ll int, string>
#define rep(a,b)    for(ll i=a;i<b;i++)
#define rep0(n)    for(ll i=0;i<n;i++)
#define repi(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
#define vi vector<ll>
#define mp make_pair
#define vs vector<string>
#define ppb pop_back
#define endl '\n'
#define asdf ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define r0 return 0;
#define FORD(i, a, b) for (int i = (int) (a); i >= (int) (b); --i)
#define FORE(it, c) for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define inputoutput freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define Set(a, s) 4(a, s, sizeof (a))
#define FOR repi
int n;
signed main()
{
 int t=1;
 //cin>>t;
   //cin.ignore();
 while(t--)
 {
     int n,k;
     cin>>n>>k;
        vi a(n);
        rep0(n)
        cin>>a[i];
        int p=0;
       vi  ans(n+101,1e18);
        ans[0]=0;
        //rep0(k) cout<<ans[i]<<" ";
        rep(1,n)
        {    int aaa=1e16,j=1;
            while(j<=k&&i-j>=0)
            {
                if(abs(a[i]-a[i-j])+ans[i-j]<aaa)
                    aaa=abs(a[i]-a[i-j])+ans[i-j];
                   // if(i>=k+1) cout<<a[i-j]<<" ";
                        j++;
            }//cout<<endl;
            ans[i]=aaa;

        }
        cout<<ans[n-1];

 }
}


Measured memory_bytes: 1792
#include <stdio.h>

int main(){

  long long int a,b,x,y,tmp,gcd,lcm;

  while(scanf("%lld %lld",&a,&b)!=EOF){
    x=a;
    y=b;
    while(y!=0){
      tmp=y;
      y=x%y;
      x=tmp;
    }
    gcd=x;
    lcm=(a*b)/gcd;
    printf("%lld %lld\n",gcd,lcm);
  }
  return 0;
}


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

int main()
{
	int n, x;
	int l[101];
	cin >> n >> x;
	for (int i = 0; i < n; i++)
	{
		cin >> l[i];
	}
	int di = 0;
	int count = 0;
	for (int i = 0; i<n; i++)
	{
		di = di + l[i];
		
		if (di <= x)count++;
		else
		{
			cout << count+1 << endl;
			return 0;
		}
		
	}
	cout << count + 1;
}

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

using namespace std;
typedef vector<int> V;

int main() {
	int n, i, s;
	cin >> n;
	n <<= 1;
	V v(n);
	for (i = 0; i < n; i++) {
		cin >> v[i];
	}
	sort(v.begin(), v.end());
	for (i = 0, s = 0; i < n; i++) {
		s += min(v[i++], v[i]);
	}
	cout << s << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007
 
ll n;
vector<pair<ll,ll>>ch[100010];
ll ans[100010],cnt;

void dep(ll now,ll c){
	ll nowc=1;
//	if(now!=0&&ch[now].size()==1){
//		return ;
//	}
	for(ll i=0;i<ch[now].size();i++){
		if(nowc==c){
			nowc++;
		}
		ll nex=ch[now][i].first;
		ll nexans=ch[now][i].second;
		if(ans[nexans]!=0){
			continue;
		}
		ans[nexans]=nowc;
		cnt=max(cnt,nowc);
		dep(nex,nowc);
		nowc++;
	}
}
int main() {
	cin>>n;
	for(ll i=0;i<n-1;i++){
		ll x,y;
		cin>>x>>y;
		x--;y--;
		ch[x].push_back(make_pair(y,i));
		ch[y].push_back(make_pair(x,i));
	}
	dep(0,0);
	cout <<cnt<<endl;
	for(ll i=0;i<n-1;i++){
		cout <<ans[i]<<endl;
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 12076
import Foundation

let input = readLine()!.components(separatedBy: " ").map{ Int($0)!}
let N = input[0]
let blue = input[1]
let red = input[2]

let pareNum = N / (red + blue)
let remain = N % (red + blue)
var blueBall = 0

if remain > blue {
    blueBall += blue
}else {
    blueBall += remain
}
blueBall += pareNum * blue

print(blueBall)

Measured memory_bytes: 14172
package main

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

var sc = bufio.NewScanner((os.Stdin))

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	l := nextLine()
	i, e := strconv.Atoi(l)
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	N := nextInt()

	fmt.Printf("%d\n", ABC139D(N))
}

// ABC139D ...
func ABC139D(N int) (res int) {

	for i := 1; i < N; i++ {
		res += i
	}

	return res
}


Measured memory_bytes: 1800
import math

a, b ,x = list(map(int, input().split()))

if a*a*b == x:
    print(0)
    exit()

if x >= a*a*b/2:
    tan_theta = a**2 / (2*(a*b - x/a))
    theta = math.atan(tan_theta)
    print(90 - math.degrees(theta))
else:
    tan_theta = 2*x / (a*(b**2))
    theta = math.atan(tan_theta)
    print(90 - math.degrees(theta))


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define int long long
  #define endl "\n"
  #define all(v) v.begin(),v.end()
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<< ": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  const int N = 200005;

  int ans;


int32_t main()
{


    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    IOS



    int n,x,t;
    cin >> n >> x >> t;

    cout << t*(n/x + bool(n%x));





    return 0;
}


Measured memory_bytes: 3648
#include "bits/stdc++.h"
using namespace std;
vector<int> v[200000];
int d[2][100000];
int head[2];
int ans[200000];
int main() {
	int h, w, n;
	cin >> h >> w >> n;
	for (int i = 0; i < n; i++) {
		int a, b;
		cin >> a >> b;
		v[a - 1].push_back(b - 1);
	}
	int idx = 0;
	for (int i = 0; i < w; i += 2) {
		d[0][i / 2] = i;
		d[1][i / 2] = i + 1;
	}
	w /= 2;
	for (int i = 0; i < h; i++) {
			if (i % 2) {
				swap(d[idx][head[idx]], d[idx ^ 1][(head[idx ^ 1] + (w - 1)) % w]);
				(head[idx] += 1) %= w;
				(head[idx ^ 1] += w - 1) %= w;
			}
			idx ^= 1;
			for (int j = 0; j < v[i].size(); j++) {
				if (v[i][j] % 2 == 0) {
					v[i][j] /= 2;
					swap(d[idx][(head[idx] + v[i][j]) % w], d[idx ^ 1][(head[idx ^ 1] + v[i][j]) % w]);
				}
				else {
					v[i][j] /= 2;
					swap(d[idx][(head[idx] + v[i][j] + 1) % w], d[idx ^ 1][(head[idx ^ 1] + v[i][j]) % w]);
				}
			}
	}
	for (int i = 0; i < w; i++) {
		ans[d[idx][(head[idx] + i) % w]] = i * 2;
		ans[d[idx ^ 1][(head[idx ^ 1] + i) % w]] = i * 2 + 1;
	}
	for (int i = 0; i < 2 * w; i++) {
		cout << ans[i] + 1 << endl;
	}
}


Measured memory_bytes: 13332
#include <bits/stdc++.h>
#include <atcoder/dsu>
using namespace std;
using namespace atcoder;
using ll = long long;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N, Q;
    cin >> N >> Q;

    dsu d(N);
    for(int i=0; i<Q; i++)
    {
        int t, u, v;
        cin >> t >> u >> v;
        if(t == 0)
        {
            d.merge(u, v);
        }
        else
        {
            if(d.same(u, v)) cout << "1\n";
            else cout << "0\n";
        }
    }

    return 0;
}


Measured memory_bytes: 3852
#include <iostream>
#include <cmath>
#include <vector>

using namespace std;

int main(){
  int n, su, mi=10000000;
  vector<int> x;

  cin>> n;
  
  x.resize(n);
  for(int i=0;i<n;i++) cin>> x[i];

  for(int i=0;i<=100;i++){
    su=0;
    for(int j=0;j<n;j++) su+=(i-x[j])*(i-x[j]);
    mi=min(mi, su);
  }

  cout<< mi <<endl;
    
  return 0;
}


Measured memory_bytes: 256
/*Hey, What's up?*/

#include<bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
vector<long long>v;
int main()
{
    fastio;
    long long a=0,b=0,c,d,e,f=0,l,g,m,n,k,i,j,p,q,x,y,u,v,s,t;
    cin>>a>>b>>c>>d>>e>>f;
    s=1;t=1;
    p=f/(100*a);
    q=f/(100*b);
    for(i=0; i<=p; i++)
    {
        for(j=0; j<=q; j++)
        {
            x=i*100*a;
            y=j*100*b;
            if(x+y>f)
                break;
            for(k=0; k<f/c; k++)
            {
                for(l=0; l<f/d; l++)
                {
                    u=k*c;
                    v=l*d;
                    if(u+v+x+y>f)break;
                    else if(u+v>(x+y)/100*e)break;
                    if(s*(u+v+x+y)<=(u+v)*(s+t)){
                        s=u+v;
                        t=x+y;
                    }
                }
            }

        }
    }
    cout<<s+t<<" "<<s<<'\n';
    return 0;
}


Measured memory_bytes: 256
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    n, m, k = read_int_list()

    for i in range(m + 1):
        for j in range(n + 1):
            if k == (m - i) * j + (n - j) * i:
                print('Yes')
                return

    print('No')


main()


Measured memory_bytes: 3696
from operator import mul

[n, m] = map(int, input().split())
v = [list(map(int, input().split())) for i in range(n)]
# print(v)

pat = [[1,1,1], [1,1,-1], [1,-1,1], [1,-1,-1], [-1,1,1], [-1,1,-1], [-1,-1,1], [-1,-1,-1]]
res = []
for p in pat:
    t = [sum(map(mul, k, p)) for k in v]
    t.sort(reverse=True)
    res.append(sum(t[0:m]))

res.sort(reverse=True)
print(res[0])


Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;

int main() {
    string S, T, U;
    int A, B;
    cin >> S >> T >> A >> B >> U;
    if (S == U){
        A--;
    }
    if (T == U){
        B--;
    }



    cout << A << " " << B << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define gc getchar
#define re register
#define rep(i,u,z) for(re int i=u;i<=z;++i)
#define reb(i,u,z) for(re int i=u;i>=z;--i)
#define inf 0x7fffffff

using namespace std;
typedef long long ll;

inline int read(){
	int rt=0;
	char ch=gc();
	while(ch<'0'||ch>'9')ch=gc();
	while(ch>='0'&&ch<='9'){
		rt=(rt<<3)+(rt<<1)+(ch&15);
		ch=gc();
	}
	return rt;
}
int main(){
	string s;
	cin>>s;
	int len=s.length();
	int cur=0,ans=0;
	rep(i,0,len-1){
		if(s[i]=='A'||s[i]=='T'||s[i]=='G'||s[i]=='C')++cur,ans=max(ans,cur);
		else cur=0;
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container, core.bitop;

Tuple!(N, N)[] prime_division(N)(N n)
{
    auto nn = n;
    Tuple!(N, N)[] res;
    for (N i = 2; i^^2 <= nn; ++i) {
        if (n%i == 0) {
            N cnt;
            while (n%i == 0) {
                ++cnt;
                n /= i;
            }
            res ~= tuple(i, cnt);
        }
    }
    if (n != cast(N)1) res ~= tuple(n, cast(N)1);
    return res;
}

void main()
{
    auto N = readln.chomp.to!long;
    long[] ps;
    foreach (p; prime_division(N)) {
        ps ~= p[0];
    }

    auto r = N;
    foreach (x; 1..(1<<(ps.length))) {
        long n = 1;
        foreach (i; 0..ps.length) if (x & (1L<<i)) n *= ps[i];
        r += N/n * (-1)^^popcnt(x);
    }
    writeln(r);
}


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

const int maxn = 1e5 + 10;
int n, m;
bool vis[maxn];

deque <int> ans;
vector <int> e[maxn];

int check(int u) {
	for (int v : e[u]) {
		if (!vis[v]) {
			return v;
		}
	}
	return 0;
}

int main() {
	scanf("%d %d", &n, &m);
	for (int i = 1, u, v; i <= m; i++) {
		scanf("%d %d", &u, &v);
		e[u].push_back(v), e[v].push_back(u);
	}
	vis[1] = 1;
	ans.push_front(1);
	for (int t1, t2; ; ) {
		if (t1 = check(ans.front())) {
			vis[t1] = 1;
			ans.push_front(t1);
		}
		if (t2 = check(ans.back())) {
			vis[t2] = 1;
			ans.push_back(t2);
		}
		if (!t1 && !t2) {
			printf("%d\n", ans.size());
			for (int x : ans) {
				printf("%d ", x);
			}
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 6784
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <limits>
#include <ios>
#include <iomanip>
#include <stdio.h>
#include <iomanip>
#include <queue>
#include <set>
using namespace std;

#define rep(i,N) for(int (i)=0; (i)<(N); (i)++)
#define revrep(i,N) for(int (i)=(N)-1; (i)>=0; (i)--)
#define dump(vec) for(int i = 0; i < (vec).size(); i++){cout << vec.at(i) << ",";}cout << endl

typedef long long ll;

ll func(int n, set<int>& a);

int main(void)
{
    int N,M;
    cin >> N >> M;
    set<int> a;
    rep(i,M){
        int temp;
        cin >> temp;
        a.insert(temp);
    }


    cout << func(N, a) << endl;
    

    return 0;
}

/* n段目までたどり着くための移動方法と通り数*/
vector<ll> cache(100010,-1);
ll func(int n, set<int>& a)
{
    if (n == 0) {
        return 1;
    } else if (n < 0) {
        return 0;
    } else if (cache.at(n) != (-1)){
        return cache.at(n);
    }

    ll ret = 0;
    if (a.count(n-1) == 0) {
        ret += func(n-1,a);
    }
    if (a.count(n-2) == 0) {
        ret += func(n-2,a);
    }

    ret = ret % 1000000007;
    cache.at(n) = ret;
 
    return ret;
}


Measured memory_bytes: 5760
#include <bits/stdc++.h>
using namespace std; 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	char C; cin >> C; 
	if(C >= 'A' && C <= 'Z') cout << "A" << "\n"; 
	else cout << "a" << "\n"; 
}

Measured memory_bytes: 3644
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

void LCS(char *x, char *y){
	int m = strlen(x+1);
	int n = strlen(y+1);
	int i, j, **c;

	c = malloc(sizeof(int)*(m+1000));
	for (i = 0; i <= m; i++)
		c[i] = malloc(sizeof(int)*(n+1));
	
	for (i = 0; i <= m; i++){
		for (j = 0; j <= n; j++){
			c[i][j] = 0;
		}
	}
	
	for (i = 1; i <= m; i++){
		for (j = 1; j <= n; j++){
			if (x[i] == y[j])
				c[i][j] = c[i - 1][j - 1] + 1;
			else if (c[i - 1][j] >= c[i][j - 1])
				c[i][j] = c[i - 1][j];
			else
				c[i][j] = c[i][j - 1];
		}
	}
	
	printf("%d\n", c[i-1][j-1]);
	for (i = 0; i < m; i++)free(c[i]);
	free(c);
	
}

int main(){
	int i, n;
	char x[2014], y[2014];

	scanf("%d", &n);
	for (i = 0; i < n; i++){
		scanf("%s%s", x + 1, y + 1);
		LCS(x, y);
	}
	return 0;
}

Measured memory_bytes: 4620
#include <bits/stdc++.h>
using namespace std;
#define rep(i,end) for(ll i = 0; i < end ; i++ )
#define print(ans) cout << fixed << setprecision(15) << ans << endl;
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
ll N, ans;
string S;
bool flag = true;

int main() {
  cin >> S;
  N = S.size();
  rep(i,N){
    if (i%2 == 0){
      if (S[i] != 'L'){
        continue;
      }
      else {
        flag = false;
        break;
      }
    }
    else{
      if (S[i] != 'R'){
        continue;
      }
      else{
        flag = false;
        break;
      }
      
    }
  }
  if (flag) {
    yes;
  }
  else {
    no;
  }
}

							

Measured memory_bytes: 3624
l=[int(s) for s in input().split()]
for i in range(2):
  ls=[int(s) for s in input().split()]
  for j in ls:
    l.append(j)
n=int(input())
for i in range(n):
  num=int(input())
  if num in l:
    l[l.index(num)]=0
    
if l[0]+l[1]+l[2]==0 or l[3]+l[4]+l[5]==0 or l[6]+l[7]+l[8]==0:
  print("Yes")
elif l[0]+l[3]+l[6]==0 or l[1]+l[4]+l[7]==0 or l[2]+l[5]+l[8]==0:
  print("Yes")
elif l[0]+l[4]+l[8]==0 or l[2]+l[4]+l[6]==0:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3188