akhauriyash/Code-Regression huggingface dataset:
#pragma gcc optimize("Ofast")

#include "bits/stdc++.h"
using namespace std;
typedef int64_t lld;
typedef pair<int,int> pii;
typedef pair<lld,lld> pll;
typedef pair<int,pll> pip;
typedef pair<pll,int> ppi;
typedef pair<lld,pll> plp;
typedef pair<pll,lld> ppl;
typedef pair<pll,pll> ppp;
template<typename T>
using maxHeap = priority_queue<T,vector<T>,less<T>>;
template<typename T>
using minHeap = priority_queue<T,vector<T>,greater<T>>;
#define ff first
#define ss second
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define endl '\n'
#define jizz cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);
inline void input(int &_x) {
    _x = 0;
    int _tmp = 1; char _tc = getchar();
    while((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
    if(_tc == '-') _tc = getchar(), _tmp = -1;
    while(_tc >= '0' && _tc <= '9') _x = _x*10+(_tc-48), _tc = getchar();
    _x *= _tmp;
}
inline void output(int _x) {
    char _buff[20]; int _f = 0;
    if(_x == 0)putchar('0');
    while(_x > 0)
    {
        _buff[_f++] = _x%10+'0';
        _x /= 10;
    }
    for(_f-=1; _f >= 0; _f--)
        putchar(_buff[_f]);
    putchar('\n');
}
template<typename Iter>
ostream& _out(ostream &s, Iter b, Iter e) {
    s<<"[";
    for ( auto it=b; it!=e; it++ ) s<<(it==b?"":" ")<<*it;
    s<<"]";
    return s;
}
template<class T1,class T2>
ostream& operator<<(ostream& out, pair<T1,T2> p) {
    return out << '(' << p.first << ", " << p.second << ')';
}
template<typename T>
ostream& operator <<( ostream &s, const vector<T> &c ) {
     return _out(s,c.begin(),c.end());
 }
#ifdef erd1
    #define pprint(x) cerr<<__PRETTY_FUNCTION__<<":"<<__LINE__<<" - "<<(#x)<<"="<<(x)<<endl
#else
    #define pprint(x)
#endif

// code starts here
map<int,int> m;
vector<int> sp, dist;
signed main(){
    string s;
    cin >> s;
    int n = s.size();
    sp.resize(n+1);
    dist.resize(n+1, INT_MAX); dist[0] = 0;
    m[0] = 0;
    for(int i = 1; i <= n; i++)
        sp[i] = sp[i-1] ^ (1<<(s[i-1]-'a'));
    if(sp[n] == sp[0])return cout << 1 << endl, 0;
    for(int i = 1; i <= n; i++){
        if(m.find(sp[i]) != m.end())
            dist[i] = min(dist[i], dist[m[sp[i]]]);
        m[sp[i]] = i;
        for(int j = 0; j < 26; j++)
            if(m.find(sp[i]^(1<<j)) != m.end())
                dist[i] = min(dist[i], dist[m[sp[i]^(1<<j)]]+1);
    }
    cout << dist[n] << endl;
}

//ecaebbccfbdf


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

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

#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;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<"\n"

int main(){
    int a,b,c,d,e,f;
    cin >> a >> b >> c >> d >> e >> f;
    
    set<int> water_set, sugar_set;

    //water
    for(int i=0;i<30;i++){
        for(int j=0;j<=30;j++){
            if(i==0&&j==0) continue;
            int w = 100*a*i+100*b*j;
            if(w>f)break;
            if(w<=f)water_set.insert(w);
        }
    }

    //sugar
    for(int i=0;i<=3000;i++){
        for(int j=0;j<=3000;j++){
            int s = c*i+d*j;
            if(s>f)break;
            if(s<=f)sugar_set.insert(s);
        }
    }
    
    double maxratio = -1.0;
    int sw=0,s=0;
    for(int x:water_set){
        for(int y:sugar_set){
            if(x+y>f)break;
            if((x/100)*e<y)break;
            double ratio = (double)y/(x+y);
            if(maxratio<ratio){
                maxratio = ratio;
                sw = (x+y);s = y;
            }
        }
    }
    cout << sw << " " << s << endl;
    return 0;
}  

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

//--------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

//--------------------------------------------
const double EPS = 1e-14;
const double PI  = acos(-1.0);

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

int main(){
  int n;
  int k;

  cin >> n >> k;

  int i = 1;
  int num = 1;

  while (i <= n) {
    if (num < k)
      num *= 2;
    else
      num += k;
    i++;
  }
  printf("%d\n", num);
}


Measured memory_bytes: 256
fn main() {
    proconio::input! {
        n: usize,
        m: usize,
        x: i32,
        p: [(i32, [i32; m]); n],
    }
    let mut ans = std::i32::MAX;
    for bit in 0..(1 << n) {
        let mut sum = 0;
        let mut c = vec![0; m];
        for i in 0..n {
            if bit & (1 << i) != 0 {
                sum += p[i].0;
                for j in 0..m {
                    c[j] += p[i].1[j];
                }
            }
        }
        if c.iter().all(|&y| y >= x) {
            ans = ans.min(sum);
        }
    }
    println!("{}", if ans == std::i32::MAX { -1 } else { ans });
}


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

int main() {
    int M, D;
    cin >> M >> D;

    int ans = 0;
    for (int i = 22; i <= D; i++) {
        if (i % 10 >= 2 && i % 10 * (i / 10) <= M)
            ans++;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	A := make([]int, N)
	var tmp int
	for i := 0; i < N; i++ {
		fmt.Scan(&tmp)
		A = append(A, tmp)
	}

	index := 1
	flag := false
	for _, a := range A {
		if a == index {
			flag = true
			index++
		}
	}
	if flag {
		fmt.Println(N - index + 1)
	} else {
		fmt.Println("-1")
	}

}


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

#define ll long long
#define INF 99999999
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

template < typename T > std::string to_string( const T& n )
{
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
}

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

    int year = (s[0]-'0')*1000 + (s[1]-'0')*100 + (s[2]-'0')*10 + (s[3]-'0');
    int month = (s[5]-'0') * 10 + (s[6]-'0');
    int day =  (s[8]-'0') * 10 + (s[9]-'0');

    if( year < 2019 )
    {
        cout << "Heisei" << endl;
    }
    else if( year == 2019 )
    {
        if( month < 4 ) cout << "Heisei" << endl;
        else if( month == 4 )
        {
            if( day <= 30 ) cout << "Heisei" << endl;
            else cout << "TBD" << endl;
        }
        else cout << "TBD" << endl;
    }
    else cout << "TBD" << endl;
}


Measured memory_bytes: 256
from heapq import heappop, heappush
x, y, z, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
q = [(-(A[0]+B[0]+C[0]), 0, 0, 0)]
hs = [(0, 0, 0)]
for i in range(k):
    val, a, b, c = heappop(q)
    print(-val)
    if 0<=a+1<x and (a+1, b, c) not in hs:
        heappush(q, (-(A[a+1]+B[b]+C[c]), a+1, b, c))
        hs.append((a+1, b, c))
    if 0<=b+1<y and (a, b+1, c) not in hs:
        heappush(q, (-(A[a]+B[b+1]+C[c]), a, b+1, c))
        hs.append((a, b+1, c))
    if 0<=c+1<z and (a, b, c+1) not in hs:
        heappush(q, (-(A[a]+B[b]+C[c+1]), a, b, c+1))
        hs.append((a, b, c+1))

Measured memory_bytes: 4468
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define INF ((1LL<<62)-(1LL<<31))

int main(){
	ll a,b,k;
	scanf("%lld%lld%*lld%lld",&a,&b,&k);
	printf("%lld\n",k%2?b-a:a-b);
}

Measured memory_bytes: 128
in_str = input()

if (not in_str.isnumeric()) :
    print("error")
    exit()

in_num = int(in_str)
num = in_num % 10

if num == 2 or  num == 4 or num == 5 or num == 7 or num == 9 :
  print('hon')
elif num == 0 or  num == 1 or num == 6 or num == 8 :
  print('pon')
elif num == 3:
  print('bon')
else :
  print("error")

Measured memory_bytes: 9188
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQG = priority_queue<T, vector<T>, greater<T> >;
const int INF = 0xccccccc;
const ll LINF = 922337203685477580LL;
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b && (a = b, true);}
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b && (a = b, true);}
template<typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) { return is >> p.first >> p.second;}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) { return os << p.first << ' ' << p.second;}

