akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int k;
int s[105]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
int main(){
    scanf("%d",&k);
    printf("%d",s[k-1]);
    return 0;
}


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

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

    int n, x, y;
    vector<vector<pair<int, int>>> humans(N);
    for (int i = 0; i < N; i++) {
        cin >> n;
        for (int j = 0; j < n; j++) {
            cin >> x >> y;
            humans[i].push_back(make_pair(x, y));
        }
    }

    bool consistent;
    int honests = 0;
    for (int bit = 1; bit < (1<<N); bit++) {
        // 0: 真偽不明, 1: 正直者
        consistent = true;
        for (int h = 0; h <= N && consistent; h++) {
            if (bit & (1 << h)) {
                for (int a = 0; a < humans[h].size(); a++) {
                    if (humans[h][a].second == 1 && !(bit & 1 << (humans[h][a].first)-1)) {
                        consistent = false;
                    }
                    if (humans[h][a].second == 0 && (bit & 1 << (humans[h][a].first)-1)) {
                        consistent = false;
                    }
                }
            }
        }
        if (consistent == true) honests = max(honests, __builtin_popcount(bit));
    }
    cout << honests << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T> &p){ cout << "[" << p.first << ", " << p.second << "]"; return os; }

#define Sq(x) (x)*(x)
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Unique(a) a.erase(unique(Range(a)), a.end())
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) { for(const auto &e : xs) cout << e << " "; cout << "\n"; }
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")
#define vc vector
#define Mini(a, x) a = min(a, x)
#define Maxi(a, x) a = max(a, x)

// constexpr int MOD = 1e9+7;
#include <unordered_set>

int main(void){
    Cin(int, n);
    Cin(string, a, b, c);
    int ans = 0;
    For(i, n){
        unordered_set<char> s;
        s.insert(a[i]);
        s.insert(b[i]);
        s.insert(c[i]);
        ans += s.size()-1;
    }
    Cout(ans);
}





Measured memory_bytes: 256
n = int(input())
d = sorted(list(map(int,input().split())))
m = int(input())
t = sorted(list(map(int,input().split())))
ans = 'YES'
x = 0
for i in t:
    while  x<n and d[x]<i:
        x+=1
    if x==n or i!=d[x]:ans='NO'
    else:x+=1
print(ans)

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

int main() {
  int n;
  cin>>n;
  int count=0;
  int num;
  for(int i=1; i<=n; i++) {
    cin>>num;
    if(i%2!=0 && num%2!=0)
      count++;
  }
  cout<<count;
  return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1 << 30;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

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

    int n, K; cin >> n >> K;
    vi a(n); for(auto& e : a) cin >> e;

    int res = inf;
    rep(i, K - 1, n){
        int l = abs(min(0, a[i - K + 1]));
        int r = abs(max(0, a[i]));

        chmin(res, min(2 * l + r, 2 * r + l));
    }

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 640
//In The Name Of GOD

#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
const ll mod = 998244353;
const ll inf = 2000000000;
const ll infll = (ll)2*1000*1000*1000*1000*1000*1000;
const ll maxn = 100*1000+1;
#define pb push_back
#define pp pop_back
#define X first
#define Y second
#define IO ios_base::sync_with_stdio(false);

int main(){
  IO;
  int n,a,ans=0;
  cin>>n;
  map<int,int> mp;
  for(int i=0;i<n;i++){
    cin>>a;
    mp[a]++;
  }
  for(auto p:mp){
    if(p.Y<p.X){
      ans+=p.Y;
    }else{
      ans+=p.Y-p.X;
    }
  }
  cout<<ans;
}


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

long long int modPow(long long int a, long long int n){//繰り返し自乗法(a^n mod p)。計算量 O(logN)
    long long int p = pow(10, 9) + 7;//任意のp(素数) modのやつで使える 
    if(n == 0){
        return 1;
    }
    if(n == 1){
        return a % p;
    }
    if (n % 2 == 1){ 
        return (a * modPow(a, n - 1)) % p;
    }      
    long long t = modPow(a, n / 2);
    return (t * t) % p;
}

int main(){
    string s, t;
    cin >> s >> t;
    int count = 10000;
    int countTmp = 0;
    int size = t.size();
    string tmp;

    for(int i = 0; i <= s.size() - size; i++){
        countTmp = 0;
        tmp = s.substr(i, size);
        for(int j = 0; j < size; j++){
            if(tmp.at(j) != t.at(j)){
                countTmp++;
            }
        }
        count = min(countTmp, count);
    }

    cout << count << endl;
}

Measured memory_bytes: 3624
import sys
from collections import deque


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


N, M = LI()
friend = [set() for _ in range(N)]
ans = 0
miru = set()
if M == 0:
    print(1)
    sys.exit()
for i in range(M):
    a, b = map(int, input().split())
    friend[a-1].add(b-1)
    friend[b-1].add(a-1)
    miru.add(a-1)
    miru.add(b-1)
looked = [0]*N
d = deque()
count = 0
d.append(a-1)
miru.discard(a-1)
while d:
    x = d.pop()
    for i in friend[x]:
        if looked[i] != 0:
            continue
        count += 1
        looked[i] = 1
        d.append(i)

    if len(d) == 0:
        ans = max(count, ans)
        if len(miru) == 0:
            break
        y = miru.pop()
        d.append(y)
        looked[y] = 1
        count = 1
        miru.discard(y)

print(ans)


Measured memory_bytes: 87892
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		int[][] xl = new int[n][2];
		for(int i = 0; i < n; i++){
		    xl[i][0] = sc.nextInt();
		    xl[i][1] = sc.nextInt();
		}
		Arrays.sort(xl, (a, b) -> Integer.compare(a[0]+a[1], b[0]+b[1]));
		//System.out.println(Arrays.deepToString(xl));
		
		// 計算
		int result = n;
		int r = Integer.MIN_VALUE;
		for(int i = 0; i < n; i++){
		    int l = xl[i][0] - xl[i][1];
		    if(l < r){
		        result--;
		    }else{
		        r = xl[i][0] + xl[i][1];
		    }
		}
		
		// 出力
		System.out.println(result);
	}
}




