akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(condition) if(condition){cout << "POSSIBLE" << endl;}else{cout << "IMPOSSIBLE" << endl;}
#define Possible(condition) if(condition){cout << "Possible" << endl;}else{cout << "Impossible" << endl;}
#define possible(condition) if(condition){cout << "possible" << endl;}else{cout << "impossible" << endl;}
#define Size(n) (n).size()

typedef long long ll;


using namespace std;

const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;


long long int n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl=false;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

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

      
      cin>>s;
      map<ll,ll> mp;
      if(s[0]!='A'){
        Cout("WA");
        return 0;
      }
      fl=false;
      rrep(i,2,Size(s)-1){
       if(s[i]=='C'){
         fl=true;
         mp[i]++;
         cnt++;
         if(cnt>=2){
           Cout("WA");
           return 0;
         }
       }
      }
      if(!fl){
        Cout("WA");
        return 0;
      }
      rrep(i,1,Size(s)){
        if(mp[i]==0){
          for(char c='A';c<='Z';c++){
            if(s[i]==c){
              Cout("WA");
              return 0;
            }
          }
        }
      }
      Cout("AC");
     

       
return 0;
}


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

#define sz(x) (int)x.size()
#define ld long double
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define s second

using namespace std;

const int INF = 1e8;

ll res = 0, rem = 0, oc = 0;
string s, nxt = "";
//before parity, after parity
int b0 = 0;
vector<int> ap(2, 0);
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> s;
    string t = "", tr = "";
    for(int i = 0;  i < sz(s); ++i){
        if(s[i] == '0'){
            tr += '0';
            continue;
        }
        while(i < sz(s) && s[i] == '1') t += '1', i++;
        if(sz(t)%2) tr += '1';
        oc += sz(t)/2 * 2;
        t = "";
        i--;
    }
    s = tr;
    // cout << s << " " << oc << "\n";
    //add for every one of even position (ap.f)
    for(int i = 0; i < sz(s); ++i){
        if(s[i] == '1'){
            ap[0] += i%2 == 0;
            ap[1] += i%2 == 1;
        }
    }
    for(int i = 0; i < sz(s); ++i){
        if(!sz(t) && s[i] == '0'){
            if(i%2) res += ap[1];
            else res += ap[0];
            res += oc/2;
        }
        else t += s[i];
    }
    // s is s without beginning 0s
    s = t;
    ap[0] = ap[1] = 0;
    for(int i = 0; i < sz(s); ++i){
        if(s[i] == '1'){
            ap[0] += i%2 == 0;
            ap[1] += i%2 == 1;
        }
    }
    // cout << ap[0] << " " << ap[1] << "\n";
    for(int i = 0; i < sz(s); ++i){
        // cout << s[i] << " " << res << "\n";
        if(s[i] == '0'){
            if(i + 1 < sz(s)){
                if(s[i + 1] == '0'){
                    int ppos = (i - rem + INF)%2;
                    if(ppos != i%2) res += ap[1];
                    else res += ap[0];
                    res += b0 + oc/2;
                    rem++;
                }
                else nxt += '0';
            }
            else{
                nxt += '0';
                continue;
            }
        }
        else{
            nxt += '1';
            if(sz(nxt)%2 == 1) b0++;
            if(i%2) ap[1]--;
            else ap[0]--;
        }
    }
    // cout << nxt << " " << res << "\n";
    b0 = ap[0] = ap[1] = rem = 0;
    for(int i = 0; i < sz(nxt); ++i){
        if(nxt[i] == '1' && i%2 == 0) b0++;
    }
    string rr = "";
    for(int i = sz(nxt) - 1; i >= 0; --i){
        if(nxt[i] == '0'){
            res += b0;
            if(i%2) res += (sz(rr) + 1)/2;
            else res += sz(rr)/2;
            res += oc/2;
        }
        else{
            rr += '1';
            if(i%2 == 0) b0--;         
        }
        // cout << nxt[i] << " " << res << "\n";
    }
    oc += sz(rr);
    // cout << res << " " << rr << "\n";
    if(oc%2) res += (oc/2 + 1), oc--;
    res += ((oc/2) * (oc/2 + 1));
    cout << res;
    return 0;
}

Measured memory_bytes: 4264
import math
import sys
n=int(input())
ans=[]
syo=n
if n==0:
    print(0)
    sys.exit(0)
while syo!=0:
    zan=syo%-2
    if zan==-1:
        zan=1
    ans.insert(0,zan)
    syo=math.ceil(syo/-2)
for i in range(len(ans)):
    print(ans[i],end="")

Measured memory_bytes: 3064
use std::io;

fn main() {
    let (a, b) = input();
    let d = a / b;
    let r = a % b;
    let f = a as f64 / b as f64;

    println!("{} {} {}", d, r, f);
}

fn input() -> (i32, i32) {
    let mut s = String::new();
    io::stdin().read_line(&mut s).expect("");
    let mut iter = s.trim().split_whitespace();

    let a: i32 = iter.next().unwrap().parse().unwrap();
    let b: i32 = iter.next().unwrap().parse().unwrap();

    (a, b)
}



Measured memory_bytes: 5048
#include <stdio.h>
#include <iostream>
#include <string.h>


using namespace std;

