akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cmath>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
  int x;
  double w, h;
  while(scanf("%d,%lf,%lf\n",&x,&w,&h)==3)
    if (w/h/h>=25) cout << x << endl;
}

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

#define EB emplace_back
#define int long long
#define F first
#define S second
#define N 500005
#define all(x) x.begin(),x.end()
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)

using namespace std;

int32_t main(){
	IOS;
	int tt = 1; 
	//cin >> tt;
	while(tt--){
	int n; cin >> n;
  int A[n];
  for(int i = 0; i < n; i++) cin >> A[i];
  int sum = 0;
  int mx = A[0];
  for(int i = 1; i < n; i++){
    sum += max(mx - A[i], 0ll);
    mx = max(mx, A[i]);
  }
  
  cout << sum;
	
	}
	return 0;
}


Measured memory_bytes: 5196
//By TheOneYouWant

#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define memreset(a) memset(a,0,sizeof(a))
#define testcase(t) int t;cin>>t;while(t--)
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i = 0; i < e;++i)
#define forsn(i,s,e) for(int i = s; i < e;++i)
#define rforn(i,s) for(int i = s; i >= 0;--i)
#define rforsn(i,s,e) for(int i = s; i >= e;--i)
#define bitcount(a) __builtin_popcount(a) // set bits (add ll)
#define ln '\n'
#define getcurrtime ((double)clock()/CLOCKS_PER_SEC)
#define dbgarr(v,s,e) cerr<<#v<<" = "; forsn(i,s,e) cerr<<v[i]<<", "; cerr<<endl
#define inputfile freopen("input.txt", "r", stdin)
#define outputfile freopen("output.txt", "w", stdout)
#define dbg(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) { cerr<<endl; }
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << "\t"; err(++it, args...);
}
template<typename T1,typename T2>
ostream& operator <<(ostream& c,pair<T1,T2> &v){
    c<<"("<<v.fi<<","<<v.se<<")"; return c;
}
template <template <class...> class TT, class ...T>
ostream& operator<<(ostream& out,TT<T...>& c){
    out<<"{ ";
    forstl(x,c) out<<x<<" ";
    out<<"}"; return out;
}

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> p64;
typedef pair<int,int> p32;
typedef pair<int,p32> p96;
typedef vector<ll> v64;
typedef vector<int> v32; 
typedef vector<v32> vv32;
typedef vector<v64> vv64;
typedef vector<p32> vp32;
typedef vector<p64> vp64;
typedef vector<vp32> vvp32;
typedef map<int,int> m32;

const int LIM=1e5+5, MOD=1e9+7;
const ld EPS = 1e-9;
// int t,n,m,k,x,y,w;
signed main(){
    fastio;
    
    string s;
    cin>>s;

    ll ans = 0;
    ll curra = 0;
    int n = s.length();
    forn(i,s.length()){
        if(s[i] == 'A') curra++;
        else if(s[i] == 'C') curra = 0;
        else if(s[i] == 'B'){
            if(i+1 != n && s[i+1] == 'C'){
                i++;
                ans += curra;
            }
            else{
                curra = 0;
            }
        }
    }
    cout<<ans<<ln;

    return 0;
}

Measured memory_bytes: 764
while True:
  n = int(raw_input())
  if n==0: break
  lst = [0] * n
  for i in xrange(n):
    lst[i] = 1 << i
  isFailed = True
  calender = {}

  for i in xrange(n):
    a = map(int, raw_input().split())
    for j in xrange(1, a[0]+1):
      if a[j] not in calender:
        calender[a[j]] = []
      calender[a[j]].append(i)
  for k,v in sorted(calender.items()):
    stat = 0
    for i in xrange(len(v)):
      stat = stat | lst[v[i]]
    for i in xrange(len(v)):
      lst[v[i]] = stat
    if stat == (1 << n) - 1:
      print k
      isFailed = False
      break
  if isFailed: print "-1"

Measured memory_bytes: 6280
#include <iostream>
#include <algorithm>
#include <functional>
#include <math.h>
using namespace std;
int main(){
  int w,h,x,y,r;
  cin >> w >> h >> x >> y >> r;
  if(0<=(x-r)&&(x+r)<=w&&0<=(y-r)&&(y+r)<=h){
    cout << "Yes\n";
  }else{
    cout << "No\n";
  }
  return 0;
}



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

#define INF (1<<30)

char maze[20][20];
int h,w;

int search(int sy,int sx, int gy, int gx){
	int memo[20][20],dy[4]={-1,1,0,0},dx[4]={0,0,-1,1};
	for(int i=0;i<20;i++){
		for(int j=0;j<20;j++){
			memo[i][j]=0;
		}
	}

	queue< pair<int,int> >Q;

	Q.push({sy,sx});
	memo[sy][sx]=1;

	while(Q.empty()==false){
		pair<int,int>now=Q.front();	Q.pop();
		int y=now.first, x=now.second;

		for(int i=0;i<4;i++){
			int nY=y+dy[i], nX=x+dx[i];
			if(nY<0||nX<0||nY>=h||nX>=w||maze[nY][nX]=='#'||memo[nY][nX])continue;

			memo[nY][nX]=memo[y][x]+1;
			Q.push({nY,nX});
		}
	}

	return memo[gy][gx]-1;

}

int main(){
	cin>>h>>w;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){

			cin>>maze[i][j];
		}
	}

	int ans=0;

	for(int sy=0;sy<h;sy++){
		for(int sx=0;sx<w;sx++){
			if(maze[sy][sx]=='#')continue;

			for(int gy=0;gy<h;gy++){
				for(int gx=0;gx<w;gx++){
					if(maze[gy][gx]=='#')continue;

					ans=max(ans,search(sy,sx,gy,gx));

				}
			}
		}
	}

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod=998244353;
const ll maxn=1e10;
//vector<vector<int> > adj(maxn);
//vector<bool> used(maxn,false);
//vector<int> d(maxn),p(maxn);
ll bin(ll a, ll b) {
	//a%=m;
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a; //mod
        a = a * a; //mod
        b >>= 1;
    }
    return res;
}