template<class T>
struct SegTree {
	using FX = function<T(T, T)>;
	int n;
	FX fx;
	const T ex;
	vector<T> dat;
	SegTree(int n_, FX fx_, T ex_):fx(fx_), ex(ex_), n(1) {
		while(n < n_) n <<= 1;
		dat.assign((n<<1)-1, ex);
	}
	inline int chld(int k) {return (k<<1)+1;}
	inline int chrd(int k) {return (k<<1)+2;}
	void update(int i, T x) {
		i += n-1;
		dat[i] = x;
		while(i) {
			i = (i-1)>>1;
			dat[i] = fx(dat[chld(i)], dat[chrd(i)]);
		}
	}
	inline T query(int a, int b) {return query(a, b, 0, 0, n);}
	T query(int a, int b, int k, int l, int r) {
		if(r <= a || b <= l) return ex;
		if(a <= l && r <= b) return dat[k];
		T vl = query(a, b, chld(k), l, (l+r)>>1);
		T vr = query(a, b, chrd(k), (l+r)>>1, r);
		return fx(vl, vr);
	}
	const T &operator[](int idx) const {return dat[idx+n-1];}
};

const int N = 2e5+10;

//head

int n;
int h[N], a[N];
SegTree<ll> seg(N, [](ll a, ll b)->ll{return max(a, b);}, 0);

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n;
	rep(i, n) cin >> h[i];
	rep(i, n) cin >> a[i];
	rep(i, n) {
		h[i]--;
		seg.update(h[i], seg.query(0, h[i])+a[i]);
	}
	cout << seg.query(0, n) << endl;
}

Measured memory_bytes: 8984
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long N = sc.nextInt();
        long ct = 0;
        long cx = 0; 
        long cy = 0;
        boolean ans = true;
        for(int i = 0;i < N;i++){
            long ti = (long)sc.nextInt();
            long xi = (long)sc.nextInt();
            long yi = (long)sc.nextInt();
            long di = Math.abs(xi-cx)+Math.abs(yi-cy);
            if(ti-ct < di || (ti-ct)%2 != di%2){
                ans = false;
            }
            ct = ti;
            cx = xi;
            cy = yi;
        }
        if(ans) System.out.println("Yes");
        else    System.out.println("No");
    }
}