int main() {
int kazu;
char rin[21];
scanf("%s",rin);
	
	kazu = strlen(rin);
	
	for(int i = kazu-1; i >= 0; i--) {
	 cout << rin[i];
	}
	
	cout << "\n";
	
    return 0;
}

Measured memory_bytes: 1112
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

int n;
VI v,ret;
int main() {
	scanf("%d",&n);
	rep(i,1,30000) if (i%30==0) v.pb(i);
	int s=0;
	ret.pb(2); ret.pb(3); ret.pb(25);
	rep(i,4,30001) if (i!=25) {
		if (SZ(v)+SZ(ret)>=n&&s%30==0) {
			rep(j,0,SZ(v)) if (SZ(ret)<n) ret.pb(v[j]);
			break;
		}
		if ((i%2==0||i%3==0||i%5==0)&(i%30!=0)) {
			ret.pb(i);
			s=(s+i)%30;
		}
	}
	assert(SZ(ret)==n&&s%30==0);
	for (auto p:ret) printf("%d ",p); puts("");
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const ll MOD = 1000000007;
const ll INF = 1000000000000000;
#define all(v) v.begin(), v.end()


int main(){
  ll N;
  cin >> N;
  vector<ll> f(N+1,0);
  for(ll i=1;i*i<=N;i++){
    for(ll j=1;j*j<=N;j++){
      for(ll k=1;k*k<=N;k++){
        if(i*i+j*j+k*k+i*j+j*k+k*i<=N){
          f.at(i*i+j*j+k*k+i*j+j*k+k*i)++;
        }
      }
    }
  }
  rep(i,N){
    cout << f.at(i+1) << endl;
  }
}


Measured memory_bytes: 3688
k = int(input())
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(l[k-1])

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
int dy[4]={1,0,-1,0};
int dx[4]={0,1,0,-1};
vector<vector<int>> graph;

bool sort_sec(const pair<int,int> &a,const pair<int,int> &b){
   if(a.second<b.second){
      return true;
   }
   return false;
}

void swap(int *a,int *b){
   int temp=*a;
   *a=*b;
   *b=temp;
}

int main(void){
   string S;
   cin>>S;
   long long K;
   cin>>K;
   int N=S.size();
   if(S==string(N,S[0])){
      cout<<N*K/2<<endl;
   }else{
      int ans1=0;
      for(int i=0;i<N-1;i++){
         if(S[i]==S[i+1]){
            ans1++;
            i++;
         }
      }
      int ans2=0;
      for(int i=0;i<2*N-1;i++){
         if(S[i%N]==S[(i+1)%N]){
            ans2++;
            i++;
         }
      }
      cout<<ans1+(ans2-ans1)*(K-1)<<endl;
   }
   return 0;
}


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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, x, a, ans;
  cin >> n >> x >> a;
  ans = abs(x - a);
  for (int i = 1; i < n; i++) {
    cin >> a;
    ans = __gcd(ans, abs(x - a));
  }
  cout << ans << '\n';
  return 0;
}


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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string n;
  cin >> n;
  string ans;
  for(int i = 0; i < n.size(); i++) {
    if(n[i] == '1') {
      ans += '9';
    } else {
      ans += '1';
    }
  }

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

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <climits>
#include <cmath>
#include <map>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++ )
#define repf(i,m,n) for(int (i)=m;(i)<n;(i)++)
#define all(v) (v).begin(), (v).end()
#define ll long long
#define vec(name,num) vector<ll> name((num),0);
#define op(i) cout<<(i)<<endl;
#define ip(i) cin>>(i);
#define opN cout<<"No"<<endl;
#define opY cout<<"Yes"<<endl;
#define opP cout<<"Possible"<<endl;
#define opI cout<<"Impossible"<<endl;
#define mat(name,fnum,snum); vector<vector<ll>> name((fnum),vector<ll>((snum),0));
#define debugP int debug_point; cin>>debug_point;
const ll MOD= 1e9 + 7;
template <typename T>
void putv(vector<T>& V){
	// cout << "The elements in the vector are: " << endl;
	for(auto x: V)
		cout << x << " ";
	cout << endl;
}
ll pown(ll fi,ll se){
  ll ans=1;
  rep(i,se){
    ans*=fi;
  }
  return ans;
}
template <class T>
vector<T> getv(ll n){
	vector<T> Vector_temp;
	rep(i,n){
		T input;
		cin >> input;
		Vector_temp.emplace_back(input);
	}
	return Vector_temp;
}
ll gcd(ll c,ll b){
    while(1){
        if(c%b!=0){
        ll tmp=b;
        b=c%b;
        c=tmp;
        }else{
            return b;
        }
    }
}

/* <3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3*/