int gcd(int a, int b, int & x, int & y) {
    if (a == 0) {
        x = 0;
        y = 1;
        return b;
    }
    int x1, y1;
    int d = gcd(b % a, a, x1, y1);
    x = y1 - (b / a) * x1;
    y = x1;
    return d;
}
ll fact(ll x)
{
  ll res=1;
  for(ll i=1;i<=x;i++)
    res=(res*i)%mod;

  return res;
}

ll lmod(string n,ll x)
{
	
	ll res=0;
	for(ll i=0;i<n.length();++i)
	{
		res=(res*10+(int)n[i]-'0')%x;
	}
	return res;
}
bool ispal(string s,int l,int r)
{
	string t=s;
	for(int i=l,j=r;i<=r;++i)
	{
		if(s[i]!=s[j])
			return false;
		else
			{
				--j;
			}
	}
	return true;
}
bool pl(string s)
{
	string t(s.rbegin(),s.rend());
	return t==s;
}
/*void bfs(int s,int &ans)
{
	queue<int> q;
	used[s]=true;
	p[s]=-1;
	d[s]=0;
	q.push(s);
	while(!q.empty())
	{
		int v=q.front();
		q.pop();
		for(int u: adj[v])
		{
			if(!used[u])
			{
				used[u]=true;
				q.push(u);
				d[u]=d[v]+1;
				ans=max(ans,d[u]);
				p[u]=v;
			}
			
		}
	}
}*/


int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	ll x;
	cin>>x;
	ll f=(x/500)*1000+((x-500*(x/500))/5)*5;
	cout<<f<<endl;
		


	
	
	
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Linq;
using System.Text;

class Program
{
    static bool[] used;
    static int[] cells;
    static int ans;
    static int[] nums;
    static void Main(string[] args)
    {
        while (true)
        {
            string[] s = Console.ReadLine().Split(' ');
            nums = new int[11];
            used = new bool[11];
            cells = new int[11];
            for (int i = 0; i < 10; i++)
            {
                cells[i] = int.Parse(s[i]);
            }
            if (cells[0] == -1) break;
            for (int i = 0; i < 10; i++)
            {
                if (cells[i] != 0)
                {
                    used[cells[i]] = true;
                    nums[i] = cells[i];
                }
            }
            ans = 0;
            permutation(10, 0);
            Console.WriteLine(ans);
        }
    }

    static void permutation(int n, int pos)
    {

        if (n == pos)
        {
            bool flag = true;

            int mod = (nums[0] + nums[1] + nums[2]) % nums[9];
            for (int i = 0; i < 3; i++)
            {
                if ((nums[i * 3] + nums[i * 3 + 1] + nums[i * 3 + 2]) % nums[9] != mod) flag = false;
            }
            for (int i = 0; i < 3; i++)
            {
                if ((nums[i] + nums[i + 3] + nums[i + 6]) % nums[9] != mod) flag = false;
            }
            if ((nums[0] + nums[4] + nums[8]) % nums[9] != mod) flag = false;
            if ((nums[2] + nums[4] + nums[6]) % nums[9] != mod) flag = false;
            if (flag) ans++;
            return;
        }

        if (cells[pos] == 0)
        {
            for (int i = 1; i <= 10; i++)
            {
                if (used[i]) continue;
                used[i] = true;
                nums[pos] = i;
                permutation(n, pos + 1);
                used[i] = false;
            }
        }
        else
        {
            permutation(n, pos + 1);
        }
        return;
    }
}

Measured memory_bytes: 5612
// Author : Nachiket Kanore
// Institute : PICT, Pune

/* It does not matter how slowly you go as long as you do not stop.*/

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define endl '\n'
#define rep(x,s,e) for(int x=s;x<=(e);x++)
#define repn for(int x=0;x<n;x++)
#define rep1n for(int x=1;x<=n;x++)
#define rep1m for(int y=1;y<=m;y++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define precise(x) cout << fixed << setprecision(x)
#define bits(x) __builtin_popcount(x)
#define pb push_back
#define mp make_pair
#define test int t; cin>>t; while(t--)
#define FAST                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)

typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef pair<int,int> pii;


void __print(int x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}


