akhauriyash/Code-Regression huggingface dataset:
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;

void main() {
    auto s = readln.split.map!(to!long);
    auto N = s[0].to!int;
    auto L = s[1];
    auto A = N.iota.map!(_ => readln.split.map!(to!long).array).array;
    A.sort!"a[0] < b[0]";

    {
        auto pq = new BinaryHeap!(Array!long, "a < b");
        long right = 0;
        int p = 0;
        int ans = 0;
        while (right < L) {
            while (p < N && A[p][0] <= right) {
                pq.insert(A[p][1]);
                p += 1;
            }
            right = pq.front;
            pq.removeFront;
            ans += 1;
        }
        write(ans, " ");
    }

    {
        long[] B;
        foreach (a; A) B ~= a;
        B = B.sort().uniq.array;
        long[long] comp;
        foreach (i; 0..B.length.to!int) comp[B[i]] = i;
        foreach (i; 0..N) A[i][0] = comp[A[i][0]], A[i][1] = comp[A[i][1]];
        L = B.length.to!long - 1;

        auto imos = new int[](L+1);
        foreach (i; 0..N) {
            imos[A[i][0]] += 1;
            imos[A[i][1]] -= 1;
        }
        foreach (i; 0..L) {
            imos[i+1] += imos[i];
        }
        int ans = 1;
        foreach (i; 0..L) {
            ans = max(ans, N - imos[i] + 1);
        }
        ans.writeln;
    }
}



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

ll inf=1e18;

int main() {
  ll h,w;
  cin >> h >> w;
  vector<vector<ll>> d(10,vector<ll> (10,inf));
  for(ll i=0;i<10;i++) {
    for(ll j=0;j<10;j++) {
      cin >> d[i][j];
    }
  }
  for(ll k=0;k<10;k++) {
    for(ll i=0;i<10;i++) {
      for( ll j=0;j<10;j++) {
        if(d[i][k]!=inf&&d[k][j]!=inf) {
          d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
        }
      }
    }
  }
  ll ans=0;
  for(ll i=0;i<h*w;i++) {
    ll temp;
    cin >> temp;
    if(temp<0) continue;
    ans+=d[temp][1];
  }
  cout << ans << endl;
}

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

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    
    if(c%gcd(a,b)) {
        cout << "NO";
    }    
    
    else {
     cout << "YES";
    }
    
    
    }


Measured memory_bytes: 3632
#include <stdio.h>

int main() {
	int x, i, c=0;
  	scanf("%d", &x);
    for (i = 0; i < 3; i++){
 		if (x % 10 != 0){
      		c = c + 1;
      		x = (x - 1)/10;
    	}
      	else x = x/10;
    }  
  	printf("%d", c);
	return 0;
}

Measured memory_bytes: 128
package main