int main(){
  ll n,k;
  cin>>n>>k;
  string s;
  cin>>s;
  vec(a,0);
  vec(b,0);
  ll fst=0;
  ll flag;
  if(s[0]=='0'){
    fst=0;
    flag=0;
    b.push_back(0);
  }else {
    fst=1;
    flag=1;
  }
  
  ll cnt=0;
  rep(i,s.size()){
    if(flag==0){
      if(s[i]=='1'){
        flag=1;
        a.push_back(cnt);
        cnt=1;
        if(i==(s.size()-1))b.push_back(cnt);
      }else {
        cnt++;
        if(i==(s.size()-1))a.push_back(cnt);
      }
    }else {
      if(s[i]=='0'){
        flag=0;
        b.push_back(cnt);
        cnt=1;
        if(i==(s.size()-1))a.push_back(cnt);
      }else {
        cnt++;
        if(i==(s.size()-1))b.push_back(cnt);
      }
    }
  }
 
  
  ll ansa=0;
  ll ansb=0;
  if(k>=a.size()){
    op(s.size());
    return 0;
  }
  ll A=a.size();
  ll B=b.size();
  b.push_back(0);
  b.push_back(0);
  a.push_back(0);
  a.push_back(0);
  b.push_back(0);
  b.push_back(0);
  a.push_back(0);
  a.push_back(0);
  ll Ans=0;
  rep(i,k){
    Ans+=a[i];
    Ans+=b[i];
  }
  Ans+=b[k];
  ll ANS=Ans;
  
  for(int i=0;i+k<A;i++){
    ll tmp=Ans-b[i]+b[i+k+1]-a[i]+a[i+k];
    Ans=tmp;
    ANS=max(ANS,tmp);
  }
  op(ANS);
  return 0;
}

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