Measured memory_bytes: 86616
#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
    int n, m, k;
    std::cin >> n >> m >> k;
    std::vector<int> a(n), b(m);

    for (auto &v: a)
    {
        std::cin >> v;
    }

    for (auto &v : b)
    {
        std::cin >> v;
    }

    std::int64_t t = 0;
    for (const auto& v : b)
    {
        t += v;
    }

    int bCount = m;
    int ans = 0;
    for (auto i = 0; i < n + 1; ++i)
    {
        while (bCount > 0 && t > k)
        {
            --bCount;
            t -= b[bCount];
        }
        if (t > k)
        {
            break;
        }
        ans = std:: max(ans, i + bCount);
        if (i == n)
        {
            break;
        }
        t += a[i];
    }
    std::cout << ans;
}

Measured memory_bytes: 4848
#include<bits/stdc++.h>
using namespace std;
#define db(x){if(cond)cerr<<__LINE__<<" "<<#x<<" " <<x<<endl;}
#define rep(i,b)for(auto i=(0);i<(b);++i)
#define fo(i,a,b)for(auto i=(a);i<=(b);++i)
#define ford(i,a,b)for(auto i=(a);i>=(b);--i)
#define all(x) (x).begin(),(x).end()
#define vv vector
#define pb push_back
template<typename X>void MA(X&a,X b){a=max(a,b);}template<typename X>void MI(X&a,X b){a=min(a,b);}
template<typename X>void clr(X&x,int a){memset(x,a,sizeof(a));};typedef long long ll;typedef long double ld;
typedef array<int,2>i2;typedef vv<int>vi;int cond=0,multi=0,gcj=0;

struct solver_t;solver_t *solver;
struct solver_t{


  void solve(){
    int A,B;cin>>A>>B;
    string X;cin>>X;
    bool ok=1;
    rep(i,A){
      ok&=isdigit(X[i]);
    }
    ok&=X[A]=='-';
    rep(i,B)ok&=isdigit(X[i+A+1]);
    if(ok)cout<<"Yes\n"; else cout<<"No\n";
  }
};

void gen(){}
void brute(){}
int main(int argc,char** argv){
  fo(i,1,argc-1)if(argv[i]==string("q"))cond=1<<30;
  fo(i,1,argc-1)if(argv[i]==string("gen")){gen();exit(0);}
  fo(i,1,argc-1)if(argv[i]==string("brute")){brute();exit(0);}
  ios::sync_with_stdio(false),cin.tie(0);
  cout.setf(ios::fixed),cout.precision(10);int t;if(multi||gcj)cin>>t;else t=1;
  fo(i,1,t){if(cond)cerr<<__LINE__<<" "<<i<<endl;if(gcj)cout<<"Case #"<<i<<": ";
    solver = new solver_t();
    solver->solve();
  }return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int a = sc.nextInt();
      	int b = sc.nextInt();
      	long k = sc.nextLong();
      	long[] aN = new long [a];
      	long[] bN = new long [b];
      	long[] aSum = new long [a+1];
      	long[] bSum = new long [b+1];
      	int aPos = 0;
      	int bPos = 0;
      	int ans = 0;
      	for(int i=0;i<a;i++){
          aN[i] = sc.nextLong();
        }
      	for(int i=0;i<b;i++){
          bN[i] = sc.nextLong();
        }
      	
      	aSum[0] = 0;
      	for(int i=0;i<a;i++){
          aSum[i+1] = aSum[i] + aN[i];
          if( aSum[i+1] > k ){
            //aPos;
            break;
          }else{
            aPos++;
          }
        }
      	
      	bSum[0] = 0;
      	for(int i=0;i<b;i++){
          
          bSum[i+1] = bSum[i] + bN[i];
          if( bSum[i+1] > k ){
            //bPos--;
            break;
          }else{
            bPos++;
          }
        }
      	
      	if( aPos > bPos ){
          ans = aPos;
        }else{
          ans = bPos;
        }
      	//System.out.println(aPos+"@"+bPos);
      
      	for(int i=aPos;i>=0;i--){
          if( ans-i+1>=0 && ans-i+1<=bPos && aSum[i] + bSum[ans-i+1] <= k ){
            //System.out.println(i+"*"+(ans-i+1));
            i++;  
            ans++;
          }
        }
      	
      	/*
      	for(int i=0;i<aPos+1;i++){
          if( i + bPos <= ans ){
            continue;
          }
          for(int j=ans-i;j<bPos+1;j++){
            if( i + j < ans ){
              continue;
            }
            if( aSum[i] + bSum[j] <= k ){
              if( i + j > ans ){
                ans = i + j;
              }
            }
          }
        }
        */
      	System.out.println(ans);
	}
}

Measured memory_bytes: 57068
#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
typedef long long ll;
typedef vector<ll> vl;
#define rp(i, f, t) for (long long int i = f; i < t; i++)
#define pr(i, f, t) for (long long int i = t - 1; i >= f; i--)
#define ca(n, a) rp(ca_i, 0, n) cout << a[ca_i] << ((ca_i == n - 1) ? "\n" : " ")
#define za(n, a) rp(za_i, 0, n) a[za_i] = 0
#define be(a) a.begin(), a.end()
#define ce(a) cout << (a) << endl
int main()
{
    ll n;
    cin >> n;
    ll a[n];
    rp(i, 0, n) cin >> a[i];
    set<ll> st;
    ll ans = 0;
    rp(i, 0, n)
    {
        if (a[i] / 400 < 8)

            st.insert(a[i] / 400);
        else
            ans++;
    }
    if (st.size() > 0)
    {
        cout << st.size() << " ";
        ce(st.size() + ans);
    }
    else
    {
        cout << 1 << " " << ans << endl;
    }
}