template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define see(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define see(x...)
#endif

const int inf = 1e18;
const int N = 1005;



int32_t main(){
    FAST;

    int n;  cin >> n;
    int even = n/2;
    int odd = (n/2) + (n % 2);

    cout << even * odd << endl;

    return 0;
}




Measured memory_bytes: 256
#include<iostream>

int main(void)
{
	int N,K;
	int count=0;

	std::cin >> N >> K;
	for(int i = 1; i <= N-K+1; i++)
		if(i+K-1 <= N)
			count++;

	std::cout << count << std::endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i=a; i<n; i++)
#define RREP(i, a, n) for(ll i=n-1; i>=a; i--)
typedef long long ll;
const ll mod =1e9+7;
const ll inf =1e18;
using namespace std;
 
ll n, k;
ll a[1010];
ll sum[1010];
map<ll, ll> mp;
int main() {
    cin>>n>>k;
    REP(i, 0, n) cin>>a[i];
 
    REP(i, 0, n) sum[i+1]=sum[i]+a[i];
    REP(i, 1, n+1){
        REP(j, i, n+1){
            mp[sum[j]-sum[j-i]]++;
        }
    }
 
    vector<pair<ll, ll>> vp;
    for(auto itr = mp.begin(); itr != mp.end(); ++itr){
        vp.emplace_back(make_pair(itr->first, itr->second));
    }
 
    ll ans=0;
    RREP(i, 0, 41){
        vector<pair<ll, ll>> vpll;
        ll cnt=0;
        for(auto itr:vp){
            if(itr.first & (1LL<<i)){
                cnt+=itr.second;
                vpll.emplace_back(make_pair(itr.first, itr.second));
            }
        }
 
        if(cnt>=k){
            ans+=(1LL<<i);
            vp.clear();
            for(auto itr:vpll){
                vp.emplace_back(make_pair(itr.first, itr.second));
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 43240
#include <iostream>
#include <cstdio>
using namespace std;
long long int N,A,B;
long long int v[100001];
bool enough(long long int T){
  long long int x;
  long long int sum_t=0;
  for(int i=0;i<N;i++){
    long long int t;
    x=v[i];
    if(x<=B*T)continue;
    x-=B*T;
    long long int temp=x%(A-B);
    t=x/(A-B);
    if(temp>0)t++;
    sum_t+=t;
  }
  if(sum_t<=T)return true;
  else return false;
}
int main(){
  cin >> N >> A >> B;
  for(int i=0;i<N;i++)cin >> v[i];

  long long int l=0,h=10000000000,T;
  while(h-l>1){
    T=(l+h)/2;
    
    if(enough(T))h=T;
    else l=T;
  }
  cout << h << endl;
  return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();
		String moji=a+""+b;
		int res=Integer.parseInt(moji);

		for(int i=0; i<=320; i++) {
			if(res==i*i) {
				System.out.println("Yes");
				break;
			}
			else if(res<i*i) {
				System.out.println("No");
				break;
			}
		}
	}
}

Measured memory_bytes: 21844
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>
#include <iomanip>
#include <random>

#define FOR_LT(i, beg, end) for (int i = (int)(beg); i < (int)(end); i++)
#define FOR_LE(i, beg, end) for (int i = (int)(beg); i <= (int)(end); i++)
#define FOR_DW(i, beg, end) for (int i = (int)(beg); (int)(end) <= i; i--)
#define REP(n)              for (int repeat_index = 0; repeat_index < (int)n; repeat_index++)

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(20);

	int x; cin >> x;

	if (1800 <= x) {
		cout << 1 << endl;
	}
	else if (1600 <= x) {
		cout << 2 << endl;
	}
	else if (1400 <= x) {
		cout << 3 << endl;
	}
	else if (1200 <= x) {
		cout << 4 << endl;
	}
	else if (1000 <= x) {
		cout << 5 << endl;
	}
	else if (800 <= x) {
		cout << 6 << endl;
	}
	else if (600 <= x) {
		cout << 7 << endl;
	}
	else {
		cout << 8 << endl;
	}

	return 0;
}

Measured memory_bytes: 3648
from collections import deque

H, W = list(map(int, input().split()))
field = []
for _ in range(H):
  field.append([int(s) % 2 for s in input().split()])

q = deque()
for y in range(1, H + 1):
  if y % 2:
    xr = range(1, W + 1)
  else:
    xr = range(W, 0, -1)
  for x in xr:
    q.append((y, x))

manipulations = []
while True:
  y, x = q.popleft()
  if not len(q):
    break
  if field[y - 1][x - 1] % 2:
    manipulations.append((y, x, q[0][0], q[0][1]))
    field[y - 1][x - 1] = 0
    field[q[0][0] - 1][q[0][1] - 1] += 1

print(len(manipulations))
for man in manipulations:
  print(*man)


Measured memory_bytes: 30432
from math import gcd
from collections import defaultdict

k = int(input())

memo = defaultdict(defaultdict)

rg = range(1, k + 1)
for i in rg:
    for j in rg:
        memo[i][j] = memo[j][i] = gcd(i, j)

ret = 0
for i in rg:
    for j in rg:
        tmp = memo[i][j]
        for k in rg:
            res = memo[k][tmp]
            ret += res

print(ret)

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

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

    int ans = 0;
    for(int i=0; i<N; i++){
        int j_inc = i, j_dec = i;
        if(i < N-1){
            while(A[j_inc+1] >= A[j_inc]){
                j_inc++;
                if(j_inc==N-1) break;
            }
            while(A[j_dec+1] <= A[j_dec]){
                j_dec++;
                if(j_dec==N-1) break;
            }
            i = max(j_inc, j_dec);
        }
        ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
 
#define pb push_back
#define ll long long
#define maxn 100005
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define ms(i) memset(i,0,sizeof(i));
#define ms1(i) memset(i,-1,sizeof(i));
#define F first
#define S second
const int mod = 1e9 + 7;
ll p[100005];
ll inv[100005];
ll pinv[100005];
void build(int n){
    p[1] = p[0] = 1;
    inv[1] = inv[0] = pinv[1] = pinv[0] = 1;
    for(int i = 2 ; i <= n ; i++){
        p[i] = p[i - 1] * i % mod;
        inv[i] = (mod - mod / i * inv[mod % i] % mod) % mod;
        pinv[i] = pinv[i - 1] * inv[i] % mod;
    }
}
ll query(int n,int k){
    return p[n] * pinv[k] % mod * pinv[n - k] % mod;
}
int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n, k;
    cin >> n >> k;
    build(n);
    vector<int>v(n);
    for(auto &i:v){
        cin >> i;
    }
    sort(v.begin(),v.end());
    ll ans = 0;
    for(int i = 1 ; i <= n ; i ++){
        if(i + k - 1 <= n){
            ans -= v[i - 1] * query(n - i, k - 1);
            //cout << i <<' '<<n-i<<' '<<k-1<<' '<<query(n-i,k-1)<<'\n';
            ans += mod;
            ans %= mod;
        }
        if(i >= k){
            ans += v[i - 1] * query(i - 1, k - 1);
           // cout << i <<' '<<i-1<<' '<<k-1<<' '<<query(i-1,k-1)<<'\n';
            ans %= mod;
        }
    }
    cout << ans << '\n';
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vl = vector<long>;
using vvl = vector<vector<long>>;
using pll = pair<long, long>;
#define rep(i,n) for(int i=0; i<(int)(n);i++)

long K = 9;
long D = 512;

vvl dp(D+1,vl(100010,0));
vector<long> V(262144,0),W(262144,1e6);

void dfs(int now, int d){
  long v = V.at(now-1);
  long w = W.at(now-1);
  rep(j,100001){
    if(j - w >= 0) dp.at(now).at(j) = max(dp.at(now/2).at(j), dp.at(now/2).at(j-w)+v);
    else dp.at(now).at(j) = dp.at(now/2).at(j);
  }
  if(d == K-1) return;
  dfs(now*2,d+1);
  dfs(now*2+1,d+1);
}

long search(int now, long v, long w, long L){
  if(now < D){
    if(w > L) return 0;
    else return v + dp.at(now).at(L-w);
  }
  return max(search(now/2, v+V.at(now-1), w+W.at(now-1), L), search(now/2,v,w,L));
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long n;
  cin >> n;
  rep(i,n) cin >> V.at(i) >> W.at(i);
  dfs(1,0);
  int q;
  cin >> q;
  rep(i,q){
    long v,l;
    cin >> v >> l;
    if(v < D){
      cout << dp[v][l] << "\n";
    }else{
      cout << search(v,0,0,l) << "\n";
    }
  }
}


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

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}


int main() {
    ll n, m;
    cin >> n >> m;
    
    vector<mint> dp(n + 1);
    if(m == 0){
        dp[0] = 1;
        dp[1] = 1;
        for(ll i = 2; i <= n; i++){
            dp[i] = dp[i - 1] + dp[i - 2];
        }
        cout << dp[n] << endl;
        return 0;
    }
    

    vector<ll> a(m);
    for(ll i = 0; i < m; i++) cin >> a[i];
    dp[0] = 1;
    ll ia = 0;
    if(a[ia] == 1){
        dp[1] = 0;
        ia++;
    }
    else dp[1] = 1;

    for(ll i = 2; i <= n; i++){
        dp[i] = dp[i - 1] + dp[i - 2];
        if(ia >= m) continue;
        if(i == a[ia]){
            dp[i] = 0;
            ia++;
        }
    }

    cout << dp[n] << endl;





}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
//#include "library/debug.cpp"

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

    int n;
    cin >> n;
    vector<vector<int>> a(n, vector<int>(2));
    rep(i, 0, n) cin >> a[i][0];
    rep(i, 0, n) cin >> a[i][1];
    for (int i = 1; i < n; i += 2) swap(a[i][0], a[i][1]);
    vector<vector<int>> dp(1 << n, vector<int>(n, 1e9));
    rep(i, 0, n) {
        dp[1 << i][i] = 0;
    }

    for (int x = 1; x < (1 << n) - 1; x++) {
        int cnt = (__builtin_popcount(x) + 1) % 2;
        rep(i, 0, n) if ((x >> i) & 1) {
            if (dp[x][i] > 1e7) continue;
            int mn = a[i][cnt];
            rep(j, 0, n) if (!((x >> j) & 1)) {
                if (mn <= a[j][cnt ^ 1]) {
                    int res = 0;
                    rep(k, j + 1, n) if ((x >> k) & 1) res++;
                    dp[x + (1 << j)][j] =
                        min(dp[x + (1 << j)][j], dp[x][i] + res);
                }
            }
        }
    }
    int ans = 1e9;
    rep(i, 0, n) ans = min(ans, dp[(1 << n) - 1][i]);
    cout << (ans > 1e7 ? -1 : ans) << endl;
    return 0;
}


Measured memory_bytes: 26880
#ABC128C
def main():
    import sys, itertools as ite
    N, M = map(int, sys.stdin.readline().split())
    KS = [tuple(map(int, sys.stdin.readline().split())) for _ in range(M)]
    P = tuple(map(int, sys.stdin.readline().split()))
    
    #print(KS)
    #bit全探索
    SWS = tuple(ite.product([0,1], repeat=N)) 
    
    def judge(on_off):
        for i in range(M):
            on_cnt = 0
            for s in KS[i][1:]:
                on_cnt += on_off[s-1]
            if on_cnt %2 !=P[i]:
                return 0
        else:
            return 1
    ans = 0
    for on_off in SWS:
        ans +=judge(on_off)
    print(ans)






if __name__=='__main__':
    main()


Measured memory_bytes: 3316
#include<iostream>
using namespace std;
int main(){
  string s;
  while(cin >>s){
    int ans = 0,t = 0;
    for(int i=0; i<s.size(); i++){
      switch(s[i]){
      case 'I':
	t = 1;
	ans++;
	break;
      case 'V':
	if(t == 1) ans-=2;
	t = 5;
	ans+=5;
	break;
      case 'X':
	if(t == 1) ans-=2;
	t = 10;
	ans+=10;
	break;
      case 'L':
	if(t == 10) ans-=20;
	t = 50;
	ans+=50;
	break;
      case 'C':
	if(t == 10) ans-=20;
	t = 100;
	ans+=100;
	break;
      case 'D':
	if(t == 100) ans-=200;
	t = 500;
	ans+=500;
	break;
      case 'M':
	if(t == 100) ans-=200;
	t = 1000;
	ans+=1000;
	break;
      }
    }
    cout <<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 1180
from collections import Counter

S = input()

ans = 0
mod_list = [0] * len(S)
mod_list[-1] = int(S[-1])
m = 1
for i in range(2, len(S) + 1):
    m = (10 * m) % 2019
    mod_list[-i] = (mod_list[-i + 1] + (int(S[-i]) * m)) % 2019

mod_counter = Counter(mod_list)
mod_counter[0] += 1

ans = 0
for _, v in mod_counter.items():
    ans += v * (v - 1) // 2

print(ans)


Measured memory_bytes: 16656
/*
    Life Before Death, Strength Before Weakness, Journey Before Destination
    ------------------------------------------------------------------------
    You don't become great by trying to be great.
    You become great by wanting to do something,
    and then doing it so hard that you become great in the process.
    */
 
    //#pragma comment(linker, ack:200000000")
    #pragma GCC optimize ("Ofast")
    #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
    #include <bits/stdc++.h>
    using namespace std;
    
    #define TRACE
    
    #ifdef TRACE
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
      cerr << name << " : " << arg1 << std::endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
      const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
    #else
    #define trace(...)
    #endif
    
    #define rep(i, n)    for(ll i = 0; i < (n); ++i)
    #define repA(i, a, n)  for(ll i = a; i <= (n); ++i)
    #define repD(i, a, n)  for(ll i = a; i >= (n); --i)
    #define trav(a, x) for(auto& a : x)
    #define all(x) x.begin(), x.end()
    #define sz(x) (int)(x).size()
    #define fill(a)  memset(a, 0, sizeof (a))
    #define fst first
    #define snd second
    //#define mp make_pair
    #define pb push_back
    #define PI           3.141592653589793238462643383279502884197169399  /* pi */
    // #define te    
    typedef long double ld;
    typedef long long ll;
    typedef pair<ll, ll> pii;
    typedef vector<ll> vi;
    const int maxN = 100100;

    ll val[400][400], pre[maxN];
    map<ll, pii> mp;

    void solve() {
        ll h, w, d, q;
        cin >> h >> w >> d;
        rep(i, h) rep(j, w) cin >> val[i][j], mp[val[i][j]] = {i, j};
        repA(i, d+1, h*w) pre[i] = pre[i-d] + abs(mp[i].fst - mp[i-d].fst) + abs(mp[i].snd - mp[i-d].snd);
        cin >> q;
        rep(i, q){
            ll l, r;
            cin >> l >> r;
            cout << (pre[r] - pre[l]) << endl;
        }                                
    }
 
    int main() {
      cin.sync_with_stdio(0); cin.tie(0);
      cin.exceptions(cin.failbit);
       // ll ti;   cin >> ti;  while(ti--)
      solve();
      return 0;
    } 

Measured memory_bytes: 8448
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>
#include <bitset>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

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

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

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

  int ans = INF;
  for (int bit = 0; bit < (1<<N); ++bit){
    int sum = 1;
    for (int i = 0; i < N; ++i){
      if (bit & (1<<i)){
        sum *= 2;
      }
      else{
        sum += K;
      }
    }
    ans = min(ans, sum);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

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

  int H,W,K;
  cin>>H>>W>>K;
  vector<string> S(H);
  rep(i,H) cin>>S[i];

  int ans=0;
  for(int hbit=0;hbit<(1<<H);hbit++) for(int wbit=0;wbit<(1<<W);wbit++){
    vector<string> T=S;
    rep(i,H){
      if(hbit&(1<<i)){
        rep(j,W) T[i][j]='r';
      }
    }
    rep(j,W){
      if(wbit&(1<<j)){
        rep(i,H) T[i][j]='r';
      }
    }

    int num=0;
    rep(i,H) rep(j,W) if(T[i][j]=='#') num++;

    if(num==K) ans++;
  }

  cout<<ans<<endl;

  return 0;
}


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


int main(){
	int h,w;
	cin >> h >> w;
	char bord[52][52]={'.'};
	
	for (int i = 1; i <= h; ++i){
		for (int j = 1; j <= w; ++j){
			cin >> bord[i][j];
		}
	}




	int dx[8]={0,-1,0,1};
	int dy[8]={-1,0,1,0};
	int cnt=0;
	for (int i = 1; i <= h; ++i){
		for (int j = 1; j <= w; ++j){
			if(bord[i][j]=='#'){
				for (int k = 0; k < 4; ++k){
					if(bord[i+dy[k]][j+dx[k]]=='.')
						cnt++;
				}
			}
			if(cnt==4){
				cout << "No" << endl;
				return 0;
			}else
				cnt=0;
		}
	}

	cout << "Yes" <<endl;

}


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

int main() {
	string S;
	cin >> S;
	for (int i = 0; i < 12; i++) {
		if (i == 3) cout << S.at(i) << ' ';
		else cout << S.at(i);
	}
	cout << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long a[1000005];
int main()
{
	int t=0;
	a[0]=0;
	for(int i=1;i<=1000001;i++)
	{
		a[i]=i;
		if(i%3==0||i%5==0||i%15==0)
		a[i]=0;
		a[i]=a[i]+a[i-1];
	}
	int n;
	cin>>n;
	cout<<a[n]<<endl;
	return 0;
}

Measured memory_bytes: 11416
import java.util.*;

public class Main {
	public static int n, f;
	public static List<Integer> list;
	  public static void main(String[] args) {
		list = new ArrayList<>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		f = sc.nextInt();
		for(int i = 0; i < n-1; i++) {
			list.add(sc.nextInt());
		}
		
		int c = 0;
		int max = f;
		for(Integer i:list) {
			if(i >= max) {
				c++;
				max = i;
			}
		}
		System.out.println(c+1);
	  }
}

Measured memory_bytes: 21716
"use strict";
    
const main = arg => {
    arg = arg.split("\n");
    const blueN = parseInt(~~arg[0]);
    const blueS = arg.slice(1,blueN + 1);
    const redN  = parseInt(~~arg[blueN + 1]);
    const redS  = arg.slice(blueN+2);

    const set = new Set(redS.concat(blueS));
    let answer = [];

    set.forEach(item => {
        let temp = 0;
        let foundInBlue = blueS.filter(n=>n==item).length;
        let foundInRed  = redS.filter(n=>n==item).length;
        
        if(foundInBlue > 0) {
            temp += foundInBlue;
        }
        
        if(foundInRed > 0) {
            temp -= foundInRed;
        }
        
        answer.push(temp);
    })
    
    console.log(Math.max(...answer) > 0 ? Math.max(...answer) : 0);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


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

int main() {
  string S, T; cin>>S>>T;
  rep(i, T.size()) cout<<T[i];
  rep(i, S.size()) cout<<S[i];
  cout<<endl;
}

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

int n,l;
char s[5010];
long long dp[5010][5010];
const long long mod=1e9+7;
inline long long ksm(long long x,long long y,long long mod)
{
	long long res=1;
	while(y)
	{
		if(y&1)
		res=res*x%mod;
		x=x*x%mod;
		y>>=1;
	}
	return res;
}
int main()
{
	scanf("%d",&n);
	scanf("%s",s+1);
	l=strlen(s+1);
	dp[0][0]=1;
	for(int i=1;i<=n;++i)
	{
		for(int j=0;j<=i;++j)
		{
			dp[i][j]=(dp[i][j]+dp[i-1][j-1]*2)%mod;
			if(j==0)
			dp[i][j]=(dp[i][j]+dp[i-1][j])%mod;
			else
			dp[i][j-1]=(dp[i][j-1]+dp[i-1][j])%mod;
		}
	}
	long long ans=ksm(2,l,mod);
	ans=ksm(ans,mod-2,mod);
	ans=ans*dp[n][l]%mod;
	printf("%lld\n",ans); 
	return 0;
}

Measured memory_bytes: 194176
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int N;
    cin >> N;
    int a[N];
    bool flag = true;
    for (int i = 0; i < N; i++) {
        cin >> a[i];
        if (a[i] == 1) flag = false;
    }
    if (flag) {
        cout << "-1\n";
        return 0;
    }
    int cnt = 0;
    int t = 1;
    for (int i = 0; i < N; i++) {
        if (a[i] == t) t++;
        else cnt++;
    }
    cout << cnt << "\n";
    return 0;
}


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

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


int main() {
  int n,m,A_B,B_A,f=0,ans=0;
  cin >> n >> m;
  vector<ll> H(n);
  map<int,vector<int>> L;
  rep(i,n) cin >> H[i];
  rep(i,m){
    cin >> A_B >> B_A;
    L[A_B-1].push_back(B_A-1);
    L[B_A-1].push_back(A_B-1);
  }
  rep(i,n){
    f=0;
    if(L[i].size() == 0) {
      ans++;
    }
    else {
      rep(j,L[i].size()){
        if(H[i]<=H[L[i][j]]){
          f=1;
        }
      }
      if(f==0) ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 14616
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>pii;
#define sf(x) scanf("%d",&x)
#define sfl(x) scanf("%lld",&x)
#define lli long long int
#define ll64 int64_t
#define pb push_back
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define frr(i,a) for(int i=0;i<a;i++)
#define frl(i,a) for(lli i=0;i<a;i++)
int main()
{
    lli n;
    cin>>n;
    vector<lli>a(n);
    frr(i,n)
    {
        cin>>a[i];
    }
    sort(a.begin(),a.end());
    vector<pair<lli,pair<lli,lli>>>s;
    for(int i=0;i<n-2;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(i!=j)
            {
                for(int k=j+1;k<n;k++)
                {
                    if(j!=k)
                    {
                        lli v[3];
                        v[0]=a[i];
                        v[1]=a[j];
                        v[2]=a[k];
                        //sort(v,v+3);
                        if(v[0]+v[1]>v[2] and v[0]!=v[1] and v[1]!=v[2] and v[2]!=v[0])
                        s.pb({v[0],{v[1],v[2]}});
                    }
                }
            }

        }
    }
    cout<<s.size()<<endl;
}


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

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

const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;

#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

ll gcd(ll x, ll y)
{
  if (x % y == 0)
  {
    return y;
  }
  return gcd(y, x % y);
}

int main()
{
  ll N;
  cin >> N;
  cout << (1+N)*N/2 << endl;
  return 0;
}

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

int main(){
	int a, b;

	cin >> a >> b;

	if (a < b) {
		cout << "a < b" << endl;
	}
	else if (a > b) {
		cout << "a > b" << endl;
	}
	else {
		cout << "a == b" << endl;
	}

	return 0;
}

Measured memory_bytes: 1156
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
    static final long MOD = 1000000007;

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        final int[] a = new int[n];
        int max1 = 0;
        int max1Idx = 0;
        int max2 = 0;
        int max2Idx = 0;
        for (int i = 0; i < a.length; i++) {
            a[i] = scanner.nextInt();
            if (max1 <= a[i]) {
                max2 = max1;
                max2Idx = max1Idx;
                max1 = a[i];
                max1Idx = i;
            } else if (max2 <= a[i]) {
                max2 = a[i];
                max2Idx = i;
            }
        }
        final StringBuilder ans = new StringBuilder();
        for (int i = 0; i < a.length; i++) {
            if (i == max1Idx) {
                ans.append(max2);
                ans.append("\n");
            } else {
                ans.append(max1);
                ans.append("\n");
            }
        }
        System.out.print(ans);
    }
}


Measured memory_bytes: 95428
#include <bits/stdc++.h>
#define endl '\n'

//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")

using namespace std;
template<class T, class T2> inline int chkmax(T &x, const T2 &y) { return x < y ? x = y, 1 : 0; }
template<class T, class T2> inline int chkmin(T &x, const T2 &y) { return x > y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);

int n;
int a[MAXN];

void read()
{
	cin >> n;
	for(int i = 0; i < n; i++)
		cin >> a[i];
}

int p[MAXN];

void solve()
{
	if(n == 2)
	{
		cout << abs(a[0] - a[1]) << endl;
		return;
	}

	sort(a, a + n);

	for(int i = n / 2 - 2, v = 1; i >= 0; i -= 2, v += 2) p[i] = v;
	for(int i = n / 2 + 2, v = 2; i < n; i += 2, v += 2) p[i] = v;
	for(int i = n / 2 - 1, v = n - 1; i >= 0; i -= 2, v -= 2) p[i] = v;
	for(int i = n / 2 + 1, v = n - 2; i < n; i += 2, v -= 2) p[i] = v;

	int64_t answer = 0;
	for(int i = 0; i + 1< n; i++)
		answer += abs(a[p[i]] - a[p[(i + 1) % n]]);

	for(int tms = 0; tms < 20; tms++)
	{
		random_shuffle(a, a + n);

		int64_t curr = 0;
		for(int i = 0; i + 1< n; i++)
			curr += abs(a[p[i]] - a[p[(i + 1) % n]]);

		chkmax(answer, curr);
	}

	vector<int> a;
	for(int i = 0; i < n; i++)
		a.push_back(::a[i]);	

	sort(a.begin(),a.end());
	int l=a[a.size()-1]; //left
	int r=l;             // right
	int i=0,j=a.size()-2;
	long long int sum=0;
	while(i<j){
		int li=abs(l-a[i]),ri=abs(r-a[i]);
		int lj=abs(l-a[j]),rj=abs(r-a[j]);
		if(li>ri||lj>rj){ //left side
			if(li>lj){
				sum+=li;
				l=a[i++];
			}else{
				sum+=lj;
				l=a[j--];
			}
		}else{
			if(ri>rj){
				sum+=ri;
				r=a[i++];
			}else{
				sum+=rj;
				r=a[j--];
			}
		}
		//cout<<l<<"---"<<r<<"------"<<i<<"---"<<j<<"----------"<<sum<<endl;
	}
	sum+=max(abs(l-a[i]),abs(r-a[i]));

	cout << sum << endl;
}

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

	read();
	solve();
	return 0;
}



Measured memory_bytes: 3324
#include<stdio.h>

int main(){
  int x,y,d1,d2;
  scanf("%d%d",&x,&y);
  while(1){
    if(x>y)x=x%y;
    else if(x<y)y=y%x;
    else {
      printf("%d\n",x);
      break;
    }
    if(x==0){
      printf("%d\n",y);
      break;
    }
    if(y==0){
      printf("%d\n",x);
      break;
    }
    if(x==1){
      printf("%d\n",x);
      break;
    }
    if(y==1){
      printf("%d\n",y);
      break;
    }
  }
  return 0;
}



Measured memory_bytes: 2084
#include<cstdio>
#include<queue>
#include<vector>
using ll = long long;
constexpr ll infty=1e15;
int main(){
    int q;
    //sum_i |x-a_i|のグラフが折れ曲がる（傾きが1増加する）位置を
    //l_n<=...<=l_1<=r_1<=...<=r_nとし、2つのpriority queueで管理：
    //lower=[l_n,...,l_1],higher=[r_1,...,r_n]
    std::priority_queue<ll> lower;
    std::priority_queue<ll,std::vector<ll>,std::greater<ll>> higher;
    ll sum_b=0,min_a=0;
    lower.push(-infty);
    higher.push(infty);
    //argmin(f)==[lower.top(),higher.top()]が常に成り立つようにする
    scanf("%d",&q);
    for(int i=0;i<q;i++){
        int j;
        scanf("%d",&j);
        if(j==1){//1 a b -> f(x)をf(x)+|x-a|+bで置き換える
            ll a,b;
            scanf("%lld%lld",&a,&b);
            sum_b+=b;
            if(a<lower.top()){
                //   [l_n,...,l_1],[r_1,...,r_n]
                //-> [l_n,...,a,a,...,l_2],[l_1,r_1,...,r_n]
                lower.push(a);
                lower.push(a);
                auto t=lower.top();
                lower.pop();
                higher.push(t);
                //最小値はl_1-aだけ増加
                min_a+=(t-a);
            }else if(a>higher.top()){
                //   [l_n,...,l_1],[r_1,...,r_n]
                //-> [l_n,...,l_1,r_1],[r_2,...,a,a,...,r_n]
                higher.push(a);
                higher.push(a);
                auto t=higher.top();
                higher.pop();
                lower.push(t);
                //最小値はa-r_1だけ増加
                min_a+=(a-t);
            }else{
                //   [l_n,...,l_1],[r_1,...,r_n]
                //-> [l_n,...,l_1,a],[a,r_1,...,r_n]
                lower.push(a);
                higher.push(a);
                //最小値は変化しない
            }
            //printf("%lld %lld %lld %lld\n",lower.top(),higher.top(),min_a,sum_b);
        }else{//2 -> min(argmin_x f(x))とmin(f(x))を出力する
            printf("%lld %lld\n",lower.top(),min_a+sum_b);
        }
    }

    return 0;
}

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

int main()
{
  string s; cin >> s;
  int ans = 0;
  int tmp = 0;
  for (auto c:s) {
    if (c=='A'||c=='C'||c=='G'||c=='T') tmp++;
    else tmp = 0;
    ans = max(ans, tmp);
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

int main() {
    double r;
    cin >> r;
    double pi = 3.1415926535;
    cout << 2 * pi * r << endl;
    
}

Measured memory_bytes: 3788
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <utility>
#include <functional>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_map>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const int MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main() {
    int q;
    list<int> L;
    list<int>::iterator it=L.end();
    cin >> q;
    rep(i, q){
        int n;
        cin >> n;
        switch(n){
        case 0:
            int x;
            cin >> x;
            it=L.insert(it, x);
            break;
        case 1:
            int d;
            cin >> d;
            if(d > 0) rep(i, d) it++;
            else rep(i, -d) it--;
            break;
        case 2:
            it=L.erase(it);
        }
    }
    for(const auto &a : L) cout << a << endl;

    return 0;
}


Measured memory_bytes: 18620
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;

public class Main {

	static BufferedReader reader;
	final static boolean MODE_DEBUG = false;
	//static field here
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		reader = new BufferedReader(new InputStreamReader(System.in));
		//code here
		int[] NM = readLineInt();
		int N = NM[0];
		switch(N%10) {
			case 2:
			case 4:
			case 5:
			case 7:
			case 9:
				print("hon");break;
			case 0:
			case 1:
			case 6:
			case 8:
				print("pon");break;
			case 3:
				print("bon");
		}
		
		print();
		//String[] s = readLine();
		//print(num);
	}
	
	//functions here
	//note that all methods should be STATIC


	private static <T> int arraySearch(T needle, T[] heystack) {
		for(int i=0;i<heystack.length;i++) {
			if(needle.equals(heystack[i])) {
				return i;
			}
		}
		return -1;
	}
	private static int[] sort(int[] base) {
		int[] copy = array_copy(base);
		Arrays.sort(copy);
		return copy;
	}
	private static int[] array_copy(int[] base) {
		int[] copy = new int[base.length];
		for(int i=0;i<base.length;i++) {
			copy[i] = base[i];
		}
		return copy;
	}
	private static int[] asArray(ArrayList<Integer> ints) {
		int[] intlist = new int[ints.size()];
		for(int i=0;i<intlist.length;i++) {
			intlist[i] = ints.get(i);
		}
		return intlist;
	}
	private static String[] readLine(){
		try{
			return reader.readLine().split(" ");
		}catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		}
	}
	private static int[] readLineInt(){
		try{
			String[] s = readLine();
			int[] ints = new int[s.length];
			for(int i=0;i<ints.length;i++) {
				ints[i] = Integer.parseInt(s[i]);
			}
			return ints;
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}
	private static long[] readLineLong(){
		try{
			String[] s = readLine();
			long[] ints = new long[s.length];
			for(int i=0;i<ints.length;i++) {
				ints[i] = Long.parseLong(s[i]);
			}
			return ints;
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}
	private static byte[] readLineByte(){
		try{
			String[] s = readLine();
			byte[] bytes = new byte[s.length];
			for(int i=0;i<bytes.length;i++) {
				bytes[i] = Byte.parseByte(s[i]);
			}
			return bytes;
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}
	private static char[] readLineChar(){
		try{
			String[] s = readLine();
			char[] chars = new char[s.length];
			for(int i=0;i<chars.length;i++) {
				chars[i] = (char)Integer.parseInt(s[i]);
			}
			return chars;
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}
	private static void print(Object o){
		System.out.println(o);
	}
	private static void print(){
		System.out.println();
	}
	private static void printd(Object o){
		if(MODE_DEBUG)System.err.println(o);
	}
	private static void printd(){
		if(MODE_DEBUG)System.err.println();
	}
}


Measured memory_bytes: 32844
#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>



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

  int n;
  cin>>n;
  vector<double> v(n);
  rep(i,n){
    cin>>v[i];
  }

  while(v.size()!=1){
    sort(all(v));
    double a=v[0];
    v.erase(v.begin());
    double b=v[0];
    v.erase(v.begin());
    v.PB((a+b)/2);
  }

  printf("%.10lf\n",v[0]);

}

Measured memory_bytes: 256
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def lgcd(l):
    return reduce(gcd,l)
def llcm(l):
    return reduce(lcm,l)
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x):
        self.setdefault(x,0)
        self[x] += 1

N,M = mint()
S,T = input(),input()
l,g = lcm(N,M),gcd(N,M)
ans = True
for i in range(g):
    if S[i*l//M]!=T[i*l//N]:
        ans = False
        break
print(l if ans else -1)

Measured memory_bytes: 68164
/*   ꧁༒☬महाकाल☬༒꧂ ꧁༒ঔमहाकालঔ༒꧂
                   
                   ঔৣ۝महाकालᴳᵒᵈ۝ঔৣ            
 
 */ 
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops"
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//template <typename T, typename cmp=less<T>> using oset =tree<T, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long 
#define mod 1000000007
#define MOD 998244353
#define inf 100000000000000000
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define _it iterator
#define all(_x) _x.begin(),_x.end()
#define f first
#define s second
#define pb push_back
#define ar array
#define ld long double

void mahakal(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};
// char c[4]={'D' , 'R' , 'U' , 'L'};
const ll maxN=2e5+5;
ll n ;
ll power(ll x , ll y){
    if(y==0)return 1 ;
    ll ps = power(x , y/2)%mod;
    ll ss= ps*ps%mod;
    if(y&1)ss=x*ss%mod;
    return ss ;
}
void solve(){
	cin>> n ;
	ll ans = (power(10 , n) - 2*power(9 , n) % mod + power(8 , n) + mod)%mod;
    cout<<ans<<endl;
}

int main(){
// 	mahakal();
	fast;
	ll t =1 ;
// 	cin>> t ; 
	while(t--)solve();
// 	cerr << "\ntime taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl; 
	return 0;
}

Measured memory_bytes: 3632