int main()
{
    string a;
    ll b[1000+9]= {0},f1=0,f2=0,i,c=0;
    cin>>a;
    for(i=0; i<a.length(); i++)
    {
        b[a[i]]++;
    }
    for(i=60; i<=100; i++)
    {
        if(b[i]==2)
        {
            f1=1;
            c=i;
            break;
        }
    }
    for(i=c+1; i<=100; i++)
    {
        if(b[i]==2)
        {
            f2=1;break;


        }
    }
    if(f1==1&&f2==1)
    {
        cout<<"Yes"<<endl;
    }  else
    {
        cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int dice[105][7], tp;

void roll(int dice[], char ch){
    switch(ch){
        case 'E': tp = dice[1]; dice[1] = dice[4]; dice[4] = dice[6]; dice[6] = dice[3]; dice[3] = tp; break;
        case 'N': tp = dice[1]; dice[1] = dice[2]; dice[2] = dice[6]; dice[6] = dice[5]; dice[5] = tp; break;
        case 'S': tp = dice[1]; dice[1] = dice[5]; dice[5] = dice[6]; dice[6] = dice[2]; dice[2] = tp; break;
        case 'W': tp = dice[1]; dice[1] = dice[3]; dice[3] = dice[6]; dice[6] = dice[4]; dice[4] = tp; break;
        case 'R': tp = dice[2]; dice[2] = dice[4]; dice[4] = dice[5]; dice[5] = dice[3]; dice[3] = tp; break;
    }
}

bool issame(int dice1[], int dice2[]){
    string op("RRRRSRRRRSRRRRSRRRRSERRRRWWRRRR");
    for(int i = 0; i < op.length(); ++i){
        int j;
        roll(dice2, op[i]);
        for(j = 1; j <= 6; ++j) if(dice1[j] != dice2[j]) break;
        if(j <= 6) continue;
        return true;
    }
    return false;
}

int main(){
    int n;
    cin >> n;
    for(int i = 1; i <= n; ++i){
        for(int j = 1; j <= 6; ++j){
            cin >> dice[i][j];
        }
    }
    for(int i = 1; i <= n; ++i){
        for(int j = i + 1; j <= n; ++j){
            if(issame(dice[i], dice[j])) { cout << "No" << endl; return 0;}
        }
    }
    cout << "Yes" << endl;
    return 0;
}



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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define repr(i,a,b) for(int i=(int)(a-1);i>=b;i--)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout << #x" = " << x << endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define INF INT_MAX/3

int main(){
    cin.sync_with_stdio(false);
    int h, w;
    cin >> h >> w;
    rep(i, w + 2) cout << "#";
    cout << endl;
    rep(i, h){
        cout << "#";
        rep(j, w){
            char c;
            cin >> c;
            cout << c;
        }
        cout << "#" << endl;
    }
    rep(i, w + 2) cout << "#";
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
char str[200];
int n;
int f(int x)
{
    int ans=0;
    set<char> s1,s2;
    for(int i=0;i<=x-1;i++)
        s1.insert(str[i]);
    for(int i=x;i<n;i++)
    {
        if(!s2.count(str[i]))
         ans+=s1.count(str[i]);
         s2.insert(str[i]);
    }

    return ans;
}
int main(){

    scanf("%d%s",&n,str);
    int ans=0;
    for(int i=1;i<=n-1;i++)
      ans=max(ans,f(i));
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 256
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;
#define MOD 1000000007;
/*
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using Real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
// 有理数型
using Rat = boost::rational<Bint>;
*/


int main() {
int N,A,B,sum,all_sum=0;
cin>>N>>A>>B;
rep3(i,N){
  sum=0;
  string s=to_string(i);
  rep(j,s.size()){
    sum+=(s[j]-'0');
  }
  if((A<=sum)&&(sum<=B)){
    all_sum+=i;

  }
}
cout<<all_sum<<endl;

return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
   string s,t;
   ll count=0;
   cin>>s>>t;
   for(int i=0; i<s.size(); i++){
       if(s[i]!=t[i])
       count=count+1;
   }
   cout<<count<<endl;
   return 0;
}

Measured memory_bytes: 3856
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cassert>
#include <utility>
#include <numeric>
#include <cstring>
using namespace std;
using ll = long long;

int main(){
    int N,A,B;
    cin >> N >>A >> B;
    int d = N*A;
    if (d > B) cout << B;
    else cout <<d;


}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = sc.nextInt();
        int k = sc.nextInt();
        int r = sc.nextInt();
        int s = sc.nextInt();
        int p = sc.nextInt();
        String tStr = sc.next();

        char[] t = tStr.toCharArray();
        // System.out.println(Arrays.toString(t));

        long ans = 0;
        boolean[] hasWon = new boolean[n];
        for(int i = 0; i < n; ++i) {
            if(i < k || t[i] != t[i - k]) {
                ans += (t[i] == 'r') ? p : (t[i] == 's') ? r : s;
                hasWon[i] = true;
            } else if(hasWon[i - k]) {
                ans += 0;
                hasWon[i] = false;
            } else {
                ans += (t[i] == 'r') ? p : (t[i] == 's') ? r : s;
                hasWon[i] = true;
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 27940
x1,y1,x2,y2 = gets.split.map(&:to_i)

dx = x2 - x1
dy = y2 - y1

x3 = x2-dy
y3 = y2+dx
x4 = x3-dx
y4 = y3-dy
puts "#{x3} #{y3} #{x4} #{y4}"

Measured memory_bytes: 1788
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef double ld;
typedef complex<ld> Point;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
typedef vector<int> vec;
typedef vector<string> svec;

void solve() {
	int n; cin >> n;
	vector<int> a(n);
	rep(i, n) {
		cin >> a[i];
	}
	int ans = 0;
	rep(i, n) {
		int le = i;
		int dec = 0;
		while (i + 1 < n&&a[i] <= a[i + 1]) {
			if (a[i] == a[i + 1])dec++;
			i++;
		}
		ans = max(ans,i - le + 1 - dec);
	}
	rep(i, n) {
		int le = i;
		int dec = 0;
		while (i + 1 < n&&a[i] >= a[i + 1]) {
			if (a[i] == a[i + 1])dec++;
			i++;
		}
		ans = max(ans, i - le + 1 - dec);
	}
	cout << ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(5);
	//while (cin >> n>>h>>m>>s,n)solve();
	solve();
	//stop
	return 0;
}



Measured memory_bytes: 3344
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<string>

#define rep(i,p) for(int i=1;i<=p;i++)
#define ll long long

using namespace std;

int main(){

 ll int a,b,c;
 cin >> a >> b >> c;
 if(a+b+c>=22){
	 cout << "bust";
 }
 else{
	  cout << "win";
 }











	return 0;

}



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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)

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

struct edge {
	int to,cost;
	edge(int t,int c):to(t),cost(c) {}
};

int dx[]={1,-1,0,0},dy[]={0,0,1,-1};
int ddx[]={1,1,1,0,-1,-1,-1,0},ddy[]={1,0,-1,-1,-1,0,1,1};

ll mypow(ll x,ll n,ll m) {	//xのn乗をmで割った余り
	if(n==0) return 1;
	if(n%2==0) return mypow(x*x%m,n/2,m);
	else return x*mypow(x,n-1,m)%m;
}

//-----------------------------------------------------------------------------

string w;
int cnt[26];

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

	cin>>w;
	REP(i,w.size()) cnt[w[i]-'a']++;
	REP(i,26) {
		if(cnt[i]&1) {
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;

	return 0;
}


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

int main() {
    ll N, M; cin >> N >> M;
    string s, t; cin >> s >> t;
    ll ans = (N * M) / __gcd(N, M);
    ll x = ans / N;
    ll y = ans / M;
    ll nowx = 0;
    ll nowy = 0;
    while(nowx < M && nowy < N){
        if(s[nowy] != t[nowx]){
            cout << -1 << endl;
            return 0;
        }
        nowx += x;
        nowy += y;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3736
#include<bits/stdc++.h>
#define PI 3.141592653589793238462
using namespace std;
typedef long long ll;
typedef long double db;
int c[200005],pre[200005];
pair<int,int> p[200005],a[200005];
int find(int x){
    return (x==pre[x])?x:(pre[x]=find(pre[x]));   
}
void merge(int x,int y){
    pre[find(x)]=find(y);
}
int main(){
    int n;cin>>n;
    for(int i=1;i<=n;i++){
        cin>>p[i].first>>p[i].second;pre[i]=i;
        a[i].first=p[i].first;a[i].second=p[i].second;
    }
    sort(p+1,p+1+n);
    stack<int> s;
    for(int i=1;i<=n;i++){
        if(s.size()==0||p[i].second<s.top()){
            s.push(p[i].second);
        }
        else{
            int v=s.top();
            while(s.size()&&s.top()<p[i].second){
                merge(p[i].second,s.top());s.pop();
            }
            s.push(v);
        }
    }
    for(int i=1;i<=n;i++){
        c[find(i)]++;
    }
    for(int i=1;i<=n;i++){
        cout<<c[find(a[i].second)]<<endl;
    }
}

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

int main()
{
  int n;
  ll k;
  cin >> n >> k;
  
  vector<int> a(n);
  rep(i,n) cin >> a[i], a[i]--;
  
  vector<vector<int>> d(61, vector<int>(n));
  rep(i,n) d[0][i] = a[i];
  rep(i,60) rep(j,n)
    d[i+1][j] = d[i][d[i][j]];
  
  int p = 0;
  for(int i = 0; (1LL<<i) <= k; i++)
    if((1LL<<i)&k) 
      p = d[i][p];
  
  cout << p+1 << endl;
  
  return 0;
}

Measured memory_bytes: 52628
str_list = input().split(' ')
int_list = [int(x) for x in str_list]

K, X = int_list[0], int_list[1]

import numpy as np
x = np.arange(X-K+1, X+K)
for i in range(len(x)):
    if i < len(x)-1:
        print('%d ' % x[i], end="")
    else:
        print(x[i])


Measured memory_bytes: 12424
#include <iostream>
#include <vector>
#include <set>
#include <queue>
using namespace std;
#define rep(i, n)for(int i=0; i<n; i++)

int main(){
  int N, M;
  cin >> N >> M;
  vector<set<int> > G(N);
  int a, b;
  //グラフ作成
  rep(i, M){
    cin >> a >> b;
    G[a-1].insert(b-1);
    G[b-1].insert(a-1);
  }

  //探索済みフラグ
  bool visited[N];
  rep(i, N)
    visited[i] = false;

  int ans = 0;
  
  queue<int> q;
  rep(i, N){
    //探索済みなら飛ばす
    if(visited[i] )
      continue;

    //頂点iから始める
    q.push(i);
    visited[i] = true;

    //連結成分のサイズ
    int size_ = 1;

    while(!q.empty() ){
      //キューの先頭の頂点を探索済みにマーク
      int now = q.front();
      q.pop();

      for(auto next : G[now] ){
	//次の頂点が未探索ならキューに追加
	if(!visited[next]){
	  q.push(next);
	  visited[next] = true;
	  //連結成分の大きさを数える
	  size_++;
	}
      }
    }// while
    ans = max(ans, size_);
  }

  //解答
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 31712
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<random>
using namespace std;

int n;
int x[1000],y[1000],h[1000];
int Cx,Cy;
int H[1000];
void init()
{
    scanf("%d",&n);
    for (int i=0; i<n; ++i)
        scanf("%d %d %d",&x[i],&y[i],&h[i]);

}

void work()
{
    for (Cx=0; Cx<=100; ++Cx)
        for (Cy=0; Cy<=100; ++Cy)
        {
            int flag=1,Htmp=0,firstHFlag=0;
            for (int t=0; t<2; ++t)
            for (int i=0; i<n; ++i)
            {
                if (h[i]>0)
                {
                    int HCheck=h[i]+abs(Cx-x[i])+abs(Cy-y[i]);
                    if (firstHFlag==0)
                    {
                        firstHFlag=1;
                        Htmp=HCheck;
                    }else if(HCheck!=Htmp)
                    {
                        flag=0;
                        break;
                    }
                }else
                {
                    if (firstHFlag==1 && Htmp-abs(x[i]-Cx)-abs(y[i]-Cy)>0)
                    {
                        flag=0;
                        break;
                    }
                }
            }
            if(flag&&Htmp>=1) printf("%d %d %d\n",Cx,Cy,Htmp);
        }
}


int main()
{
    init();
    work();

    return 0;
}



Measured memory_bytes: 256
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}
#define trace1(x)			 	 cerr<<#x<<": "<<x<<endl
#define trace2(x, y)		 	 cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)		 	 cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)	 	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}


int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin >> n;
	ll a[n+1],b[n+1];
	rep(i,0,n+1) cin >> a[i];
	rep(i,0,n) cin >> b[i];
	ll ans=0;
	ll cur=0;
	b[n]=0;
	for(ll i=0; i<=n; i++){
		if(cur>=a[i]){
			ans+=a[i];
			a[i]=0;
		}
		else{
			ans+=cur;
			a[i]-=cur;
		}
		if(b[i]<=a[i]){
			ans+=b[i];
			cur=0;
		}
		else{
			ans+=a[i];
			cur=b[i]-a[i];
		}
	//trace4(cur,a[i],b[i],ans);
	}
	cout << ans;
	return 0;
}
/* The judge is never wrong! Your code is buggy
   Look for:
 * * Read the problem carefully.
 * * Don't forget to sort(), mod, ll!!!!
 * * Initial value = +/- infinity instead of zero!!!
 * * an easier and alternate approach
 * * read the problem statement carefully
 * * if concept is correct and still WA, try with a different implementation
 * * special cases (n=1?)
 * * if you have no idea just guess the appropriate well-known algorithm instead of doing nothing :/
 */


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

int n;
int x[10], y[10];
double dist(int i, int j){
  int dx = x[i]-x[j];
  int dy = y[i]-y[j];
  return pow(dx*dx+dy*dy, 0.5);
}

int main(){
  cin>>n;
  for(int i=1;i<=n;i++)cin>>x[i] >>y[i];
  double sum=0.0;
  for(int i=1;i<n;i++){
    for(int j=i+1;j<=n;j++){
      sum+=dist(i, j)*2/n;
    }
  }
  
  cout<<fixed<<setprecision(10)<<sum<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second
template<typename T> vector<T> make_vec(size_t n, T a) { return vector<T>(n, a); }
template<typename... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec(ts...))>(n, make_vec(ts...)); }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
// 多倍長
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using boost::rational;
using boost::multiprecision::cpp_int;

const double PI = acos(-1);
const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

 

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;


vector<string> split(const string &s, char delim) {
    vector<string> elems;
    string item;
    for (char ch: s) {
        if (ch == delim) {
            if (!item.empty())
                elems.push_back(item);
            item.clear();
        }
        else {
            item += ch;
        }
    }
    if (!item.empty())
        elems.push_back(item);
    return elems;
}



int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    string s;
    cin >> s;
    if(s[sz(s) - 1] == 's'){
        s += "es";
        print(s);
    } else {
        s += 's';
        print(s);
    }
    


}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,A = 0,B = 0;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  sort(a.begin(),a.end(),greater<int>());
  for(int i=0;i<n;i++){
    if(i % 2 == 0){
      A += a[i];
    }else{
      B += a[i];
    }
  }
  cout << A - B << endl;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
    int w,h,x,y;
    int judge = 0;
    cin >> w >> h;
    cin >> x >> y;
    cout << (float)((float)w*(float)h/2.0) << ' ';
    if((float)w/2.0 == x && (float)h/2.0 == y) judge = 1;
    cout << judge << endl;
}

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

const int MAXN = 100005;

struct Edge;
struct Node {
    Edge *e;
    int deg, f;
} N[MAXN];

struct Edge {
    Node *u, *v;
    Edge *next;
    
    Edge() {}
    Edge(Node *u, Node *v) : u(u), v(v), next(u->e) {}
} _pool[MAXN], *_curr = _pool;

void addEdge(int u, int v) {
    N[u].e = new (_curr++) Edge(&N[u], &N[v]);
    ++N[v].deg;
}

void topo(int n) {
    static std::queue<Node *> q;
    for (int i = 1; i <= n; i++) if (!N[i].deg) q.push(&N[i]);

    while (!q.empty()) {
        Node *u = q.front();
        q.pop();

        for (Edge *e = u->e; e; e = e->next) {
            e->v->f = std::max(e->v->f, u->f + 1);
            if (!(--e->v->deg)) q.push(e->v);
        }
    }
}

int main() {
    int n, m;
    scanf("%d %d", &n, &m);
    for (int i = 0, u, v; i < m; i++) {
        scanf("%d %d", &u, &v);
        addEdge(u, v);
    }

    topo(n);

    int ans = 0;
    for (int i = 1; i <= n; i++) ans = std::max(ans, N[i].f);
    printf("%d\n", ans);
    
    return 0;
}

Measured memory_bytes: 4480
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>
#include <iomanip>




#define rep(p,q) for(int i = p;i < q;i++)
#define ll long long

using namespace std;

const int cons = 1e9 + 7;

int main(void) {
	string s;
	cin >> s;
	int ansB = 0, ansW = 0;
	char bNow = '0', wNow = '1';
	rep(0, s.size()) {
		if (bNow != s[i]) ansB++;
		if (bNow == '0')bNow = '1';
		else bNow = '0';
	}
	rep(0, s.size()) {
		if (wNow != s[i]) ansW++;
		if (wNow == '0')wNow = '1';
		else wNow = '0';
	}
	cout << min(ansB, ansW) << endl;
}

Measured memory_bytes: 512
s = gets.chomp

a = 0
b = 0
for i in 0...s.length do
    if s[i].to_i != (i % 2)    
        a = a + 1
    end
    if s[i].to_i != ((i+1) % 2)    
        b = b + 1
    end
end

puts [a, b].min

Measured memory_bytes: 1916
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define pii pair<int,int>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define pll pair<ll,ll>
#define mat vector<vector<int>>
const int inf = 1 << 30;
const ll linf = 1e18;
const db EPS = 1e-7;
template<class T> void chmin(T& x, T y){if(x > y) x = y;}
template<class T> void chmax(T& x, T y){if(x < y) x = y;}

string a, b, c;

void rekkyo(string x, string y, string z, vector<int>& dat){
    int sx = x.size(), sy = y.size(), sz = z.size();
    for(int i = 0; i < sx; i++){
        bool flag = true;
        for(int j = 0; j < sy && i + j < sx; j++){
            if(x[i + j] == '?' || y[j] == '?') continue;
            if(x[i + j] != y[j]) flag = false; 
        }
        if(flag) dat.push_back(i);
    }

    for(int i = 1; i < sy; i++){
        bool flag = true;
        for(int j = 0; j < sx && i + j < sy; j++){
            if(y[i + j] == '?' || x[j] == '?') continue;
            if(y[i + j] != x[j]) flag = false;
        }
        if(flag) dat.push_back(-i);
    }
    
    for(int i = 0; i <= sz; i++){
        dat.push_back(sx + i);
        dat.push_back(-sy - i);
    }
}


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> a >> b >> c;
    int sa = a.size();
    int sb = b.size();
    int sc = c.size();

    vector<int> ab, ac, bc;
    rekkyo(a, b, c, ab);
    rekkyo(a, c, b, ac);
    rekkyo(b, c, a, bc);
    bool bc2[20010] = {};
    for(int i = 0; i < bc.size(); i++){
        bc2[bc[i] + 10000] = true;
    }
    int res = inf;
    for(int i = 0; i < ab.size(); i++){
        for(int j = 0; j < ac.size(); j++){
            int d = ac[j] - ab[i];
            if(!bc2[d + 10000]) continue;;
            int l = min({0, ab[i], ac[j]});
            int r = max({sa, ab[i] + sb, ac[j] + sc});
            chmin(res, r - l);
        }
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define int long long
int h,w;
int a[1001][1001];
int dp[1001][1001];
int mod= 1e9+7;
int f(int x,int y)
{ 
  if(x== h-1 && y==w-1 )
    return 1;
  if(x>=h || y>=w || a[x][y]==0)
    return 0;
  if(dp[x][y]!=-1)
    return dp[x][y];
  dp[x][y]=(f(x+1,y)+f(x,y+1))%mod;
  return dp[x][y];
}
int32_t main()
{  
  cin>>h>>w;
  for(int i=0;i<h;i++)
  {
    for(int j=0;j<w;j++)
    {
      char ch;
      cin>>ch;
      if(ch=='.')
        a[i][j]=1;
      else
        a[i][j]=0;
    }
  }
  memset(dp,-1,sizeof(dp));
  cout<<f(0,0);
  
  
}


Measured memory_bytes: 16000
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String t = scan.next();
		int ans = 0;
		for(int i = 0 ;i < s.length(); ++i){
			if (s.charAt(i) != t.charAt(i))++ans;
		}
		System.out.print(ans);

	}
}

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

const int cycle_a = 12 * 60;
const int cycle_b = 60;


int main() {
  int a, b, h, m;
  cin >> a >> b >> h >> m;
  double angle_a = ((double) (h*60+m) / cycle_a) * 360;
  double angle_b = ((double) m / cycle_b) * 360;
  double angle = angle_b - angle_a;
  double c2 = a*a + b*b - 2*a*b*cos(M_PI / 180 * angle);
  double c = sqrt(c2);
  printf("%.20f\n", c);
  return 0;
}


Measured memory_bytes: 4020
#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;

int main() {
  vector<vector<ll>> A(3, vector<ll>(3, 0));
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> A[i][j];
    }
  }
  ll N;
  cin >> N;
  set<ll> B;
  ll b;
  for (int i = 0; i < N; i++) {
    cin >> b;
    B.insert(b);
  }
  vector<vector<bool>> bingo(3, vector<bool>(3, 0));
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (B.find(A[i][j]) != B.end()) bingo[i][j] = true;
    }
  }
  string ans = "No";
  if (bingo[0][0] && bingo[0][1] && bingo[0][2]) ans = "Yes";
  if (bingo[1][0] && bingo[1][1] && bingo[1][2]) ans = "Yes";
  if (bingo[2][0] && bingo[2][1] && bingo[2][2]) ans = "Yes";
  if (bingo[0][0] && bingo[1][0] && bingo[2][0]) ans = "Yes";
  if (bingo[0][1] && bingo[1][1] && bingo[2][1]) ans = "Yes";
  if (bingo[0][2] && bingo[1][2] && bingo[2][2]) ans = "Yes";
  if (bingo[0][0] && bingo[1][1] && bingo[2][2]) ans = "Yes";
  if (bingo[0][2] && bingo[1][1] && bingo[2][0]) ans = "Yes";
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
char s[50];
int num1, num2, num3;
int main() {
    scanf("%s", s);
    for (int i = 0; i < 4; ++i) {
        num1 = num1 * 10 + s[i] - '0';
    }
    for (int i = 5; i < 7; ++i) {
        num2 = num2 * 10 + s[i] - '0';
    }
    for (int i = 8; i < 10; ++i) {
        num3 = num3 * 10 + s[i] - '0';
    }
    if (num1 > 2019) {
        puts("TBD");
        return 0;
    }
    else if (num2 > 4) {
        puts("TBD");
        return 0;
    }
    else puts("Heisei");
    return 0;
}