Measured memory_bytes: 94744
m = int(input())
a = {}
for i in range(1, int(m**0.5)+1):
    if m % i == 0:
        n = m // i
        a[i] = n
ans =[]
for i,j in a.items():
    b = i + j
    ans.append(b)

print(min(ans)-2)


Measured memory_bytes: 40684
#include <iostream>
#include <math.h>
using namespace std;
typedef long long LL;
int main(int argc, char* argv[])
{
	LL a,b,c;
	cin>>a>>b>>c;
	if (a>c || b>c){
		cout<<"No"<<endl;
		return 0;
	}
	LL AB=4*a*b;
	LL CC=(c-a-b)*(c-a-b);
	if (AB<CC){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
	return 0;
}

Measured memory_bytes: 384
#include <cstdio>

int main(){
    int p[3];
    int max = 0;
    for(int i = 0; i < 3; i++){
        scanf("%d",&p[i]);
        if(max < p[i]){
            max = p[i];
        }
    }
    int ans = p[0] + p[1] + p[2] - max;
    printf("%d\n",ans);

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define index(xs, x) (int)(lower_bound(all(xs), x) - xs.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int N, C;
int D[30][30];
int num[3][30];

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N >> C;
  rep(i, C) rep(j, C) cin >> D[i][j];
  rep(i, N) rep(j, N) {
    int x;
    cin >> x;
    x--;
    num[(i+j)%3][x]++;
  }
  int m = INF;
  rep(a, C) rep(b, C) rep(c, C) if (a != b && b != c && a != c) {
    int s = 0;
    rep(i, C) s += D[i][a]*num[0][i];
    rep(i, C) s += D[i][b]*num[1][i];
    rep(i, C) s += D[i][c]*num[2][i];
    m = min(m, s);
  }
  cout << m << "\n";
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int x = 800*a;
		int y = a/15*200;
		
		System.out.println(x-y);
		
	}

}

Measured memory_bytes: 21844
#include<stdio.h>


typedef struct Score{
	int inf;
	int math;
	int sci;
	int eng;
	int sum;
}Score;

int main()
{
	Score A;
	Score B;

	scanf("%d%d%d%d", &A.inf, &A.math, &A.sci, &A.eng);
	scanf("%d%d%d%d", &B.inf, &B.math, &B.sci, &B.eng);

	A.sum = A.inf+A.sci+A.math+A.eng;
	B.sum = B.inf+B.sci+B.math+B.eng;

	if(A.sum < B.sum)
		printf("%d\n", B.sum);
	else
		printf("%d\n", A.sum);

	return 0;
}

Measured memory_bytes: 592
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#include<vector>
#include<set>
using namespace std;
typedef long long ll;
const int N = 105;
const int inf = 0x3f3f3f3f;
const int mod = 1e9+7;
const double eps = 1e-6;
struct node{
	double x,y;
}g[N];
int main()
{
	int x,cnt;
	cin>>x;
	cnt=x/500*1000;
	x%=500;
	cnt+=x/5*5;
	cout<<cnt;
	return 0;
}

Measured memory_bytes: 256
a,b,k = map(int,input().split())

def cf(x1,x2):
    cf=[]
    for i in range(1,min(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

l = cf(a,b)

l.sort(reverse=True)

print(l[k-1])


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin >> a >> b;
    double c = (a + b) / 2.0;
    if(c == int(c))
    {
        cout << int(c);
    }
    else
    {
        cout << "IMPOSSIBLE";
    }

    return 0;
}

Measured memory_bytes: 256
use std::io;

fn main() {
    let mut s = String::new();
    let mut t = String::new();
    io::stdin().read_line(&mut s).unwrap();
    io::stdin().read_line(&mut t).unwrap();

    let mut count: u8 = 0;

    if s[..1] == t[..1] {
        count += 1;
    }
    if s[1..2] == t[1..2] {
        count += 1;
    }
    if s[2..3] == t[2..3] {
        count += 1;
    }

    println!("{}", count);
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
int main()
{
	ll a,b,n,x,y,max;
	cin>>a>>b>>n;
	if(b<=(n+1))
	{
		x=(a*(b-1))/b;
	}
	else
	{
		x=(a*(n))/b;
	}
	cout<<x;
	return 0;
}

Measured memory_bytes: 3592
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <math.h>
#include <map>
#include <set>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define INF 1145141919
typedef long long int ll;
using namespace std;

int main()
{
    int n;
    cin >> n;
    string W[n];
    REP(i,n)    cin >> W[i];
    bool ans=true;
    int count2=0;

    REP(i,n-1){
        if(W[i].back()!=W[i+1][0]){
            ans = false;
        }
    }

    int count=0;

    REP(i,n){
        REP(j,n){
            if(W[i]==W[j]){
                count++;
            }
            if(W[i].back()!=W[i+1][0]){
                count2++;
            }
        }
    }

    if(count>n){
        ans = false;
    }

    if(count2>n){
        ans = false;
    }

    if(ans==false){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i,l,r) for(int i=(l);i<(r);i++)
#define LINF (ll)1e18
#define INF (int)1e9
#define range(i) i.begin(),i.end()
#define Yes(i) out(i?"Yes":"No");return 0
struct aaa{aaa(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(10);};}aaaaaaa;
inline void in() {}
template <class Head, class... Tail>
inline void in(Head&& head,Tail&&... tail){
    cin>>head;
    in(move(tail)...);
}
template <class T>
inline void out(T t) {
    cout<<t<<'\n';
}
template <class Head, class... Tail>
inline void out(Head head,Tail... tail){
    cout<<head<<' ';
    out(move(tail)...);
}

int main(){
    int a,b,c;
    in(a,b);
    out((bool)(a%b));
}








Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//using ll = long long;
#define ll long long
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 (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll tmp1,tmp2,tmp3;
const ll mod = 1e9+7;
const int INF = 1e9;
const ll INFLONG = 1e18;
void swap(ll *x,ll *y){
  ll z = *x;
  *x = *y;
  *y = z;
}
void print(vector<ll> vec){
  ll length = (ll)vec.size();
  rep(i,length){
    if(i != 0){cout << " ";}
    cout << vec[i];
  }
  cout << endl;
}

int main(){
  ll n,m;
  cin >> n >> m;
  vector<ll> vec(n);
  rep(i,n){
    cin >> vec[i];
  }
  sort(all(vec),greater<ll>());
  while(m > 0){
    tmp1 = vec[0];
    rep(i,n){
      if(vec[i] >= tmp1 / 2){
        if(m <= 0){break;}
        vec[i] /= 2;
        m--;
      }else{
        break;
      }
    }
    sort(all(vec),greater<ll>());
  }
  ll sum = 0;
  rep(i,n){
    //cout << vec[i] << " ";
    sum += vec[i];
  }
  cout << sum;
}


Measured memory_bytes: 1024
/*
srt: 2017年07月04日 15時22分28秒
鹧鸪天·晚日寒鸦一片愁 辛弃疾
晚日寒鸦一片愁。柳塘新绿却温柔。若教眼底无离恨，不信人间有白头。
肠已断，泪难收。相思重上小红楼。情知已被山遮断，频倚阑干不自由。 
end: 2017年07月04日 16時39分11秒
*/

#include<cstdio>
#include<algorithm>

typedef long long ll;
const int mod=1e9+7;
ll f[100];int n;
// 1,2,3,5,8
// x,y,x+y,x+2y,2x+3y,3x+5y,5x+8y

void forward(ll x,ll y,int i,ll&c,ll lima,ll limb)
{
	ll a,b;
	if(i<2)
	{
		if(i==0)a=x,b=y;
		else a=y,b=x+y;
		if(a>lima||b>limb)return;
	}else{
		if(lima/x<f[i-2]||lima/y<f[i-1]||x*f[i-2]>lima-y*f[i-1])return;
		if(limb/x<f[i-1]||limb/y<f[ i ]||x*f[i-1]>limb-y*f[ i ])return;
		a=x*f[i-2]+y*f[i-1];
		b=x*f[i-1]+y*f[i];
	}
	(c+=(limb-b)/a+1)%=mod;
	if(b<=lima)
		(c+=(lima-b)/a+1)%=mod;
}

void work(ll x,ll y)
{
	int i,k=std::upper_bound(f+1,f+n,x)-f-1;
	if(f[k+1]>y)k=std::upper_bound(f+1,f+n,y)-f-2;
	ll c=((y-f[k+1])/f[k]+1)%mod;
	if(f[k+1]<=x)
		(c+=(x-f[k+1])/f[k]+1)%=mod;
	for(i=1;i<k;i++)
	{
		forward(f[i],2*f[i]+f[i-1],k-i,c,x,y);
		forward(f[i],3*f[i]+f[i-1],k-i,c,x,y);
	}
	printf("%d %lld\n",k,c);
}

int main()
{
	ll x,y;int i;
	f[0]=f[1]=1;
	for(n=1;f[n]>0;n++)
		f[n+1]=f[n]+f[n-1];
	scanf("%d",&i);
	while(i--)
	{
		scanf("%lld%lld\n",&x,&y);
		if(x==1||y==1||(x==2&&y==2))
			printf("1 %lld\n",x*y%mod);
		else
			x>y&&(x^=y^=x^=y),work(x,y);
	}
}

Measured memory_bytes: 3968
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

void solve() {
    int N; cin >> N;
    set<string> se;
    REP(i, N) {
        string s; cin >> s;
        se.insert(s);
    }
    int M; cin >> M;
    bool now = false;
    REP(i, M) {
        string s; cin >> s;
        string ans = "";
        if (!FIND(se, s)) {
            ans = "Unknown ";
        } else {
            if (now) ans = "Closed by ";
            else ans = "Opened by ";
            now = !now;
        }
        cout<< ans << s << endl;
    }
}

signed main(void) {
    int n, m, p, a, b, c, x, y, z;
    string s;
    while (true) {
        solve();
        return 0;
    }
}

Measured memory_bytes: 3220
X,Y,Z,K= list(map(int,input().split()))
l_A=list(map(int,input().split()))
l_B=list(map(int,input().split()))
l_C=list(map(int,input().split()))
l_A.sort(reverse=True)
l_B.sort(reverse=True)
l_C.sort(reverse=True)
l=[]
for i in range(len(l_A)):
   for j in range(len(l_B)):
      for k in range(len(l_C)):
        if (i+1)*(j+1)*(k+1) > K:
           break
        l+=[l_A[i]+l_B[j]+l_C[k]]
ans=sorted(l,reverse=True)[:K]
print(*ans,sep="\n")

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

int main() {

    int N, N_1, N_2, N_3, N_4;

    cin >> N;

    N_1 = N % 10;
    N_2 = N / 10 % 10;
    N_3 = N / 100 % 10;
    N_4 = N / 1000 % 10; 

    if(N_1 == N_2 && N_2 == N_3 || N_2 == N_3 && N_3 == N_4)
        cout << "Yes" << endl;
    else 
        cout << "No" << endl;
}

Measured memory_bytes: 256
using System;
class Program
{
    static void Main(string[] args)
    {
        string input = Console.ReadLine();
        if (input == "Sunny")
        {
            Console.WriteLine("Cloudy");
        }
        else if (input == "Rainy")
        {
            Console.WriteLine("Sunny");
        }
        else
        {
            Console.WriteLine("Rainy");
        }
    }
}

Measured memory_bytes: 13140
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <map>
#include <numeric>
#include <type_traits>
#include <limits>
#include <random>

using namespace std;

using ll = long long;

#define rep(i,N) for(long long i = 0;i < (long long)N; ++i)

int N;
int ans;

void check(ll x) {
	if (x > N) return;

	bool flag[3] = { false, false, false };
	string str = to_string(x);
	rep(i, str.length()) {
		if (str[i] == '3') flag[0] = true;
		if (str[i] == '5') flag[1] = true;
		if (str[i] == '7') flag[2] = true;
	}
	if (flag[0] && flag[1] && flag[2]) {
		ans++;
	}
	return;
}

void dfs(ll x) {
	check(x);
	if (x <= 1000000000 && x <= N) {
		dfs(10 * x + 3);
		dfs(10 * x + 5);
		dfs(10 * x + 7);
	}
	return;
}


int main() {
	cin >> N;
	dfs(0);
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
string a, b, c;
int main() {
	while (cin >> a, a != "-") {
		cin >> b >> c;
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		char r = b.back(); b.pop_back();
		string ret;
		while (true) {
			if (c.find(r) != string::npos) {
				if (a.size() == 0) break;
				r = a.back(); a.pop_back();
			}
			else {
				ret += r;
				if (b.size() == 0) break;
				r = b.back(); b.pop_back();
			}
		}
		cout << ret << endl;
	}
	return 0;
}

Measured memory_bytes: 3140
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>  // sort, 二分探索, etc
#include <iomanip>  // setprecision (浮動小数点の出力の誤差)
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cmath>
#include <list>

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=a,i##_len=(b);i<i##_len;++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define cauto const auto&
#define UNIQUE(v) (v).erase( unique(all(v), (v).end() );
#define SZ(x) ((ll)(x).size()) // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(all(x))
#define MIN(x) *min_element(all(x))
#define INF 1000000000000
#define MOD 1000000007
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

using namespace std;
using ll = long long;
using ull = unsigned long long;

template<class T>bool chmax(T &a, const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a, const T &b){if(a>b){a=b;return true;}return false;}

const char newl = '\n';

ll qp(ll a,ull b){ll ans=1;do{if(b&1u)ans*=a;a*=a;}while(b>>=1u);return ans;}
ll qp(ll a,ull b,ll mod){ll ans=1;do{if(b&1u)ans=ans*a%mod;a=a*a%mod;}while(b>>=1u);return ans;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll comb(int n, int r) {
    vector<vector<ll> > v(n+1, vector<ll>(r+1, 0));
    for(int i=0;i<n+1;i++) {v[i][0]=1; if(i < r+1)v[i][i]=1; }
    for(int i=1;i<n+1;i++) {for(int j=1;j<min(i,r+1);j++) {v[i][j]=v[i-1][j-1]+v[i-1][j];}}
    return v[n][r];
}

// INT_MAX   = 2.1e+09 (2147483647)
// LONG_MAX  = 9.2e+18 (9223372036854775807)
// LLONG_MAX = 9.2e+18 (9223372036854775807)


int main() {
//    ll n; cin >> n;
    vector<bool> vec = {false, false, false};
    rep(i, 3) {
        char x; cin >> x;
        if (x == 'R') {
            vec[i] = true;
        }
    }

    ll cnt = 0;
    if (vec[0]) {
        if (vec[1]) {
            if (vec[2]) {
                cnt = 3;
            } else {
                cnt = 2;
            }
        } else {
            cnt = 1;
        }
    } else {
        if (vec[1]) {
            if (vec[2]) {
                cnt = 2;
            } else {
                cnt = 1;
            }
        } else {
            if (vec[2]) {
                cnt = 1;
            } else {
                cnt = 0;
            }
        }
    }

    cout << cnt << newl;

    return 0;
}


Measured memory_bytes: 3184
#include<iostream>
#include<iomanip>
#include<cassert>
#include<math.h>
#include<complex>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;

ll H,W;
string S[101];
ll d[101][101];
int main(){
    cin>>H>>W;
    for(ll i=0;i<H;i++){
        cin>>S[i];
        for(ll j=0;j<W;j++){
            d[i][j]=INF;
        }
    }
    priority_queue<pair<ll,P>,vector<pair<ll,P>>,greater<pair<ll,P>>> q;
    d[0][0]=(S[0][0]=='#');
    q.push(make_pair(d[0][0],P(0,0)));
    while(!q.empty()){
        P now=q.top().second;
        ll nh=now.first;
        ll nw=now.second;
        ll nowCost=q.top().first;
        q.pop();
        if(nowCost>d[nh][nw])continue;
        ll dh[2]={0,1};
        ll dw[2]={1,0};
        for(ll i=0;i<2;i++){
            ll h=now.first+dh[i];
            ll w=now.second+dw[i];
            if(h<0 || H<=h || w<0 || W<=w)continue;
            ll newD=d[nh][nw]+(S[nh][nw]=='.' &&  S[h][w]=='#');
            if(d[h][w]>newD){
                d[h][w]=newD;
                q.push(make_pair(d[h][w],P(h,w)));
            }
        }
    }
    cout<<d[H-1][W-1];
    return 0;
}

Measured memory_bytes: 384
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Diagnostics.Contracts;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.IO.Pipes;
using System.Linq;
using System.Net;
using System.Numerics;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var arrayX = ReadInts();
            for (int i = 0; i < arrayX.Length; i++)
            {
                if (arrayX[i] == 0)
                {
                    WriteLine(i + 1);
                }
            }
        }


        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


Measured memory_bytes: 27320
Q = int(input())
LR = [list(map(int,input().split())) for _ in [0]*Q]

N = max(r for l,r in LR)

p = []
for i in range(3,N+1,2):
    for j in p:
        if i%j==0: break
        if j*j>i:
            p.append(i)
            break
    else:
        p.append(i)
p.append(2)
p = set(p)

c = [0]*(N+1)
for i in p:
    if (i+1)//2 in p:c[i] = 1

class cumulative_sum:
    def __init__(self,A):
        N = len(A)
        self.S = [0]*(N+1)
        for i in range(N):
            self.S[i+1] = self.S[i] + A[i]
    def get(self,i,j=None):
        if j==None:j=len(self.S)-1
        if j<=i:return 0
        return self.S[j]-self.S[i]

Sc = cumulative_sum(c)

for l,r in LR:
    print(Sc.get(l,r+1))

Measured memory_bytes: 33020
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	var S string
	fmt.Scan(&S)
	t := S[0]
	ans := 1
	for i := 1; i < N; i++ {
		if t != S[i] {
			t = S[i]
			ans++
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 1280
using System;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var result = -1;
            for (int i = 1; i <= 50000; i++) if ((int)(i * 1.08) == N) result = i;
            Console.WriteLine(result != -1 ? result.ToString() : ":(");
        }
    }
}


Measured memory_bytes: 11092
#include <stdio.h>

#define PI 3.141592653589

int
main(void)
{
	double r;
	double area;
	double circ;

	scanf("%lf", &r);

	area = r * r * PI;
	circ = (r + r) * PI;

	printf("%f %f\n", area, circ);

	return 0;
}


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

int main()
{
  int n, k;
  cin >> n >> k;
  vector<int> h(n);
  for (auto&& e : h) cin >> e;
  sort(begin(h), end(h), greater<>());
  int64_t ans = 0;
  for (int i = k; i < n; i++) {
    ans += h[i];
  }
  cout << ans << endl;
}


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

const int N = (int)1e5 + 5;

int n,a[N];

vector<pair<int,int>> v;

int main(){
	cin >> n;
	for(int i = 1; i <= n; i++){
		cin >> a[i];
		v.push_back(make_pair(a[i],i));
	}
	sort(v.begin(),v.end());   
	for(int i = 0; i < (int)v.size(); i++){
		cout << v[i].second << " ";
	}
     return 0;
}

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

int N; vector<int> color; vector<vector<int>> to;
vector<pair<int,int>> vec; vector<bool> visited; int S = 0;

map<pair<int,int>,int> mp;

void dfs(int v){
  visited[v] = true;
  
  S = max(S,(int)to[v].size());
  
  int paint = 1;
  
  for(auto ne : to[v]){
    if(visited[ne]){ continue;}
    
    if(paint == color[v]){ paint++;}
    
    color[ne] = paint;
    
    mp[{v,ne}] = paint;
    
    dfs(ne); paint++;
  }
  return ;
}
    
    

int main(){
   //根つき木とすることで、単一インデックスで辺を指定する
  
  cin >> N;
  
  color = vector<int> (N,-1); // -1は未確定
  
  to.resize(N); visited = vector<bool>(N,false);
  
 
  for(int i = 0; i < N-1; i++){ 
    int a,b; cin >> a >> b; a--; b--;
    to[a].push_back(b); to[b].push_back(a);
    vec.push_back({a,b});
  }
  
  color[0] = 0;
  
  dfs(0);
  
  cout << S << endl;
  
  for(int i = 0; i < N-1; i++){
    cout << mp[vec[i]] << endl;
  }
  return 0;
}

Measured memory_bytes: 13428
ans [c,a,b] =
  let a' = read a :: Int
      b' = read b :: Int
      n  = show (a'+b')
      m  = show (200*a'+300*b')
  in
    [c, n, m]

main = do
  c <- getContents
  let i = map words $ lines c
      o = map ans i
  mapM_ (putStrLn . unwords)  o

Measured memory_bytes: 3712
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int T = sc.nextInt();
		int E = sc.nextInt();
		int[]x = new int[N+1];
		
		for(int i=1;i<=N;i++)x[i]=sc.nextInt();
		int res = -1;
		
		for(int i=1;i<=N&&res==-1;i++) {
			int k = (T-E-1)/x[i]+1;
			if(T-E<=x[i]*k && x[i]*k<=T+E)res=i;
		}
		System.out.println(res);
	}
}



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

ll getpair(ll in){
    if(in <= 0) return 0;
    else return (in * (in - 1)) / 2;
}

int main(){
    int n,m;
    cin >> n >> m;
    cout << getpair(n) + getpair(m) << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <fstream>
using namespace std;
typedef long long lint;
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(lint (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define INF (1ll<<60)
#define all(x) (x).begin(),(x).end()
const lint MOD =1000000007;
const lint MAX = 1000000;
using Graph =vector<vector<lint>>;
typedef pair<lint,lint> P;
typedef map<lint,lint> M;
 
lint fac[MAX], finv[MAX], inv[MAX];
 
void COMinit() 
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (lint i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
long long COM(lint n, lint k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
lint primary(lint num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return 0;
        }
    }
 
    return 1;
}
   long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
    lint lcm(lint a,lint b){
        return a/__gcd(a,b)*b;
    }
     lint gcd(lint a,lint b){
        return __gcd(a,b);
    } 

  
  int main(){
     lint n,q;
     string s;
     lint a[n];
     cin>>s;
     lint x=s.size();
     char d=s[x-1];
     lint g=d-'0';
     if(g==2||g==4||g==5||g==7||g==9)cout<<"hon";
     else if(g==0||g==1||g==6||g==8)cout<<"pon";
     else cout<<"bon";

  } 
      
      
    

  
          
  

Measured memory_bytes: 3724
#include<bits/stdc++.h>
#define LL long long
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define PII pair<int,int>
#define PLI pair<long long, int>
#define PLL pair<long long, long long>
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9)
#define INFLL ((LL)1e18)
#define ALL(x) (x).begin(),(x).end()
#define ctoi(x) (x - 'a') 
#define CTOI(x) (x - 'A')
#define BIT(x) (1 << (x))
#define int LL
using namespace std;

LL modinv(LL a){
    LL b = MOD, u = 1, v = 0;
    while(b){
        LL t = a / b;
        a -= t * b;swap(a, b);
        u -= t * v;swap(u, v);
    }
    u%=MOD;
    if(u < 0) u += MOD;
    return u;

}

LL exp(LL a, LL b){
    LL res = 1;
    LL sum = a;
    while(b){
        if(b&1)res = (res * sum);
        sum = (sum * sum);
        b>>=1;
    }
    return res;
}

PII operator+(const PII &a, const PII &b){
    return PII(a.first + b.first, a.second + b.second);
}

PII operator-(const PII &a, const PII &b){
    return PII(a.first - b.first, a.second - b.second);
}
bool operator==(const PII &a, const PII &b){
    return (a.first == b.first) && (a.second == b.second);
}

signed main(){
    int N, X;
    cin >> N >> X;
    int count = 1;
    int sum = 0;
    REP(i, N){
        int L;
        cin >> L;
        if(sum + L <=X){
            ++count;
            sum += L;
        }else{
            break;
        }
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#include<algorithm>//next_permutation
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define small "abcdefghijklmnopqrstuvwxyz"
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b , a % b);
}

const ll MOD = 1000000007;
const ll MAX = 2000001;

ll mod(ll a){
  return a % MOD;
}

ll lcm(ll a,ll b){
  return (a*b)/gcd(a,b);
}

ll fac[MAX], finv[MAX], inv[MAX];

void nCrprep() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll nCr(ll n, ll r){
    if (n < r) return 0;
    if (n < 0 || r < 0) return 0;
    return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD;
}

ll nCrcheep(ll n,ll r){
  if(r == 0) return 1;
  else if(r == 1) return n;
  else return nCrcheep(n-1,r-1)*n/r;
}

vector<pair<ll,ll>> prime_factorize(ll n){
  vector<pair<ll,ll>> res;
  
  for(ll i=2; i*i <= n; i++){
    if(n % i != 0) continue;
    
    ll ex = 0;
    while(n % i == 0){
      ex++;
      n /= i;
    }
    
    res.push_back({i,ex});
  }
  
  if(n != 1) res.push_back({n,1});
  
  return res;
  
}




int main(){
  ll d; cin >> d;
  
  rep(i,d){
    cout << 1 << endl;
    
  }
  
  
}

Measured memory_bytes: 3628
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val a = (1..n).map { sc.nextInt() }.sortedDescending()
    val alice = (0 until n step 2).map { a[it] }.sum()
    val bob = a.sum() - alice
    println(alice - bob)
}

Measured memory_bytes: 36040
#include <iostream>
#include <string>

using namespace std;

int main() {
  string s; cin >> s;
  int ans = 0;
  for(int i = 0; i < s.size(); i++) {
    if(s[i] == '+') ans++;
    if(s[i] == '-') ans--;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
n = int(input())
A = list(map(int, input().split()))
s = 1
B = set(A)
if 0 in B:
    print(0)
else:
    for i in A:
        s = s * i
        if s > 10 ** 18:
            print(-1)
            break
    else:
        print(s)


Measured memory_bytes: 21776
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String[] args) {
		FastScanner scan = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		long n = scan.nextLong();

		long ret = n * (n - 1) / 2;
		out.println(ret);
		out.flush();
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

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

Measured memory_bytes: 22484
s=input()
s=s.translate(str.maketrans({'C': 'A', 'G': 'A' , "T": "A"}))

l = list(s)
#print(chars)
a=len(l)
#print(a)
ans=[0]*a
j=0
for i in range(a):
  if l[i]=="A":
    ans[j]+=1
  else:
    j+=1
 
print(max(ans))

Measured memory_bytes: 3064
unittest
{
	assert( [ "4 8", "7 9 8 9" ].parse.expand.solve == 5 );
	assert( [ "3 8", "6 6 9" ].parse.expand.solve == 0 );
	assert( [ "8 5", "3 6 2 8 7 6 5 9" ].parse.expand.solve == 19 );
	assert( [ "33 3", "3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3" ].parse.expand.solve == 8589934591 );
}



import std.algorithm;
import std.conv;
import std.functional;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto na = input.front.split.to!( long[] );
	input.popFront;
	auto xs = input.front.split.to!( long[] );
	return tuple( na[ 1 ], xs );
}

auto solve( long a, long[] xs )
{
	// 平均未満、平均、平均超のグループに分割
	xs.sort();
	auto ls = xs[ 0 .. $ - xs.find!( ( x ) => a <= x ).length ];
	auto cs = xs[ ls.length .. $ - xs.find!( ( x ) => a < x ).length ];
	auto rs = xs[ ls.length + cs.length .. $ ];
	
	// aからの相対値に変換
	foreach( ref l; ls )
	{
		l -= a;
	}
	foreach( ref r; rs )
	{
		r -= a;
	}
	
	// 各グループ内の組み合わせ数を計算（aからの相対値をキーにした連想配列で集計）
	auto lks = f( ls );
	auto cks = f( cs );
	auto rks = f( rs );
	
	// aからの相対値が0（＝1枚も選ばないパターン）は除外
	lks.remove( 0 );
	cks.remove( 0 );
	rks.remove( 0 );
	
	// 平均値グループ内の組み合わせ数を合計
	auto cc = cks.values.sum;
	
	// 平均値未満グループ×平均値超グループ×平均値グループの組み合わせ数を計算
	auto ans = cc;
	foreach( i; rks.keys )
	{
		if( -i !in lks ) continue;		// 平均からの相対値が同じではないやつは組みあわせても平均値にならないので除外
		ans += lks[ -i ] * rks[ i ] * ( cc + 1 );		// 最後に1足してるのは平均値グループから1枚も選ばないパターン
	}
	return ans;
}

long[ long ] f( long[] xs )
{
	if( xs.length == 0 ) return [ 0L:1L ];
	
	long[ long ] ans;
	ans = u( ans,       0, memoize!f( xs[ 1 .. $ ] ) );		// 先頭の一枚を選ばないパターン
	ans = u( ans, xs[ 0 ], memoize!f( xs[ 1 .. $ ] ) );		// 先頭の一枚を選ぶパターン
	return ans;
}

long[ long ] u( long[ long ] xs, long b, long[ long ] ys )
{
	foreach( i, y; ys )
	{
		xs[ i + b ] += y;
	}
	return xs;
}


Measured memory_bytes: 2428
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
typedef long long LL;
using namespace std;
int main(){
	char arr[2][3];
	int i,j;
	for(i=0; i<2; ++i)
		for(j=0; j<3; ++j)
			cin>>arr[i][j];
	if(arr[0][0]==arr[1][2]&&arr[0][1]==arr[1][1]&&arr[0][2]==arr[1][0])
		cout<<"YES"<<endl;
	else cout<<"NO"<<endl;

	return 0;	
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
	int x,y,z,sum=0;
	scanf("%d %d %d",&x,&y,&z);
	for(int i = 0;i < x-y-z;i=i+y+z)
	{
		if(x-y-z-i<z)
			break;
		sum++;
	}
	printf("%d\n",sum);
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.math.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		List<Long> list = new ArrayList<>();
		List<Long> sumList = new ArrayList<>();

		long tempSum =0;
		for (int i = 0; i < n; i++) {
			long a = sc.nextLong();
			list.add(a);
			tempSum +=a;
			sumList.add(tempSum);
		}
		// System.out.println("list " + list);

		// start from minus

		long minusSum =0;
		long minusCount =0;
		for (int i = 0; i < n; i++) {
			long a = list.get(i);
			// System.out.println("a  " + a );
			minusSum += a;
			// System.out.println("minusSum " + minusSum);

			if(minusSum>=0 && i%2==0){
				long diff = calcDiff(minusSum);
				minusCount += diff;
				// minusSum -= diff;
				minusSum = -1;
				// System.out.println("diff " + diff);
				// System.out.println("minusSum " + minusSum);
			}
			if(minusSum<=0 && i%2==1){
				long diff = calcDiff(minusSum);
				minusCount += diff;
				// minusSum += diff;
				minusSum = 1;
				// System.out.println("diff " + diff);
				// System.out.println("minusSum " + minusSum);
			}
			// System.out.println();
		}

		// start from plus
		long plusSum =0;
		long plusCount =0;
		for (int i = 0; i < n; i++) {
			long a = list.get(i);
			plusSum += a;
			// System.out.println("plusSum " + plusSum);

			if(plusSum<=0 && i%2==0){
				long diff = calcDiff(plusSum);
				plusCount += diff;
				// plusSum += diff;
				plusSum = 1;
				// System.out.println("diff " + diff);
				// System.out.println("plusSum " + plusSum);
			}
			if(plusSum>=0 && i%2==1){
				long diff = calcDiff(plusSum);
				plusCount += diff;
				// plusSum -= diff;
				plusSum = -1;
				// System.out.println("diff " + diff);
				// System.out.println("plusSum " + plusSum);
			}
			// System.out.println();
		}
		// System.out.println("minusCount " + minusCount);
		// System.out.println("plusCount " + plusCount);


		System.out.println(Math.min(minusCount,plusCount));

	}

	private static long calcDiff(long sum){
		return  Math.abs(sum)+1;
	}
}



Measured memory_bytes: 63932
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <time.h>
#define _USE_MATH_DEFINES
#define LL long long
#define UN unsigned
using namespace std;
const double PI = acos(-1.0);

int max_num(int ary[], int length) {
	int max = ary[0];
	for (int i = 1; i < length; i++)
		if (max < ary[i]) max = ary[i];
	return max;
}

int max_ord(int ary[], int length) {
	int max;
	max = max_num(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == max) return i;
	}
	return -1;
}

int min_num(int ary[], int length) {
	int min = ary[0];
	for (int i = 1; i < length; i++)
		if (min > ary[i]) min = ary[i];
	return min;
}

int min_ord(int ary[], int length) {
	int min;
	min = min_num(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == min) return i;
	}
	return -1;
}

int main() {
	int n;


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

	return 0;
}


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

using namespace std;

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

const ll maxn =8e5+5;
const ll mod = 1e9+7;
const ld PI = 4 * atan((ld) 1);

#define pb(x) push_back(x);
#define endl '\n'
#define dokme(x) cout << x ;  return(0);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_init freopen("input.txt", "r+", stdin); freopen("output.txt", "w+", stdout);
#define ms(x , y) memset(x , y , sizeof x);
ll pw(ll a, ll b) {
    return (!b ? 1 : (b & 1 ? a * pw(a * a % mod, b / 2) % mod : pw(a * a % mod, b / 2) % mod));
}

int h , n;
ll dp[maxn];
ll a[maxn] , b[maxn];

int main(){
    migmig
    cin >> h >> n;
    ms(dp , 63);
    for (int i = 0 ; i < n ; i ++){
        cin >> a[i] >> b[i];
        dp[a[i]] = min(dp[a[i]] , b[i]);
    }
    dp[0] = 0;
    for (int i = 1 ; i <= h ; i ++){
        for (int j = 0 ; j < n ; j ++){
            if(i - a[j] >= 0){
                dp[i] = min(dp[i] , dp[i - a[j]] + b[j]);
            }
            else{
                dp[i] = min(dp[i] , b[j]);
            }
        }
    }
    cout << dp[h];



    return(0);
}


//When we hit our lowest point, we are open to the greatest change.
//If I try, I fail. If I don't try, I'm NEVER GOING TO GET IT.
//Sometimes, life is like this dark tunnel. You can't always see the light at the end of the tunnel. But if you just keep moving... you will come to a better place.
//It is important to draw wisdom from diffrent places. If you take it from only one place it becomes rigid and stale.


Measured memory_bytes: 8832
#include "bits/stdc++.h"

using namespace std;

void Main() {
    string s;
    cin >> s;
    int f = s.find_first_of('A');
    int l = s.find_last_of('Z');
    cout << (l - f + 1) << endl;
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3728