Measured memory_bytes: 256
import java.util.*;
import java.util.stream.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		System.out.println(IntStream.range(1, 10).anyMatch(i -> n % i == 0 && n / i <= 9) ? "Yes" : "No");
	}
}


Measured memory_bytes: 28752
#include<bits/stdc++.h>
using namespace std;
int main(){

  int A,B;
  int ans = 0;
  
  cin >> A >> B;
  
  ans = A - B * 2;
  
  if(ans > 0){
    
    cout << ans <<endl;
    
  }else{
    
    cout << 0 <<endl;
    
  }
  return 0;
}


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

int main(){
    
    int H, W;
    
    while(1){
        cin >> H >> W;
        if(H == 0 && W == 0) break;
        for(int i = 0 ; i < H ; i++){
            for(int j = 0 ; j < W ; j++){
                if(i == 0 || j == 0 || i == H - 1 || j == W - 1) cout << "#";
                else cout << ".";
            }
            cout << endl;
        }
        cout << endl;
    }
    return 0;
}


Measured memory_bytes: 3028
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i+100*j+50*k==x:
                ans+=1
print(ans)

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

typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> PLL;
typedef pair<P,P> PP;
typedef vector<ll> llVEC;
typedef vector<P> PVEC;
typedef priority_queue<P,PVEC,greater<P> > PQ;
typedef priority_queue<ll, llVEC, greater<ll> > llPQ;

#define rep(i,a,n) for(ll i = a;i < n;i++)
#define rrep(i,a,n) for(ll i = n-1; i >= a;i--)
#define LINF (ll)1e18
#define INF (int)1e9
#define fs first
#define sc second

template<typename T>
ll sz(vector<T> &vec){ return (ll)vec.size(); }
template<typename T>
ll sz(priority_queue<T, vector<T>> &pq) {return (ll)pq.size(); }
template<typename T>
ll sz(priority_queue<T, vector<T>, greater<T>> &pq) {return (ll)pq.size(); }
ll sz(string &s) {return (ll)s.size(); } 
ll gcd(ll a,ll b){ return ((!b) ?a :gcd(b, a%b)); }
ll lcm(ll a,ll b){ return a / gcd(a,b) * b; }
bool checkindex(ll i,ll n){ return (i < n && i >= 0); }

int main(){
    ll n,a,b;
    cin >> n >> a >> b;
    if(abs(a-b)%2 == 1){
        cout << "Borys" << endl;
    }
    else{
        cout << "Alice" << endl;
    }
    return 0;
}



Measured memory_bytes: 3616
N=int(input())
T=[int(input()) for _ in range(N)]

def gcd(x,y):
    if y==0:
        return x
    return gcd(y,x%y)

def lcm(n,m):
    return n*m//gcd(n,m)

ans=1

for t in T:
    ans=lcm(max(ans,t),min(ans,t))

print(ans)

Measured memory_bytes: 3060
import qualified Data.ByteString.Char8 as BS
import Data.Maybe

readInt = fst . fromJust . BS.readInt

readIntList = map readInt . BS.words

getIntList = readIntList <$> BS.getLine

main = do
  [l, r, d] <- getIntList
  print $ r `div` d - (l - 1) `div` d


Measured memory_bytes: 3676
require 'set'; require 'prime'
INF=Float::INFINITY
s = gets.chomp
 
if ['AKIHABARA',
    'AKIHABAR',
    'AKIHABRA',
    'AKIHABR',
    'AKIHBARA',
    'AKIHBAR',
    'AKIHBRA',
    'AKIHBR',
    'KIHABARA',
    'KIHABAR',
    'KIHABRA',
    'KIHABR',
    'KIHBARA',
    'KIHBAR',
    'KIHBRA',
    'KIHBR',
   ].include?(s)
  puts 'YES'
else
  puts 'NO'
end

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())
#define rsort(v) sort(all(v)); reverse(all(v))

using namespace std;

using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template<typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template<typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template<typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template<typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template<typename T> inline T power(T x, i64 n) { T r = 1; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template<typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }

void solve() {
  int N, A, B; cin >> N >> A >> B;
  vi32 cnt(3);
  rep(i, N) {
    int p; cin >> p;
    if (p <= A) cnt[0]++;
    else if (p <= B) cnt[1]++;
    else cnt[2]++;
  }
  int ans = 1e9;
  rep(i, 3) amin(ans, cnt[i]);
  cout << ans << '\n';
}


Measured memory_bytes: 256
n = int(input())
ab = [tuple(map(int,input().split())) for i in range(n)]
cd = [tuple(map(int,input().split())) for i in range(n)]
ans = 0

ab = sorted(ab,key = lambda x:x[1],reverse = True)
cd.sort()



for (c,d) in cd:
    for (a,b) in ab:
        if a < c and b < d:
            ans += 1
            ab.remove((a,b))
            break
print(ans)


Measured memory_bytes: 3064
# ?´???°?????°?????¨?????????????????°??????

import sys
import math

prim_no = {2: True}                    # ????????°????´???°??§??????????????????????????????

def is_prime(no):
    if no == 2 or no == 1:
        return True
    
    if no % 2 == 0:
        return False

    if prim_no.get(no) is not None:
        return prim_no.get(no)

    max_check = int(math.sqrt(no))
    for i in range(3, max_check+1, 2):
        if no % i == 0:
            prim_no[no] = False
            return False

    prim_no[no] = True
    return True