Measured memory_bytes: 128
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using LP = pair<ll, ll>;
const double PI = 3.1415926535897932;

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

	int ans = 0;
	int v_min = P[0];
	rep(i, N) {
		if (v_min >= P[i] ) ans++;
		v_min = min(v_min, P[i]);
	}

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

Measured memory_bytes: 3960
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
c = Counter(s)
m = 0
for v in c.values():
	m = max(m, v)
ans = []
for k, v in c.items():
	if v == m:
		ans.append(k)
ans.sort()
print(*ans, sep="\n")

Measured memory_bytes: 35948
N, x = map(int, input().split())
a = list(map(int, input().split()))
ans = 0

for i in range(N - 1):
  total = a[i] + a[i + 1]
  if total > x:
    a[i + 1] = max(0, a[i + 1] - (total - x))
    ans += (total - x)
print(ans)

Measured memory_bytes: 14132
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
#include <list>

using namespace std;



int main(void){
    string s;

    cin>>s;

    if(s=="ABC"){
        cout<<"ARC"<<endl;
    }else{
        cout<<"ABC"<<endl;
    }




    return 0;
}



Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int mod=1e9+7;
vector<int> adj[100010];
int n,dp[100010][2];
void f(int p,int u) {
	dp[u][0]=dp[u][1]=1;
	for(auto& it:adj[u]) {
		if(it==p) continue;
		f(u,it);
		dp[u][0]=(ll)(dp[it][0]+dp[it][1])*dp[u][0]%mod;
		dp[u][1]=(ll)dp[it][0]*dp[u][1]%mod;
	}
}
int main() {
	scanf("%d",&n);
	int i;
	for(i=0;i<n-1;i++) {
		int u,v;
		scanf("%d%d",&u,&v);
		adj[u].push_back(v);
		adj[v].push_back(u);
	}
	f(1,1);
	printf("%d",(dp[1][0]+dp[1][1])%mod);
	return 0;
}