import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
  "math"
  "sort"
)

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt() int {
  n, _ := strconv.Atoi(NextLine())
  return n
}
func NextFloatVec() []float64 {
  L := strings.Split(NextLine(), " ")
  N := make([]float64, len(L))
  for i := range N {
    N[i], _ = strconv.ParseFloat(L[i], 64)
  }
  return N
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func Output() {
  _ = writer.Flush()
}

func MaxFloat(x, y float64) float64 {
  if x < y { return y }
  return x
}
func Dist02(A *[]float64) float64 {
  x, y := (*A)[0], (*A)[1]
  return x * x + y * y
}
func InnerProduct(A, B *[]float64) float64 {
  return (*A)[0] * (*B)[0] + (*A)[1] * (*B)[1]
}
func Angle(A, B *[]float64) float64 {
  acos := math.Acos(InnerProduct(A, B) / math.Sqrt(Dist02(A)) / math.Sqrt(Dist02(B)))
  return acos / math.Pi * 180.0
}

type Engines [][]float64
func (E Engines) Len() int { return len(E) }
func (E Engines) Less(i, j int) bool { return E[i][2] < E[j][2] }
func (E Engines) Swap(i, j int) { E[i], E[j] = E[j], E[i] }

func main() {
  N := NextInt()
  E := make([][]float64, 0)
  X := []float64{1.0, 0.0}
  for i := 0; i < N; i++ {
    XY := NextFloatVec()
    if XY[0] != 0.0 || XY[1] != 0.0 {
      angle := Angle(&X, &XY)
      if XY[1] < 0 { angle = 360.0 - angle }
      XY = append(XY, angle)
      E = append(E, XY)
      if 180.0 < angle { E = append(E, []float64{0.0, 0.0, angle - 180.0}) }
      E = append(E, []float64{0.0, 0.0, angle + 180.0})
      E = append(E, []float64{XY[0], XY[1], angle + 360.0})
      E = append(E, []float64{0.0, 0.0, angle + 540.0})
    }
  }
  sort.Sort(Engines(E))
  ans := 0.0
  t := 0
  D := []float64{0.0, 0.0}
  for _, e := range E {
    if 360.0 <= e[2] { break }
    for E[t][2] - e[2] < 180.0 {
      D[0] += E[t][0]
      D[1] += E[t][1]
      t++
    }
    ans = MaxFloat(math.Sqrt(Dist02(&D)), ans)
    D[0] -= e[0]
    D[1] -= e[1]
  }
  Write(ans)
  Output()
}

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

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SIZE(a) int((a).size())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ROF(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF * 300 * 300;
const int MOD = 1e9+7;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

LL modpow(LL a, LL n) {
    LL res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}


void Main()
{
    int a,b;cin>>a>>b;

    int result = 0;
    FOR(i,a,b+1){
        string s = to_string(i);

        int n = SIZE(s);
        bool f = true;
        REP(j,n){
            if(s[j] != s[n-1-j]){
                f = false;
            }
        }
        if(f){
            result ++ ;
        }

    }

    cout<<result << endl;
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define M 1000000007
using namespace std;
ll n,t,x,y,m,q;
ll gcd(ll x,ll y)
{
	if(y==0) return x;
	else return gcd(y,x%y);
}
int main(){
      ios_base::sync_with_stdio(false); cin.tie(NULL);
      cin>>n>>x;
      cout<<(n*x)/gcd(n,x);
      
}

Measured memory_bytes: 3568
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int INF = 1e9;
int main() {
	int X, Y;
	cin >> X >> Y;
	cout << X + Y / 2 << endl;
	return 0;
}

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

#define mx 100005
#define ll long long

int ar[mx];
char ch[mx];

int n,m;

int main()
{
     map<int,int>mp;
     cin>>n;
     for(int i=1;i<n;i++)
     {
         int x;
         cin>>x;
         mp[x]++;
     }
     for(int i=1;i<=n;i++)cout<<mp[i]<<endl;

    return 0;
}


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

int main(){
    int N, M, p[10], state[10];
    vector<int> SW[10];
    cin >> N >> M;
    for(int i=0;i<M;i++){
        int k;
        cin >> k;
        for(int j=0;j<k;j++) {
            int s;
            cin >> s;
            s--;
            SW[i].push_back(s);
        }
    }
    for(int i=0;i<M;i++) cin >> p[i];
    int ans=0;
    for(int i=0;i<(1<<N);i++){
        for(int j=0;j<N;j++){
            state[j] = (i>>j&1);
        }
        for(int i=0;i<M;i++){
            int count = 0;
            for(int j=0;j<SW[i].size();j++){
                count += state[SW[i][j]];
            }
            if(count%2==p[i]) {
                if(i==M-1) ans++;
            }
            else break; 
        }
    }

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

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <complex>
using namespace std;
typedef long long LL;
void guan() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); }
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define ls (rt<<1)
#define rs (rt<<1|1)
#define F first
#define S second
#define mst(x,a) memset(x,a,sizeof(x))
#define Pr pair<LL,LL>
#define root 1,cnum,1
#define For(i,b,c) for(int i=b;i<=c;i++)
const int maxn = 400040;
const LL mod = 1e9 + 7;
const double pi = acos(-1.0);

char ss[400], tt[400];

void solve() {
    int len = strlen(ss);
    for(int i = 0;i < len;i++) {
        int ok = 1;
        for(int j = 0;j < len && ok;j++) {
            if(tt[j] != ss[j + i]) ok = 0;
        }
        ss[len + i] = ss[i];
        if(ok == 1) {
            cout << "Yes" << endl;
            return ;
        }
    }
    cout << "No" << endl;
}

int main() {
    //guan();
    int t = 1;
    while(t--) {
        while(cin >> ss >> tt)
            solve();
    }

    //cin >> t;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <set>
#include <string>
#include <utility>

using namespace std;

int main() {
  int a, b;

  cin >> a >> b;

  cout << a * b << endl;

  return 0;
}

Measured memory_bytes: 3160
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    sc.close();

    int even = N / 2;
  
    int odd = N - even;
    
    System.out.println((double)odd / N);
    
  }

}

Measured memory_bytes: 23124
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;

template<class T> void read(T &x){
	int f=0; x=0; char ch=getchar();
	for(;!isdigit(ch);ch=getchar()) f|=(ch=='-');
	for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';
	if(f) x=-x;
}

const int N=200005;
ll f[N][4],bas[N],a[N],c[N],n,m;

int main(){
	read(n);
	rep(i,1,n){
		read(a[i]);
		c[++m]=a[i]-a[i-1];
		if(c[m]==0) m--;
	}
	c[++m]=-a[n];
	if(c[m]==0) m--;
	n=m;
	rep(i,1,n){
		a[i]=a[i-1]+c[i];
	}

//	rep(i,1,n) printf("@ %d : %lld\n",i,c[i]);
/*
本来以为要利用斜率单调性，set维护DP。。
然鹅暴力DP都WA了。。
对拍才发现有一个点同时一进一出这种Case。。
那么就是O(n)的了233。。。
日常忽略Case/胡假结论QwQ

好题，好题。。maroonk orz

	assert(n<=2001);
	memset(f,0xc0,sizeof f);
	f[0][0]=0;
	rep(i,1,n){
		if(c[i]>=0){
			rep(j,0,i){
				f[i][j]=f[i-1][j];
				if(j){
					f[i][j]=max(f[i][j],f[i-1][j-1]+c[i]);
				}
			}
		}
		else if(c[i]<0){
			rep(j,0,i){
				if(f[i-1][j]>=-c[i]){
					f[i][j]=min(a[i],f[i-1][j]+c[i]);
				}
				if(j){
					f[i][j]=max(f[i][j],min(f[i-1][j-1],a[i]));
				}
			}
		}
		rep(j,2,i) if(f[i][j-2]>=0){
			f[i][j]=max(f[i][j],a[i]);
		}
		
		rep(j,0,i){
			if(f[i][j]<0) putchar('#'),putchar(' ');
			else printf("%lld ",f[i][j]);
		}
		puts("");
		
	}
	ll cur=0;
	while(f[n][cur]<0) cur++;
	cout<<cur<<endl;

	return 0;

6
4 9 20 12 10 8 

8
8 4 6 2 8 1 5 2 

*/

	memset(f,0xc0,sizeof f);
	f[0][0]=0;
	rep(i,1,n){
		bas[i]=bas[i-1];
		rep(_j,bas[i],min(i,(int)bas[i]+3)){
			int j=_j-bas[i];
			if(c[i]>0){
				f[i][j]=f[i-1][j];
				if(j){
					f[i][j]=max(f[i][j],f[i-1][j-1]+c[i]);
				}
			}
			else{
				if(f[i-1][j]>=-c[i]){
					f[i][j]=min(a[i],f[i-1][j]+c[i]);
				}
				if(j){
					f[i][j]=max(f[i][j],min(f[i-1][j-1],a[i]));
				}
			}
		}
		rep(_j,max(2,(int)bas[i]),min(i,(int)bas[i]+3)){
			int j=_j-bas[i];
			if(j>=2&&f[i][j-2]>=0){
				f[i][j]=max(f[i][j],a[i]);
			}
		}
		if(f[i][0]<0){
			bas[i]++;
			rep(j,0,2){
				f[i][j]=f[i][j+1];
			}
			f[i][3]=-1e18;
		}
	}
	cout<<bas[n]<<endl;

    return 0;
}

Measured memory_bytes: 11136
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int n,m;
	cin>>n>>m;
	vector<int> cnt={2,5,5,4,5,6,3,7,6};
	vector<int> a(m),dp(n+100,-INF);
	dp[0]=0;
	rep(i,m){
		cin>>a[i];
		a[i]--;
	}
	sort(begin(a),end(a),greater<int>());
	rep(i,n){
		for(auto now:a){
			chmax(dp[i+cnt[now]],dp[i]+1);
		}
	}
	int now=dp[n];
	int ind=n;
	string ans;
	while(now){
		for(auto num:a){
			if(ind-cnt[num]>=0 && dp[ind-cnt[num]]==now-1){
				int c=num+1;
				ans+=(char)c+'0';
				ind-=cnt[num];
				now--;
				break;
			}
		}
		//cout<<now<<' '<<ans<<' '<<ind<<endl;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cstring>
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const long double EPS = 1e-9;
const ll mod = 1e9 + 7;
const ll INF = 1e9;

#define rep(i, n) for(ll i = 0; i < n ; i++ )
#define For(i, a, b) for(ll i = (a); i < (b) ; i++ )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()


/*
0 1 1 0 0 1 1 0
1 1 0 0 1 1 0
sum {0, 1} * 2 ** k
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
*/

ll bin_A[120], bin_B[120];

int main(void){
    ll A, B;
    ll answer;
    ll cnt;

    cin >> A >> B;

    if (A == B) {cout << A << endl; return 0;}

    cnt = 0;
    while(B != 0){
        bin_A[cnt] = A % 2; A /= 2;
        bin_B[cnt] = B % 2; B /= 2;
        cnt ++;   
    }

    ll idx = (bin_B[1] * 2 - bin_A[1] * 2 + bin_B[0] - bin_A[0]) % 4; 
    if (idx < 0) idx += 4;
    
    if (bin_A[0] == 0){
        ll choices[4] = {0, 1, 1, 0};
        answer = choices[idx];
    }else{
        ll choices[4] = {1, 1, 0, 0};
        answer = choices[idx];
    }

    ll base2 = 2;
    For(i, 1, cnt){
        ll digit;
        if (bin_B[i] == bin_A[i]) 
            if(bin_A[i] != 0 && bin_B[0] == bin_A[0]) digit = 1; else digit = 0;
        else
            if(bin_B[i] == 0) digit = bin_A[0]; else digit = 1 - bin_B[0];
        answer += base2 * digit;
        base2 *= 2;
    }

    cout << answer << endl;

    return 0;
}

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

using namespace std;

const int values[6] = {100, 101, 102, 103, 104, 105};

int main(){
  int N;
  cin >> N;
  vector<vector<bool>> dp;
  vector<bool> tmp(100001, false);
  for (int i=0; i<=100000; i += 100){
    tmp[i] = true;
  }
  dp.emplace_back(tmp);
  for (int j=1; j<6; j++){
    vector<bool> tmp(100001, false);
    for (int i=0; i<=100000; i++){
      for (int k=0; k<=i / values[j]; k++){
        tmp[i] = (tmp[i] || dp[j - 1][i - k*values[j]]);
      }
      tmp[i] = (tmp[i] || (i % values[j] == 0));
    }
    dp.emplace_back(tmp);
  }
  cout << (int)dp[5][N] << endl;
  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h> 
using namespace std;
 
int main() {
  char A='0';
  char B='1';
  char C='2';
  char D='3';
  char E='4';
  char F='5';
  char G='6';
  string x,y;
  cin>>x>>y;
  if(x<y) {
    cout<<"<"<<endl;
  }
  if(x>y) {
    cout<<">"<<endl;
  }
  if(x==y) {
    cout<<"="<<endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 1000000007;
const int INF = 1001001001;

int main() {
  ll a, b, n;
  cin >> a >> b >> n;
  ll x = min(b - 1, n);

  auto f = [&] {
    return (a * x) / b - a * (x / b);
  }();
  cout << f << endl;
}

Measured memory_bytes: 3564
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define REPr(i,n) for(int i=(n)-1;i>=0; --i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define FORqr(i, m , n) for(int i = (n);i >=(m);--i)
#define SCD(n) scanf("%d",&n)
#define SCD2(m,n) scanf("%d%d",&m,&n)
#define SCD3(m,n,k) scanf("%d%d%d",&m,&n,&k)
#define SCLLD(n) scanf("%lld",&n)
#define SCLLD2(m,n) scanf("%lld%lld",&m,&n)
#define SCLLD3(m,n,k) scanf("%lld%lld%lld",&m,&n,&k)
#define PB push_back
#define MP make_pair
#define ARSCD(A,N) REP(i,N){SCD(A[i]);}
#define ARSCD1(A,N) FORq(i,1,N){SCD(A[i]);}
#define VSCD(v,N) REP(i,N){int (x); SCD(x); v.PB(x);}
#define VSCLLD(v,N) REP(i,N){long long (x); SCLLD(x); v.PB(x);}
#define PRINTD(n) printf("%d\n",n)
#define PRINTLLD(n) printf("%lld\n",n)
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define SIN(x,S) (S.count(x) != 0)
#define M0(x) memset(x,0,sizeof(x))
#define FILL(x,y) memset(x,y,sizeof(x))
#define MM(x) memset(x,-1,sizeof(x))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
typedef pair<int,int> PII;
typedef pair<long long,long long> PLL;
typedef vector<int> VI;
typedef vector < VI > VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
const ll MOD = 1000000007;
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

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 N;
    int nowH = 0;

    cin >> N;

    int ans = 0;

    REP(i,N){
        int h;
        cin >> h;
        if (nowH <= h) ans++;
        chmax(nowH,h);
    }

    cout << ans << "\n";


}


Measured memory_bytes: 256
/* Author : Aaryan Srivastava ^__^ */ 
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define pb push_back
#define popb pop_back
#define mt make_tuple 
#define eb emplace_back
#define mp make_pair
#define ff first
#define ss second 
#define ull unsigned long long  
#define pii pair<int, int>
#define piii pair<int,pii>
#define beg begin
#define rep(i,n) for(int (i) = 0 ; i < (n) ; i++)
#define repA(i,x,y) for(int i = (x) ; i <= (y) ; i++)
#define repD(i,x,y) for(int i = (x) ; i >= (y) ; i--)
#define all(c) (c).begin(),(c).end()
#define fill(a,val) memset(a,val,sizeof(a))
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define int ll
using ll = long long;
const int N = 3*1e5 +5 ;
const int mod = 1e9 + 7 ;
const int inf = 1e18 ;
const int SZ = 101 ;
const double eps = 1e-9 ;
using namespace __gnu_pbds;
using namespace std;
using ordered_set =  tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ;

#ifdef AaryanS
#define mycout cout
#define mycerr cerr 
#endif

#ifndef AaryanS
#define mycout if(false) cout
#define mycerr if(false) cerr
#endif

int pr[N*10];

void sieve(int n  = N*10LL ){
	pr[0] = pr[1] = false;
	for(int i = 2; i <= n ; ++i){
		if(!pr[i]) continue;
		for(int j = 2*i ; j <= n ; j += i)
			pr[i] = false;
	}
} 

void solve()
{
	memset(pr,true,sizeof(pr));
	int a,b;
	cin >> a >> b;
	int g = __gcd(a,b);
	int ans = 1; 
	// cout << g << " " << ans << endl ;
	int x = g; 
	for(int i = 2 ; g > 1 && i*i <= x ; ++i){
		if(g%i == 0) ans++;
		else continue ;
		while(g > 1 && g%i == 0)
			g /= i;
		// cout << g << " " << ans <<  endl ;
	}
	if(g > 1)ans++;
	cout << ans; 
}   

     
int32_t main(int32_t argc, char *argv[])
{
    double t1 = clock() ;
    ios::sync_with_stdio(0);    
    cin.tie(0); cout.tie(0);
    int TC = 1, t = 0;
    //cin >> TC ;
    while(t++ < TC)
    {
        //cout << "Case #" << t << ": " ;
        solve();
        //cout << endl ;
    }
    mycerr << "Time : " << 1000 *(clock() - t1)/CLOCKS_PER_SEC << " ms\n" ;
    return 0;
}

Measured memory_bytes: 23680
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#define ABS(a) (((a) >= 0) ? (a) : -(a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define RFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define POW_10_5 100000
#define POW_10_9 1000000000
#define MOD 1000000007
#define INF (numeric_limits<int>::max()/2)
#define int long long

typedef pair<int, int> Pair;
typedef unordered_map<int, int> Hash;

// ---
int N;
string S;


string Ans() {
  if (N%2 != 0) { return "No"; }
  if (S.substr(0, N/2) == S.substr(N/2, N/2)) {
    return "Yes";
  } else {
    return "No";
  }
}

signed main() {
  cin >> N;
  cin >> S;

  auto ans = Ans();

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


Measured memory_bytes: 256
/*
    Written by Nitrogens
    Desire for getting accepted!!
*/
#include <cstdio>
#include <ctime>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <bitset>
#include <stack>
#include <set>
#include <vector>
using namespace std;

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

const int maxn = 1e5+5;
const int Mod = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const double e = exp(1);
const db PI = acos(-1);
const db ERR = 1e-10;

#define Se second
#define Fi first
#define pb push_back
#define dbg(x) cout<<#x<<" = "<< (x)<< endl
#define dbg2(x1,x2) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<endl
#define dbg3(x1,x2,x3) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<" "<<#x3<<" = "<<x3<<endl

ll a[22][22];
ll dp[1 << 22];

int main()
{
    //ios::sync_with_stdio(false);
    //freopen("a.txt","r",stdin);
    //freopen("b.txt","w",stdout);

    int n;
    scanf("%d", &n);

    for(int i = 1; i <= n; i++)
    {
        for(int j = 1; j <= n; j++)
        {
            scanf("%lld", &a[i][j]);
        }
    }

    dp[0] = 1;
    for(int S = 0; S < (1 << n); S++)
    {
        int cnt = 0;
        int temp = S;
        while(temp)
        {
            if(temp % 2 == 1)
                ++cnt;
            temp /= 2;
        }
        for(int i = 1; i <= n; i++)
        {
            if(S & (1 << (i - 1)))
                continue;
            dp[S + (1 << (i - 1))] = (dp[S + (1 << (i - 1))] + dp[S] * a[cnt + 1][i]) % Mod;
        }
    }
    printf("%lld\n", dp[(1 << n) - 1] % Mod);

    //cout << "time: " << (long long)clock() * 1000 / CLOCKS_PER_SEC << " ms" << endl;
    return 0;
}


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

using namespace std;

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

#define X first
#define Y second

const int MAXN = 200010;

int n, m;
struct node
{
	int x, y;
	int id;
}p[MAXN], e[MAXN];

int F[MAXN];

int father(int x)
{
	return (F[x] == x) ? x : F[x] = father(F[x]);
}

int main()
{
	
	scanf("%d", &n);
	for (int i = 1; i <= n; ++ i)
	{
		scanf("%d%d", &p[i].x, &p[i].y);
		p[i].id = i;
	}
	sort(p+1, p+n+1, [](const node &a, const node &b){return a.x<b.x;});
	for (int i = 1; i < n; ++ i)
		e[++ m] = node{p[i].id, p[i+1].id, p[i+1].x-p[i].x};
	sort(p+1, p+n+1, [](const node &a, const node &b){return a.y<b.y;});
	for (int i = 1; i < n; ++ i)
		e[++ m] = node{p[i].id, p[i+1].id, p[i+1].y-p[i].y};
	
	for (int i = 1; i <= n; ++ i)
		F[i] = i;
	sort(e+1, e+m+1, [](const node &a, const node &b){return a.id<b.id;});
	int ans = 0;
	for (int i = 1; i <= m; ++ i)
	{
		int x = e[i].x, y = e[i].y, w = e[i].id;
		int fx = father(x), fy = father(y);
		if (fx == fy) continue;
		ans += w;
		F[fx] = fy;
	}
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 4224
r, g, b, n = map(int, input().split())
count = 0

for a in range(n+1):
  for c in range(n+1):
    Bb = n - r*a - g*c
    if Bb >= 0:
      if Bb % b == 0:
        count += 1
    else:
      break

print(count)

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
typedef std::pair<int, int> ipair;
#define int long long
#define pb push_back
#define ff first
#define INF INT_MAX
#define ss second
#define fr(i, j, a) for (int i = j; i < a; i++)
#define cnt_ones(x) __builtin_popcount(x)
#define all(x) x.begin(), x.end()
#define sz size()
#define endl "\n"
#define vi vector<int>
#define vvi vector<vector<int>>
#define vp vector<ipair>
#define mod 1000000007
#define IOS                                                                    \
  std::ios::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
void init() {
  int n, k;
  cin >> n >> k;
  vi a(n);
  int cnt = 0;
  cout << 1 + (n - 2) / (k - 1) << endl;
}
int32_t main() {
  IOS;
  init();
  return 0;
}


Measured memory_bytes: 3964
#include <bits/stdc++.h>
#define R register
#define mp make_pair
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
using namespace std;
const int mod = 998244353, N = 210000;

int n, m, k;
ll fac[N], inv[N];

inline int addMod(int a, int b) {
	return (a += b) >= mod ? a - mod : a;
}

inline ll quickpow(ll base, ll pw) {
	ll ret = 1;
	while (pw) {
		if (pw & 1) ret = ret * base % mod;
		base = base * base % mod, pw >>= 1;
	}
	return ret;
}

inline void initComb(int n) {
	fac[0] = 1;
	for (R int i = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % mod;
	inv[n] = quickpow(fac[n], mod - 2);
	for (R int i = n; i; --i) inv[i - 1] = inv[i] * i % mod;
	return;
}

template <class T>
inline void read(T &x) {
	x = 0;
	char ch = getchar(), w = 0;
	while (!isdigit(ch)) w = (ch == '-'), ch = getchar();
	while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
	x = w ? -x : x;
	return;
}

inline ll comb(int n, int m) {
	if (n < m || m < 0) return 0;
	return fac[n] * inv[m] % mod * inv[n - m] % mod;
}

int main() {
	read(n), read(m), read(k);
	initComb(n);
	ll ans = 0;
	for (R int i = 0; i <= k; ++i)
		ans = (ans + comb(n - 1, i) * m % mod * quickpow(m - 1, n - 1 - i)) % mod;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 6700
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#include <unistd.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

typedef long long cat;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

int ops[25000];
int cnt_ops =0;

void move(int cur, vector<int> &P, vector<int> &par) {
//	assert(cnt_ops < 25000);
	ops[cnt_ops++] =cur;
	int v =cur, tmp =P[0];
	while(true) {
		swap(P[v], tmp);
		if(v == 0) break;
		v =par[v];
	}
}

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	int N;
	cin >> N;
	vector<int> P(N), par(N, 0), D(N, 0);
	vector< vector<int> > G(N);
	for(int i =1; i < N; i++) {
		cin >> par[i];
		G[par[i]].push_back(i);
		D[par[i]]++;
	}
	for(int i =0; i < N; i++) cin >> P[i];

	vector<bool> bl(N, false);
	while(!bl[0]) {
		vector<int> in_path(N, -1), in_path_id(N, -1);
		vector< vector< pair<int, int> > > paths;
		for(int i =N-1; i >= 0; i--) if(!bl[i] && D[i] == 0) {
			vector< pair<int, int> > path;
			int v =i;
			while(D[v] <= 1) {
				in_path[v] =paths.size();
				path.push_back(make_pair(v, -1));
				if(v == 0) break;
				v =par[v];
			}
			reverse(begin(path), end(path));
			for(int j =0; j < (int)path.size(); j++) in_path_id[path[j].ff] =j;
			paths.push_back(path);
		}

		int cur =N-1;
		while(true) {
//			for(int i =0; i < N; i++) cerr << P[i] << " "; cerr << "\n";
			int v =P[0];
			if(in_path[v] != -1) {
				int p =in_path[v], x =(int)paths[in_path[v]].size()-1;
				while(paths[p][x].ss > v) x--;
				for(int i =1; i <= x; i++) paths[p][i-1].ss =paths[p][i].ss;
				paths[p][x].ss =v;
				move(paths[p][x].ff, P, par);
			}
			while(cur >= 0) {
				if(bl[cur]) cur--;
				else if(in_path[cur] != -1 && paths[in_path[cur]][in_path_id[cur]].ss != -1) cur--;
				else break;
			}
			if(cur < 0) break;
			if(in_path[v] == -1) {
				move(cur, P, par);
				cur--;
			}
		}
//		for(int i =0; i < N; i++) cerr << P[i] << " "; cerr << ".\n";

		for(int i =0; i < N; i++) if(in_path[i] != -1) {
			bl[i] =true;
			D[par[i]]--;
		}
	}

	cout << cnt_ops << "\n";
	for(int i =0; i < cnt_ops; i++) cout << ops[i] << "\n";
	return 0;}

// look at my code
// my code is amazing


Measured memory_bytes: 640
N,M = map(int,input().split())
info = [list(map(int,input().split())) for i in range(M)]
nodes = [i for i in range(N)]
rank = [0]*N
diff_weight = [0]*N

def root(x):
    if nodes[x] == x:
        return x
    root_x = root(nodes[x])
    diff_weight[x] += diff_weight[nodes[x]]
    nodes[x] = root_x
    return root_x

def weight(x):
    root(x)
    return diff_weight[x]

def unite(x,y,w):
    w += weight(x); w -= weight(y)
    x = root(x); y = root(y)
    if x == y:
        return
    if rank[x] >= rank[y]:
        nodes[y] = x
        diff_weight[y] = w
        if rank[x] == rank[y]:
            rank[x] += 1
    else:
        nodes[x] = y
        diff_weight[x] = -w

def same(x,y):
    return root(x) == root(y)

def diff(x,y):
    return weight(y) - weight(x)

ans = "Yes"

for L,R,D in info:
    L -= 1; R -= 1
    unite(L,R,D)
    if diff(L,R) != D:
        ans = "No"
        break
print(ans)

Measured memory_bytes: 59008
#include <stdio.h>

int main(void) {
	int n,x;
	int a,b,c,i;
	while(1){
		scanf("%d %d",&n,&x);
		if(n==0 && x==0){
			break;
		}
		i=0;
		for(a=1;a<=n;a++){
			for(b=1;b<=n;b++){
				for(c=1;c<=n;c++){
					if((a==b || b==c || a==c) != 1){
						if(a+b+c==x){
							i++;
							//printf("%d+%d+%d=9\n",a,b,c);
						}
					}
				}
			}
		}
		printf("%d\n",i/6);
	}
	return 0;
}


Measured memory_bytes: 2052
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,s,g;
  while(cin>>n>>m,n||m){
    cin>>s>>g;
    s--;g--;
    int d[n][n],c[n][n];
    memset(d,-1,sizeof(d));
    memset(c,-1,sizeof(c));
    int i,j,k,l,x,y;
    for(i=0;i<m;i++){
      cin>>x>>y>>j>>k;
      x--;y--;
      d[x][y]=d[y][x]=j;
      c[x][y]=c[y][x]=k;
    }
    double v[n][50][n];
    double inf=1<<28,p,ans=inf;
    for(i=0;i<n;i++) for(j=0;j<50;j++) for(k=0;k<n;k++) v[i][j][k]=inf;
    typedef pair<int,int> PPP;
    typedef pair<int,PPP> P;
    typedef pair<double,P> PP;
    priority_queue<PP,vector<PP>,greater<PP> > q;
    q.push(PP(0,P(s,PPP(1,-1))));
    while(!q.empty()){
      x=q.top().second.first;
      y=q.top().second.second.first;
      k=q.top().second.second.second;
      p=q.top().first;q.pop();
      if(v[x][y][k]<=p) continue;
      v[x][y][k]=p;
      if(x==g&&y==1) break;
      for(i=0;i<n;i++){
	if(!~d[x][i]||i==k) continue;
	for(j=-1;j<=1;j++){
	  if(k==-1&&j!=0) continue;
	  if(y+j<=0||c[x][i]<y+j) continue;
	  q.push(PP(p+(double)d[x][i]/(y+j),P(i,PPP(y+j,x))));
	}
      }
    }
    for(i=0;i<n;i++) ans=min(ans,v[g][1][i]);
    if(ans!=inf) printf("%.8f\n",ans);
    else printf("unreachable\n");
  }
  return 0;
}

Measured memory_bytes: 22172
/*
#include<cstdio>
#include<cmath>
using namespace std;

#define pi 3.141592653589793

void koch(double x1, double y1, double x2, double y2, int n) {
    if (n == 0) {
        printf("%.8f %.8f\n", x1, y1);
    }
    else {
        double sx, sy, tx, ty, ux, uy;
        sx = x1 + (x2 - x1) / 3;
        sy = y1 + (y2 - y1) / 3;
        tx = x2 - (x2 - x1) / 3;
        ty = y2 - (y2 - y1) / 3;
        ux = (tx - sx)*cos(pi / 3) - (ty - sy)*sin(pi / 3) + sx;
        uy = (tx - sx)*sin(pi / 3) + (ty - sy)*cos(pi / 3) + sy;
        koch(x1, y1, sx, sy, n-1);
        koch(sx, sy, ux, uy, n-1);
        koch(ux, uy, tx, ty, n-1);
        koch(tx, ty, x2, y2, n-1);
    }
    return;
}

int main() {
    int n;
    scanf("%d", &n);
    koch(0.0, 0.0, 100.0, 0.0, n);
    printf("100.00000000 0.00000000\n");
    return 0;
}
*/

#include<stdio.h>
#include<math.h>

struct Point {double x, y;};

void koch(int n, Point a, Point b) {
    if (n == 0) return;
    Point s, t, u;
    double th = M_PI * 60.0 / 180.0;    // 度からラジアンへの単位を変換

    s.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
    s.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
    t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
    t.y = (1.0 * a.y + 2.0 * b.y) / 3.0;
    u.x = (t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
    u.y = (t.x - s.x) * sin(th) + (t.y - s.y) * cos(th) + s.y;

    koch(n - 1, a, s);
    printf("%.8f %.8f\n", s.x, s.y);
    koch(n - 1, s, u);
    printf("%.8f %.8f\n", u.x, u.y);
    koch(n - 1, u, t);
    printf("%.8f %.8f\n", t.x, t.y);
    koch(n - 1, t, b);
}

int main() {
    Point a, b;
    int n;

    scanf("%d", &n);

    a.x = 0;
    a.y = 0;
    b.x = 100;
    b.y = 0;

    printf("%.8f %.8f\n", a.x, a.y);
    koch(n, a, b);
    printf("%.8f %.8f\n", b.x, b.y);

    return 0;
}


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

int main(){
    double W,H;
    cin >> W >> H;
    double x,y;
    cin >> x >> y;
    cout << W*H/2 << endl;
    if(W/2 == x && H/2 == y) cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
}

Measured memory_bytes: 256
#include<algorithm>
#include<cstdio>


using namespace std ;


int sports[ 1000 + 1 ] ;

int cnt[ 1000 + 1 ] ;
int CNT[ 1000 + 1 ] ;

int cmp ;

int N ,M ;


int ans()
{
	sort( cnt + 1 ,cnt + N + 1 ) ;

	return ( find_if( CNT ,CNT + N + 1 ,[]( int cmpair ){ return cmpair == cnt[ N ] ; } ) - CNT ) ;
}



int main( void )
{
	scanf( "%d %d" ,&N ,&M ) ;

	int i ;
	for( i = 1 ; i <= N ; ++i )
	{
		scanf( "%d" ,&cmp ) ;

		sports[ i ] = cmp ;
	}

	for( i = 0 ; i < M ; ++i )
	{
		scanf( "%d" ,&cmp ) ;

		++cnt[ ( find_if( sports + 1 ,sports + N + 1 ,[]( int cmpair){ return cmp >= cmpair ; } ) - sports ) ] ;
	}


	copy( cnt ,cnt + N + 1 ,CNT ) ;


	printf( "%d\n" ,ans() ) ;


	return 0 ;
}

Measured memory_bytes: 2776
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll,ll> > P;
int main()
{
  ll n;
  cin>>n;
  vector<int> c(n+1),s(n+1),f(n+1);
  for(int i=1;i<n;i++) cin>>c.at(i)>>s.at(i)>>f.at(i);

  for(int i=1;i<n;i++)
  {
    ll time=0;
    for(int j=i;j<n;j++)
    {
      if(time<=s.at(j)) time=s.at(j)+c.at(j);
      else
      {
        if((time-s.at(j))%f.at(j)==0) time+=c.at(j);
        else  time+=(f.at(j)-(time%f.at(j))+c.at(j));
      }
    }
    cout<<time<<endl;
  }

  cout<<0<<endl;
}

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

using namespace std;

int main(void) {
    int cnt=0,ans=0,max=0;
    string S;
    cin>>S;

    for (int i=0;i<4;i++){
      if(S[i]=='+'){
        cnt++;
      }else{
        cnt--;
      }
    }
    cout<<cnt<<endl;

    return 0;
}


Measured memory_bytes: 256
s = input()

cnt = 0
max_cnt = 0

for i in range(len(s)):
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        cnt += 1
    else:
        cnt = 0
    if max_cnt < cnt:
        max_cnt = cnt

print(max_cnt)


Measured memory_bytes: 2940
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    S = input().rstrip('\n')

    if S == "RRR":
        print(3)
    elif S == "RRS" or S == "SRR":
        print(2)
    elif S == "SSS":
        print(0)
    else:
        print(1)


if __name__ == '__main__':
    main()


Measured memory_bytes: 62116
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int x[1000];
int main(){
int n;
cin>>n;
int sum=0;
for(int i=0;i<n;i++)
    cin>>x[i];
for(int i=0;i<n-1;i++)
{
    if(x[i]==x[i+1])
    {
        sum++;
        i++;
    }
}
cout<<sum;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>

using namespace std;

int times(int n)
{
    int cnt=0;
    while(n%2==0)
    {
        cnt++;
        n=n/2;
    }
    return cnt;
}
int main()
{
    int N;
    cin >> N;
    int a[300];
    for(int i=0;i<N;i++)
        cin >> a[i];
    int min=times(a[0]);
    for(int i=1;i<N;i++)
    {
        int sum=times(a[i]);
        if(sum<min)
            min=sum;
    }
    cout << min << endl;
    return 0;
}


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

using ll=long long;
const ll MOD=1000000007;

int main() {
  int a,b;
  cin >> a >> b;
  int ans=0;
  int z=1;
  while(z<b){
    ans++;
    z+=(a-1);
  }
  cout << ans << endl;
}

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

const int MAXL = 5 + 10000;
const int MAXD = 5 + 100;
const int MOD = 1000000000 + 7;

string K;
int memo[MAXL][MAXD][2];
int D;

int dp(int i, int s, bool f) {
    if(i == (int)K.size()) {
        return (s == 0);
    }
    int& ans = memo[i][s][f];
    if(ans == -1) {
        ans = 0;
        if(f) {
            for(char c = '0'; c <= '9'; ++c) {
                ans = (ans + dp(1 + i, (s + (c - '0')) % D, f)) % MOD;
            }
        } else {
            for(char c = '0'; c <= K[i]; ++c) {
                ans = (ans + dp(1 + i, (s + (c - '0')) % D, (c != K[i]))) % MOD;
            }
        }
    }
    return ans;
}


int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    cin >> K >> D;
    memset(memo, -1, sizeof memo);
    cout << (dp(0,0,0) - 1 + MOD) % MOD << '\n';
    return 0;
}


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

typedef long long ll;
using namespace std;

struct UnionFind {
    vector<int> parent;

    UnionFind(int n) : parent(n) {
        parent = vector<int>(n);
        for (int i = 0; i < n; i++) parent[i] = i;
    }

    int root(int n) {
        if (parent[n] == n) return n;
        return parent[n] = root(parent[n]);
    }

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        parent[rx] = ry;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m; cin >> n >> m;
    int p[n];
    UnionFind uni(n);
    for (int i = 0; i < n; i++) {
        cin >> p[i];
        p[i]--;
    }
    for (int i = 0; i < m; i++) {
        int x, y; cin >> x >> y;
        x--;
        y--;
        uni.unite(x, y);
    }
    int ans = 0;
    for (int i = 0; i < n; i++) if (uni.root(p[i]) == uni.root(i)) ans++;
    cout << ans << endl;
    return 0;
}


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


def solve(N: int, A: int, B: int):
    if A == 0:
        print(0)
        return

    ans = N // (A + B) * A
    ans += min(A, N % (A + B))
    print(ans)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(N, A, B)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3064
#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)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;

int N;
ll P;
vector<ll> L,R;

int main(){
  cin>>N>>P;
  L.resize(N);
  R.resize(N);
  for(int i=0;i<N;i++) cin>>L[i]>>R[i];

  for(int i=0;i<N;i++) R[i]--;
  P--;

  vector<pair<ll,int>> l;
  for(int i=0;i<N;i++) l.push_back(mkp(L[i],i));
  sort(l.begin(),l.end());

  ll now=0;
  int pos=0;
  vector<ll> lef;
  while(now<=P){
    ll ma=now;
    while(pos<N&&l[pos].first<=now){
      int tar=l[pos].second;
      ma=max(ma,R[tar]);
      pos++;
    }
    lef.push_back(ma);
    now=ma+1;
  }

  vector<ll> v;
  for(int i=0;i<N;i++){
      v.push_back(L[i]);
      v.push_back(R[i]+1);
  }
  sort(v.begin(),v.end());
  v.erase(unique(v.begin(),v.end()),v.end());

  map<ll,int> mp;
  for(int i=0;i<v.size();i++) mp[v[i]]=i+1;

  vector<int> imos((int)v.size()+1,0);
  for(int i=0;i<N;i++){
      imos[mp[L[i]]]++;
      imos[mp[R[i]+1]]--;
  }
  for(int i=1;i<=v.size();i++) imos[i]+=imos[i-1];

  int x=lef.size();
  int y=N;
  for(int i=1;i<v.size();i++) y=min(y,imos[i]);

  cout<<x<<" "<<N-y+1<<endl;

  return 0;
}



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

#define REP(i,n) for(int i=0;i< (n);i++)
#define REPR(i, n) for(int i = (n);i >= 0;i--)
#define FOR(i, m, n) for(int i = (m);i < (n);i++)
#define FORR(i, m, n) for(int i = (m);i >= (n);i--)
#define SORT(v, n) std::sort(v, v+n);
#define VSORT(v) std::sort(v.begin(), v.end());
#define VRSORT(v) std::sort(v.rbegin(), v.rend());
#define ll long long
#define pb(a) push_back(a)
#define ALL(obj) (obj).begin(),(obj).end()

using namespace std;

const int INF = 99999999;
const ll LINF = 9999999999999;

typedef pair<int, int> P;
typedef pair<ll, ll> LP;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };


ll N,t[100000],x[100000],y[100000], tdiff[100000], xdiff[100000], ydiff[100000];
int main() {
	cin >> N;
	REP(i,N) {
		cin >> t[i] >> x[i] >> y[i];
	}

	tdiff[0] = t[0];
	xdiff[0] = x[0];
	ydiff[0] = y[0];

	for (int i = 1; i < N; i++) {
		tdiff[i] = t[i] - t[i - 1];
		xdiff[i] = abs(x[i] - x[i - 1]);
		ydiff[i] = abs(y[i] - y[i - 1]);
	}

	string answer = "Yes";
	REP(i, N) {
		if (xdiff[i] + ydiff[i] > tdiff[i] || (tdiff[i] - (xdiff[i] + ydiff[i])) % 2 == 1) answer = "No";
	}

	cout << answer << endl;

	return 0;
}

Measured memory_bytes: 8268
#include<iostream>
using namespace std;
int main(){
  int n,maxx=0,x=0;
  string s;
  cin >> n >> s;
  for (int i=0;i<n;i++){
    if(s[i]=='I'){
      x++;
      if(maxx < x){
        maxx = x;
      }
    }else{
      x--;
    }
  }
  cout << maxx;
}


Measured memory_bytes: 256
//Problem C
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int n;
ll a[100005],s;
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%lld",&a[i]);sort(a+1,a+n+1);
    for(int i=1;i<=n;i++)a[i]+=a[i-1];
    ll S=a[n],T1=a[n>>1],T2=a[(n>>1)+1];
    if(n&1)s=max((S-T2-T2)*2+a[(n>>1)+1]-a[(n>>1)-1],(S-T1-T1)*2-a[(n>>1)+2]+a[n>>1]);
    else s=(S-T1-T1)*2+a[n>>1]*2-a[(n>>1)-1]-a[(n>>1)+1];
    printf("%lld",s);
    return 0;
}

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

using namespace std;

#define INF 1000007
#define MOD 1000000007
#define int long long int
#define maxn 100
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)

int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}

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

int mpow(int N, int P, int M) //繰り返し自乗法
{
    if (P == 0)
        return 1;
    if (P % 2 == 0)
    {
        int t = mpow(N, P / 2, M);
        return t * t % M;
    }
    return N * mpow(N, P - 1, M) % M;
}

int counter(int x) //bit計算
{
    if (x == 0)
        return 0;
    return counter(x >> 1) + (x & 1);
}

vector<bool> prime(maxn + 1, true); //素数テーブル
void prime_table(void)
{
    prime[0] = false;
    prime[1] = false;
    for (int i = 2; i * i <= maxn; i++)
    {
        if (!prime[i])
        {
            continue;
        }
        for (int j = i + i; j <= maxn; j += j + i)
        {
            prime[j] = false;
        }
    }
}

bool IsPrime(int num) //素数判定
{
    if (num < 2)
        return false;
    else if (num == 2)
        return true;
    else if (num % 2 == 0)
        return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }

    return true;
}
vector<int> divisor(int n) //約数列挙
{
    vector<int> ret;
    for (int i = 1; i * i <= n; i++)
    {
        if (n % i == 0)
        {
            ret.push_back(i - 1);
            if (i * i != n)
            {
                ret.push_back((n / i) - 1);
            }
        }
    }
    sort(ret.begin(), ret.end());
    return (ret);
}
int max_n = 2001;
signed main()
{
    int N, X, Y;
    cin >> N >> X >> Y;
    X--;
    Y--;
    vector<int> G(max_n);

    for (int i = 0; i < N; i++)
    {
        for (int j = i + 1; j < N; j++)
        {
            int m = min({abs(j - i), abs(X - i) + 1 + abs(j - Y), abs(Y - i) + 1 + abs(j - X)});
            G[m]++;
        }
    }
    rep(i, N - 1)
    {
        cout << G[i + 1] << endl;
    }
}


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

using namespace std;

#define ll long long int

int arr[26];

int main() {

	string s; cin >> s;

	for(auto &e : s)arr[e-'a']++;

	for(int i = 0; i < 26; i++) {
		if(arr[i] % 2 == 1) {
			cout << "No\n";
			return 0;
		}
	}

	cout << "Yes\n";

	return 0;
}

Measured memory_bytes: 256