def main():
    prim_vals = {}                         # ????????°?????§????´???°????????°
    num_data = []                          # ?????????????????????
    
    while True:
        num = sys.stdin.readline()
        if num is None or num.strip() == '':
            break

        num = int(num.strip())
        num_data.append(num)

    sorted_num_data = sorted(num_data)
    prim_num = {}
    
    for num in sorted_num_data:
        if prim_vals.get(num) is not None:
            cnt = prim_vals.get(num)
        else:
            if num == 1:
                cnt = 0
            else:
                cnt = 0

                if num % 2 == 0:
                    start_num = num -1
                else:
                    start_num = num
                    
                for i in range(start_num, 0, -2):
                    if prim_vals.get(i) is not None:
                        cnt += prim_vals.get(i)
                        break
                    
                    if is_prime(i):
                        cnt += 1
                        
                prim_vals[num] = cnt # ????????°?????§????´???°????????°????????????
        prim_num[num] = cnt

    for num in num_data:
        print(prim_num[num])

if __name__ == '__main__':
    main()
    #print(prim_no)

Measured memory_bytes: 55504
N = int(input())
A = list((map(int,input().split())))
B = list((map(int,input().split())))
C = list((map(int,input().split())))
 
total = sum(B)
for i in range(len(A) - 1):
    if A[i] + 1 == A[i+1]:    	
        total= total+C[A[i]-1]
      
print(total)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, e) for (int i = s; i < e; ++i)
#define sort_(a) stable_sort(a.begin(), a.end())
#define rsort(a) stable_sort(a.rbegin(), a.rend())
#define sum(a) accumulate(a.begin(), a.end(), 0LL)
#define join(a, d) accumulate(a.begin() + 1, a.end(), a[0], [](string s, string t) {return s + d + t;})
#define all(a) a.begin(), a.end()
#define __lcm(a, b) std::__detail::__lcm(a, b)
typedef long long ll;
const long mod = 1e9 + 7;

int main(void) {
#ifdef DEBUG
  freopen("input.txt", "r", stdin);
#endif

  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int N, M;
  cin >> N;
  map<string, int> S{};
  string s;
  rep(i, 0, N) {
    cin >> s;
    ++S[s];
  }
  cin >> M;
  map<string, int> T{};
  rep(i, 0, M) {
    cin >> s;
    ++T[s];
  }
  int ans = 0;
  int n = 0;
  for (auto s : S) {
    n += s.second;
    n -= T[s.first];
    ans = max(ans, n);
    n = 0;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
h, w = map(int, input().split())
vec =[]
for i in range(h):
    a = list(input())
    if '#' in a:
        vec.append(a)
    else:
        h -= 1
        
#print(h, w)
#print(vec)


num = []
for i in range(w):
    for j in range(h):
        if vec[j][i] == '#':
            num.append(i)
            break
    
for i in range(h):
    for j in num:
        print(vec[i][j], end='')
    
    print()

Measured memory_bytes: 4596
#include <cstdio>
#include <vector>

using namespace std;

int main()
{
    while (true) {
        int h;
        scanf("%d", &h);
        if (h == 0) {
            break;
        }

        vector<vector<int>> v;
        v.resize(h);
        for (auto&& r : v) {
            r.resize(5);
            for (auto i = 0; i < 5; ++i) {
                int x;
                scanf("%d", &x);
                r[i] = x;
            }
        }

        int p = 0;
        bool change = false;
        do {
            change = false;
            for (auto&& r : v) {
                // 5
                if (r[0] > 0 && r[0] == r[1] && r[1] == r[2] && r[2] == r[3] &&
                    r[3] == r[4]) {
                    p += r[0] * 5;
                    r[0] = r[1] = r[2] = r[3] = r[4] = -1;
                    change = true;
                }
                // 4
                if (r[0] > 0 && r[0] == r[1] && r[1] == r[2] && r[2] == r[3]) {
                    p += r[0] * 4;
                    r[0] = r[1] = r[2] = r[3] = -1;
                    change = true;
                }
                if (r[1] > 0 && r[1] == r[2] && r[2] == r[3] && r[3] == r[4]) {
                    p += r[1] * 4;
                    r[1] = r[2] = r[3] = r[4] = -1;
                    change = true;
                }
                // 3
                if (r[0] > 0 && r[0] == r[1] && r[1] == r[2]) {
                    p += r[0] * 3;
                    r[0] = r[1] = r[2] = -1;
                    change = true;
                }
                if (r[1] > 0 && r[1] == r[2] && r[2] == r[3]) {
                    p += r[1] * 3;
                    r[1] = r[2] = r[3] = -1;
                    change = true;
                }
                if (r[2] > 0 && r[2] == r[3] && r[3] == r[4]) {
                    p += r[2] * 3;
                    r[2] = r[3] = r[4] = -1;
                    change = true;
                }
            }

            for (int i = 0; i < 5; ++i) {
                vector<int> t;
                // ???????????£??????????????¢???
                for (size_t j = 0; j < v.size(); ++j) {
                    if (v[j][i] > 0) {
                        t.push_back(v[j][i]);
                    }
                }
                // ?????£????????????????????°??????????????????
                for (size_t j = 0; j < t.size(); ++j) {
                    v[h - t.size() + j][i] = t[j];
                }
                // ?????£?????¨??????????¶????????????¨?????????
                for (size_t j = 0; j < h - t.size(); ++j) {
                    v[j][i] = -1;
                }
            }
        } while (change);
        printf("%d\n", p);
    }
}

Measured memory_bytes: 2592
use std::io::BufRead;

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

  let mut ite = buf.trim().split_whitespace()
    .map(|x| x.parse::<f64>().unwrap());

  let x1 = ite.next().unwrap();
  let y1 = ite.next().unwrap();
  let x2 = ite.next().unwrap();
  let y2 = ite.next().unwrap();

  println!("{}", (x1 - x2).hypot(y1 - y2));
}


Measured memory_bytes: 5132
package main

import (
  "fmt"
)

func main() {
  var a,b,c,d,e,f float64
  var x,y float64
  for _, err := fmt.Scan(&a, &b, &c, &d, &e, &f); err == nil;
   _, err = fmt.Scan(&a, &b, &c, &d, &e, &f) {
    y = (a*f-c*d)/(a*e-b*d)
    x = (c-b*y)/a
    fmt.Printf("%.3f %.3f\n", x,y)
  }
}


Measured memory_bytes: 1124
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define REP(X, Y, Z) for (ll(X) = (Y); (X) < (Z); (X)++)
#define REV(X, Y, Z) for (ll(X) = (Y); (X) > (Z); (X)--)

using namespace std;
using ld = long double;
using ll = long long;
using dll = deque<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using usll = unordered_set<ll>;
using umll = unordered_map<ll, ll>;
using sll = stack<int>;
using vll = vector<ll>;
using vvll = vector<vll>;

constexpr ll kMax = 1e12 + 1;
constexpr ll kMod = 1e9 + 7;
constexpr long double kPI = 3.14159265358979323846;

ll gcd(ll a, ll b) {
  if (a < b) {
    return gcd(b, a);
  }
  ll c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}

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

void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}