Measured memory_bytes: 12032
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;

int main(){
    string s;
    cin >> s;
    int size=s.size();

    string rev =s;
    reverse(all(rev));
    if(s != rev){
        cout << "No" << endl;
        return 0;
    }

    string front = s.substr(0,size/2);
    string revfro = front;
    reverse(all(revfro));
    if(front != revfro){
        cout << "No" << endl;
        return 0;
    }

    string back = s.substr(size/2+1,size/2);
    string revback = back;
    reverse(all(revback));
    if(back != revback){
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;

}

Measured memory_bytes: 3624
#import<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long LL;
LL i,j,k,m,n,t,a[100005];
string s;
main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>s;
	if(s[2]==s[3]&&s[4]==s[5])cout<<"Yes";
	else cout<<"No";
}

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

#define x first
#define y second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(), (a).end()

using namespace std;
using namespace __gnu_pbds;

typedef tree< int, null_type, less< int >, rb_tree_tag, tree_order_statistics_node_update> ost;
// name.find_by_order(x) or name.order_of_key(x)
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<pair<int, int>> vii;
typedef vector<vector<int>> vvi;

void yes() {printf("YES\n");}
void no() {printf("NO\n");}

int dx4[] = {-1, 1, 0, 0};
int dy4[] = {0, 0, -1, 1};
int dx8[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};