int main() {
  init();

  ll N, K;
  cin >> N >> K;
  vll A(N);
  REP(i, 0, N) {
    cin >> A[i];
  }

  REP(i, 1, N - K + 1) {
    ll current = A[i - 1];
    ll next = A[i + K - 1];

    if (current < next) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }

  return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
using V = vector<ll>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i, n) for(ll i=1;i<=(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define MOD 1000000007
#define INF 1000000000
#define LLINF 1e18

void solve_abc_a() {
	ll n, m;
	ll x, y;
	ll a, b, d;
	ll c;
	//char c;
	ll h, w;
	ll k;
	//string s, t;
	ll s, t;
	ll l_ans = 0;
	string s_ans = "NG";

	cin >> d >> t >> s;

	if ((ll)ceil((double)d / s) <= t) {
		s_ans = "Yes";
	}
	else {
		s_ans = "No";
	}


	cout << s_ans << "\n";

	return;
}


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed;
	cout << setprecision(7);

	solve_abc_a();

	return 0;
}


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

typedef long long ll;
typedef pair<int, int> ii;

const int N = 100005;
int H[N];
int res[N];
int n, m, a, b;

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

  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> H[i];
  }
  for (int i = 0; i < m; ++i) {
    cin >> a >> b;
    if (H[a] >= H[b])
      res[b] |= true;
    if (H[b] >= H[a])
      res[a] |= true;
  }

  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    if (!res[i])
      ++cnt;
  }
  cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 4464
#include<iostream>
#include<cmath>

using namespace std;

int main()
{
  int N, D, x[10][10];
  double d;

  cin >> N >> D;
  for(int i = 0; i < N; i++)
    for(int j = 0; j < D; j++)
      cin >> x[i][j];

  int cnt = 0;
  for(int i = 0; i < N - 1; i++){
    for(int j = i + 1; j < N; j++){
      double d = 0;
      for(int k = 0; k < D; k++){
        d += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
      }
      d = sqrt(d);
      if(ceil(d) == floor(d))
        cnt++;
    }
  }

  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

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

ll lcm(ll x, ll y) {
    return x / gcd(x,y) * y;
}

int main(void)
{
    IOS
    int N, M;
    cin >> N >> M;
    string S; cin >> S;
    string T; cin >> T;

    ll xl = lcm(N,M);
    ll ln = xl / N;
    ll lm = xl / M;

    if (N == M && S != T) {
        OUT(-1)
        return 0;
    } else {
        map<ll,char> X;
        REP(i,N) {
            X[ln*i] = S[i];
        }
        REP(i,M) {
            char c;
            try { 
                c = X.at(lm*i);
            } catch (exception e){
                c = ' ';
            }

            if (!(c == ' ' || c == T[i])) {
                OUT(-1)
                return 0;
            }
        }
    }

    cout << xl << '\n';

    return 0;
}

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

using namespace std;

#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;

const int MOD = 1e9 + 7;


int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	string s;
	cin >> s;
	long long sol = 0;
	int bs = 0;
	for(int i = 0; i < s.size(); i++){
		if(s[i] == 'B') bs++;
		else if(s[i] == 'W') sol += bs;
	}
	cout << sol;
}

Measured memory_bytes: 720
// Created by ...Lusifer
#include<bits/stdc++.h>
using namespace std;
 
#define pb 		push_back
#define mp 		make_pair
#define prior   priority_queue
#define MOD 	1000000007
#define INF64 	(long long)1e18
#define INF 	(int)1e9
#define PI 		3.1415926535897932384626433832795 
#define ll      long long
#define ld		long double
#define ret     return
#define NUM 	1000001
const int SIZE = 2e5+4;
void fastio(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

void solveTest(){
	string s;
	cin>>s;
	map<char,int>mp;
	for(auto i: s){
		mp[i]++;
	}
	int flag=0;
	for(auto i:mp){
		if(i.second%2!=0){
			flag=1;
			break;
		}
	}
	cout<<(flag==0?"Yes":"No")<<endl;
	
	return ;
}
 
int main(){
	fastio();

	int t=1;
	//cin>>t;
	while(t--){
		solveTest();
 
	}
	return 0;
}

Measured memory_bytes: 256
#![allow(unused_imports)]
use itertools::Itertools;
use proconio::{input, marker::*};
use std::cmp::*;
use std::collections::*;
use superslice::*;

fn main() {
    input! {
        mut n: usize,
    }

    let mut ans = Vec::new();

    while n > 0 {
        n = n - 1;
        let a = n % 26;
        ans.push((a as u8 + b'a') as char);
        n /= 26;
    }

    ans.reverse();
    let ans = ans.iter().collect::<String>();
    println!("{}", ans);
}


Measured memory_bytes: 2188
#include <stdio.h>
#include <string.h>
int main(void) {
  int N;
  int H[20];
  int i,j; /*index*/
  int count = 0;
  int ans = 1;
  scanf("%d", &N);
  for (i = 0;i < N;++i) {
    scanf("%d",&H[i]);
  }
  for (i = 1;i < N;++i) {
    count = 0;
    for (j = 0;j < i;++j) {
      if (H[j] <= H[i]){
        ++count;
      }
    }
    if (count == i) {
      ++ans;
    }
  }
  printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
  int T_hp, T_at, A_hp, A_at;
  cin >> T_hp >> T_at >> A_hp >> A_at;
  do{
    A_hp -= T_at;
    if(A_hp <= 0){
      cout << "Yes" << endl;
      break;
    }
    T_hp -= A_at;
    if(T_hp <= 0){
      cout << "No" << endl;
      break;
    }
  }while(1);
  return 0;
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
int main() {
  int n;
  cin>>n;
  n=n%1000;
  n=1000-n;
  if(n==1000) cout<<0<<endl;
  else cout<<n<<endl;
}

Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>
#define rep(i, a) for (int i = 0; i < (a); i++)
using namespace std;

int main(){
	string s;
	cin >> s;
	for(int i = 0; i < 3; i++){
		if(s[i] == s[i+1]){
			cout << "Bad" << endl;
			return 0;
		}
	}
	cout << "Good" << endl;
}
	


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

int main(){
    int n; cin >> n;
    map<string,int> mp;
    rep(i,n){
        string s; cin >> s;
        mp[s]++;
    }
    int ans = 0;
    for(auto x : mp){
        ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 19120
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int[] a = new int[3];
		int count = 0;
		while(in.hasNextInt()) {
			a[count] = in.nextInt();
			count++;
		}
		in.close();
		Arrays.sort(a);
		System.out.println(a[0] + a[1]);
	}

}

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

int main() {
    // L + i - 1
    // 1 2 
    int N, L;
    cin >> N >> L;
    int sum = 0, dif = 1e9, ans;
    REP(i, 1, N+1) {
        sum += L + i - 1;
    }
    
    REP(i, 1, N+1) {
        int eat = L + i - 1;
        int rem = sum - eat;
        int nowDif = abs(sum - rem);
        if (nowDif < dif) {
            dif = nowDif;
            ans = rem;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
    int n,k;
    scanf ("%d%d",&n,&k);
    long long int score[n];
    
    for (int i = 0; i < n; i++) {
        scanf("%lld", &score[i]);
    }
    
    for (int i = 0, j = k; i < n-k; i++,j++) {
        if (score[j-k] < score[j]) {
            printf ("Yes\n");
        }
        else if (score[j-k] >= score[j]) {
            printf ("No\n");
        }
    }
    return 0;
}

Measured memory_bytes: 3196
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr ll inf = LLONG_MAX;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */

int main() {
    int n;
    cin >> n;
    vi a(n);
    rep(i, n) cin >> a[i];
    int k = 1;
    int count = 0;
    rep(i, n) {
        if(a[i]==k) k++;
        else count++;
    }
    if(count == n)count=-1;
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 4008
def main():
    A, B, C, X, Y = map(int, input().split())
    if A + B > C * 2:
        if X >= Y:
            if A > C * 2:
                print(X * C * 2)
            else:
                print((X - Y) * A + Y * C * 2)
        else:
            if B > C * 2:
                print(Y * C * 2)
            else:
                print((Y - X) * B + X * C * 2)
    else:
        print(X * A + Y * B)


main()


Measured memory_bytes: 3060
// CPP program to find the minimum number of 
// characters to be replaced in string S2, such 
// that S1 is a substring of S2 
  
#include<iostream>
#include <bits/stdc++.h> 
using namespace std; 
  
// Function to find the minimum number of 
// characters to be replaced in string S2, such 
// that S1 is a substring of S2 
int minimumChar(string T, string S) 
{ 
    // Get the sizes of both strings 
    int n = T.size(), m = S.size(); 
  
    int ans = INT_MAX; 
  
    // Traverse the string S2 
    for (int i = 0; i < m - n + 1; i++) { 
        int minRemovedChar = 0; 
  
        // From every index in S2, check the number of 
        // mis-matching characters in substring of 
        // length of S1 
        for (int j = 0; j < n; j++) { 
            if (T[j] != S[i + j]) { 
                minRemovedChar++; 
            } 
        } 
  
        // Take minimum of prev and current mis-match 
        ans = min(minRemovedChar, ans); 
    } 
  
    // return answer 
    return ans; 
} 
  
// Driver Code 
int main() 
{ 
    string T; 
    string S;
  
  getline(cin,S);
  getline(cin,T);
    cout << minimumChar(T, S); 
  
    return 0; 
}

Measured memory_bytes: 3556
from math import atan, degrees
a, b, x = map(int, input().split())
vol = a**2*b/2
if x < vol:
    ans = atan((a*b**2)/(2*x))
elif x > vol:
    ans = atan((-2/a**3)*(x-a**2*b))
else:
    ans = atan(b/a)
print(degrees(ans))

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

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

    rep1(i,10)
    {
        if (n%i==0 && n/i < 10)
        {
            cout << "Yes";
            return 0;
        }
    
    }
    cout << "No";
    return 0;
}


Measured memory_bytes: 256
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>

using namespace std;

int main() {
    string s;
    cin >> s;
    cout << 2018 << s.substr(4) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const long long INF = 1e10;
const long long MOD = 1e9+7;
using Graph = vector<vector<ll>>;
using pll = pair<ll, ll>;
template<class T> inline bool chmin(T &a, T b) { if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b) { if(a < b){ a = b; return true;} return false;}
ll ceilll(ll a, ll b) {return (a + b-1) / b;} // if(a%b == 0) (a/b) + 1
ll get_digit(ll a) {ll digit = 0; while(a != 0){a /= 10; digit++;} return digit;} // a != 0
template<typename T> void vecdbg(vector<T>& v){ rep(i, v.size()){cout << v[i] << " ";} br;}
template<typename T> void vecvecdbg(vector<vector<T>>& v){ rep(i, v.size()){rep(j, v[i].size()){cout << v[i][j] << " ";} br;}}

// 0 false, 1 true 
// string number to int : -48
// a to A : -32
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp
// global vector -> 0 initialization

int main() {
    std::cout << std::fixed << std::setprecision(15);
    ll n; cin >> n;
    ll flag = 0;
    string ans = "No";
    rep(i, n){
        ll d1, d2; cin >> d1 >> d2;
        if(d1 == d2){
            flag++;
            if(flag >= 3){
                ans = "Yes";
            }
        }else{
            flag = 0;
        }
    }
    cout << ans << endl;

}

Measured memory_bytes: 3632
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
long long N,X;
inline long long gcd(long long n, long long x){
    if(!x) return n;    
    return n<x?gcd(x,n):gcd(x,n%x);
}
int main(){
    scanf("%lld%lld",&N,&X);
    printf("%lld\n",3*(N-gcd(N,X)));
    return 0;
}

Measured memory_bytes: 256
// AOJ 407 Meeting Place		
// 2019.9.29

#include <stdio.h>

#define gc() getchar_unlocked()

int in() {   // 非負整数の入力
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

int main()
{
	int i, x, mi, ma, a, N, ans;

	N = in();
	ma = 0, mi = 2000;
	while (N--) {
		x = in();
		if (x < mi) mi = x;
		if (x > ma) ma = x;
	}
	x = (mi+ma)/2;
	ans = ma-x; if (x-mi > ans) ans = x-mi;
	
	x++; a = ma-x; if (x-mi > a) a = x-mi;
	if (a < ans) ans = a;

	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 2096
using System;

public class ITP1_1_B
{
    public static void Main(string[] args)
    {
//        var exStdIn = new System.IO.StreamReader( "input.txt" );
//        System.Console.SetIn( exStdIn );

        var x = int.Parse(Console.ReadLine());
        Console.WriteLine(x * x * x);
    }
}



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

using namespace std;
typedef         long long int   ll;

#define         input           freopen("input.txt","r",stdin)
#define         output          freopen("output.txt","w",stdout)
#define         si(a)           scanf("%d",&a)
#define         sii(a,b)        scanf("%d%d",&a,&b)
#define         siii(a,b,c)     scanf("%d%d%d",&a,&b,&c)
#define         pi(a)           printf("%d",a)
#define         spc             printf(" ")
#define         bl              printf("\n")
#define         here(a)         printf("#### %d ####",a)
#define         pii             pair<int,int>
#define         fr(i,n)         for(int i=0;i<n;i++)
#define         case(num)       printf("Case %d:",num)
#define         inf             1000000050
#define         MAX             100010*3


int main(){

    //input;
    //output;
    string s1,s2;

    cin>>s1>>s2;

    int len2 = s2.length();
    int len1 = s1.length()-len2;
    int cnt,mx,p;
    mx = -1;

    for(int i=0;i<=len1;i++){
        cnt = 0;

        for(int j=0;j<len2;j++){
            if(s1[i+j]==s2[j]) cnt++;
        }

        //if(cnt>mx){
            mx =  max(mx,cnt);
            //p = i;
        //}
    }
    //cout<<p<<endl;
    cout<<len2-mx<<endl;

    return 0;
}
/**
*/


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

using namespace std;
typedef long long ll;

void simulate_rev(vector<ll> &vs, int idx)
{
  for (int i = 0; i < vs.size(); i++)
  {
	if (i == idx)
	{
	  vs[i] += vs.size();
	}
	else
	{
	  vs[i]--;
	}
  }
}

int main()
{
  ll k;
  cin >> k;

  vector<ll> ary(50, 0);
  for (int i = 0; i < min(k, 50ll); i++)
  {
	ary[i] = 50 - i;
  }
  if (k > 50)
  {
	for (int i = 0; i < 50; i++)
	{
	  ary[i] += k / 50 - 1;
	}
	for (int i = 0; i < k % 50; i++)
	{
	  simulate_rev(ary, 49 - i);
	}
  }
  
  cout << 50 << endl;
  for (int i = 0; i < 50; i++)
  {
	if (i > 0) cout << " ";
	cout << ary[i];
  }
  cout << endl;
}


Measured memory_bytes: 256