const int maxn = 1e6 + 5, maxv = 2e6 + 5;
const int MOD = 1e9 + 7;

int mult(ll a, ll b) {return (a * b) % MOD;}
int pot(int n, int k) {
	int ret = 1, pot = n;
	for(;k > 0;k >>= 1, pot = mult(pot, pot)) 
		ret = mult(ret, (k & 1) ? pot : 1);
	return ret;
}
int divide(int a, int b) {return mult(a, pot(b, MOD - 2));}
int add(int a, int b) {a += b;if(a >= MOD) a -= MOD;return a;}
int sub(int a, int b) {a -= b;if(a < 0) a += MOD;return a;}

vector<int> fact;
void calc_fact(int n) {
	fact = vector<int>(n + 1, 1);
	for(int i = 1;i <= n;i++) fact[i] = mult(fact[i - 1], i);
}
int choose(int n, int k) {return divide(fact[n], mult(fact[n - k], fact[k]));}

bool prime(ll a) {
	if (a == 1) return 0;
	for(ll i = 2;i * i <= a;i++) 
		if (a % i == 0) return 0;
	return 1;
}

ll gcd(ll a, ll b) {return (b == 0 ? a : gcd(b, a % b));}
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}

ll phi(ll x) {
	double ret = x;
	for(ll i = 2;i * i <= x;i++) {
		if (x % i) continue;
		ret *= (1.0 - 1.0 / (double)i);
		while (x % i == 0) x /= i;
	}
	if (x > 1) ret *= (1.0 - 1.0 / (double)x );
	return (ll)ret;
}

int n;

void solve() {
	scanf("%d", &n);
	int ans = 0;
	ans = pot(10, n);
	ans = sub(ans, mult(2, pot(9, n)));
	ans = add(ans, pot(8, n));
	printf("%d\n", ans);
}

int main() {
	int t = 1;
	//scanf("%d", &t);
	while(t--) solve();
	return 0;
}


Measured memory_bytes: 3800
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int input = sc.nextInt();
		int inputs[] = new int[input];
		int count = 0;
		int even = 0;
		for(int i = 0; i < input; i++) {
			inputs[i] = sc.nextInt(); 
		}
		while(true) {
			for(int j = 0; j < input; j++) {
				if(inputs[j] %2 == 0) {
					inputs[j] /= 2;
				}
				else even = 1;
			}
			if(even == 1)break;
			count++;
		}
		System.out.println(count);	
	}

}


Measured memory_bytes: 22740
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define MOD 1000000007
#define PI 3.141592653589793
int dx[] = {0,1,-1,0,1,-1,1,-1};
int dy[] = {1,0,0,-1,1,-1,-1,1};

int main(){
    int n;
    cin >> n;
    if(n == 1){
        cout << "Hello World" << endl;
    }else{
        int a, b;
        cin >> a >> b;
        cout << a + b << endl;
    }
}


Measured memory_bytes: 256
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n, m = [int(i) for i in input().split()]
uf = UnionFind(n)

p = [int(i) for i in input().split()]
for i in range(m):
    x, y = [int(j) for j in input().split()]
    uf.union(x-1, y-1)

count = 0
for i in range(1, n+1):
    if(uf.same(i-1, p[i-1]-1)):
        count += 1

print(count)

Measured memory_bytes: 84676
#include <iostream>
#include <cmath>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main(){
  int n, t, a;
  cin >> n >> t >> a;
  int ans;
  double diff = 100000000.0;
  rep(i, n){
    int h;
    cin >> h;
    double d = abs((double)a - ((double)t-h*0.006));
    if ( d < diff ){
      diff = d;
      ans = i+1;
    }
  }
  cout << ans << endl;
  
  return 0;
}

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if( a >= b ) {
    if( a >= c )
      cout << 10 * a + b + c << endl;
    else
      cout << 10 * c + b + a << endl;
  }
  else {
    if( b >= c )
      cout << 10 * b + a + c << endl;
    else
      cout << 10 * c + b + a << endl;
  }
  return 0;
}

Measured memory_bytes: 256