akhauriyash/Code-Regression huggingface dataset:
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		List<Integer> m = new ArrayList<Integer>();
		List<Integer> f = new ArrayList<Integer>();
		List<Integer> r = new ArrayList<Integer>();

		 for(int i=0;;i++){
			 m.add(i, scan.nextInt());
			 f.add(i, scan.nextInt());
			 r.add(i, scan.nextInt());
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
		 }

		 for(int i=0;;i++){
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
			judgeGrade(m.get(i),f.get(i),r.get(i));
		 }
	}

	static void judgeGrade(int mid,int last,int re){
		if(mid==-1 || last==-1){
			System.out.println("F");
		}else if(mid+last >= 80){
			System.out.println("A");
		}else if(mid+last >= 65){
			System.out.println("B");
		}else if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		}

	}

}

Measured memory_bytes: 26344
S = list(input())
T = list(input())

cnt = 0
maxCnt = 0

for i in range(len(S) - len(T) + 1):
    for j in range(len(T)):
        if S[i+j] == T[j]:
            cnt += 1
    if cnt > maxCnt:
        maxCnt = cnt
    cnt = 0

print(len(T) - maxCnt)

Measured memory_bytes: 9056
let solve d n m =
  let dp = Array.make_matrix m (n + 1) max_int in
  for i = 0 to m - 1 do dp.(i).(0) <- 0 done;
  for j = 1 to n do dp.(0).(j) <- j done;
  for i = 1 to m - 1 do
    for j = 1 to n do
      dp.(i).(j) <-
        if j - d.(i) < 0 then dp.(i-1).(j)
        else min dp.(i-1).(j) (dp.(i).(j - d.(i)) + 1)
    done
  done;
  dp.(m-1).(n)

let () =
  let (n, m) = Scanf.scanf "%d %d " (fun n m -> n, m) in
  let d = Array.init m (fun _ -> Scanf.scanf "%d " (fun i -> i)) in
  solve d n m |> Printf.printf "%d\n"

Measured memory_bytes: 10380
#include<iostream>
 
using namespace std;
 
int gcd(int a, int b) {
	if (b == 0) {
		return a;
	}
	return gcd(b, a%b);
}
 
int gcdTree(int a, int b, int c) {
	return gcd(gcd(a, b), c);
}
 
int main() {
	int x;
	long total=0;
	cin >> x;
	for (int i = 1; i <= x; i++) {
		for (int j = 1; j <= x; j++) {
			for (int k = 1; k <= x; k++) {
				total += gcdTree(i, j, k);
			}
		}
	}
	cout << total << endl;
	return 0;
}

Measured memory_bytes: 3636
#include <algorithm>
#include <iostream>
#include <set>
#include <vector>

#define loop(i, times) for(int i = 0; i < times; i++)
#define seloop(i, start_index, end_index) for(int i = start_index; i < end_index; i++)
#define eqseloop(i, start_index, end_index) for(int i = start_index; i <= end_index; i++)

using namespace std;

class NyaGadgetVector
{
public:
	/**
	@brief 標準入力関数
	@note
	 標準入力から入力されたsize個の値をcollectionに格納する
	**/
	template<typename T> static void InputStream(vector<T>& collection, int size)
	{
		for (int i = 0; i < size; i++)
			cin >> collection[i];
	}
	/**
	@brief 最小値取得関数
	@note
	 collectionの要素の中で最大値を取得する
	**/
	template<typename T> static T Min(const vector<T>& collection)
	{
		T min = collection[0];
		for (const auto& e : collection)
		{
			if (e < min)
				min = e;
		}
		return min;
	}
	/**
	@brief 合計関数
	@note
	 collectionの要素を合計して返す(範囲はstart_index以上end_index未満)
	**/
	template<typename T> static T Sum(const vector<T>& collection, int start_index, int end_index)
	{
		int sum = 0;
		for (int i = start_index; i < end_index; i++)
			sum += collection[i];
		return sum;
	}
};

int main()
{
	int n; cin >> n;	// 木の本数
	int k; cin >> k;	// 飾り個数

	vector<int> tree_collection(n, 0);
	NyaGadgetVector::InputStream(tree_collection, n);
	sort(tree_collection.begin(), tree_collection.end());

	// 木の高さの差を計算する
	vector<int> difference_collection(n - 1, 0);
	loop(i, n - 1)
		difference_collection[i] = abs(tree_collection[i + 1] - tree_collection[i]);

	// BF法でパターンの最小値を見つける
	int pattern_length = k - 1;
	int search_times = difference_collection.size() - pattern_length + 1;
	vector<int>pattern_collection(search_times, 0);
	loop(i, search_times)
		pattern_collection[i] = NyaGadgetVector::Sum(difference_collection, i, i + pattern_length);

	std::cout << NyaGadgetVector::Min<int>(pattern_collection);
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define N 100000
int cx[2*N+5],cy[2*N+5],pre[2*N+5];
int Find(int x)
{
    return pre[x]==x? x : pre[x]=Find(pre[x]);
}
int main()
{
    int n,x,y;
    scanf("%d",&n);
    for(int i=1;i<=2*N;i++)pre[i]=i;
    for(int i=1;i<=n;i++)
    {
        scanf("%d%d",&x,&y);
        int fx=Find(x),fy=Find(y+N);
        if(fx!=fy)
            pre[fx]=fy;
    }
    for(int i=1;i<=N;i++)
        cx[Find(i)]++;
    for(int i=N+1;i<=2*N;i++)
        cy[Find(i)]++;
    ll ans=0;
    for(int i=1;i<=2*N;i++)
        ans+=1ll*cx[i]*cy[i];
    cout<<ans-n<<endl;
    return 0;
}


Measured memory_bytes: 2176
#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

const int MOD_TYPE = 1;
const ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
const int INF = (int)1e9;
const ll LINF = (ll)4e18;
const ld PI = acos(-1.0);
const ld EPS = 1e-11;

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << "\n"
#define Yes(n) cout << ((n) ? "Yes" : "No") << "\n"
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << "\n"
#define possible(n) cout << ((n) ? "possible" : "impossible") << "\n"
#define Yay(n) cout << ((n) ? "Yay!" : ":(") << "\n"
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << "\n";

vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

#pragma endregion

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

  int n, k;
  cin >> n >> k;
  ld p[200010];
  rep(i, n) cin >> p[i];
  ld csum[200010];
  csum[0] = 0;
  rep(i, n) csum[i + 1] = csum[i] + (p[i] + 1.0) / 2.0;
  ld Max = 0;
  for (int l = 0, r = k; r <= n; l++, r++)
  {
    Max = max(Max, csum[r] - csum[l]);
  }
  cout << Max << endl;
  return 0;
}


Measured memory_bytes: 6528
import functools

import os
import sys

sys.setrecursionlimit(10000)
INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


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


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def inpm(line):
    return [inp() for _ in range(line)]


def inpfm(line):
    return [inpf() for _ in range(line)]


def inpsm(line):
    return [inps() for _ in range(line)]


def inlm(line):
    return [inl() for _ in range(line)]


def inlfm(line):
    return [inlf() for _ in range(line)]


def inlsm(line):
    return [inls() for _ in range(line)]


def Yesif(cond):
    print('Yes' if cond else 'No')


def YESIF(cond):
    print('YES' if cond else 'NO')


def yesif(cond):
    print('yes' if cond else 'no')


s = input()
print(s.replace(',',' '))


Measured memory_bytes: 3572
#include<bits/stdc++.h>
#define LL long long
using namespace std;

int cnt[15]={0,9,26,75,217,629,1826,5307,15438,44941,31532},sum[15];
int tot,a[15],n;

bool check(LL a)
{
	int t,las=a%10,c=0;
	while(a) {
		t=a%10;
		if(abs(t-las)>=2) return 0;
		a/=10;
		las=t;
		c++;
	}
	cnt[c]++;
	return 1;
}

void dfs(int now,int d)
{
	if(now==d+1) {
		tot++;
		if(tot==n) {
			for(int i=1;i<=d;++i) printf("%d",a[i]);
		}
		return ;
	}
	if(now==1) {
		for(int i=1;i<=9;++i) {
			a[now]=i;
			dfs(now+1,d);
		}
	}
	else {
		if(a[now-1]==0) {
			a[now]=0;
			dfs(now+1,d);
			a[now]=1;
			dfs(now+1,d);
		}
		else if(a[now-1]==9) {
			a[now]=8;
			dfs(now+1,d);
			a[now]=9;
			dfs(now+1,d);
		}
		else {
			for(int i=a[now-1]-1;i<=a[now-1]+1;++i) {
				a[now]=i;
				dfs(now+1,d);
			}
		}
	}
}

int main()
{
	for(int i=1;i<=10;++i) sum[i]=sum[i-1]+cnt[i];
	cin>>n;
	for(int i=1;i<=10;++i) {
		if(sum[i]<n) continue;
		else {
			n=n-sum[i-1];
			dfs(1,i);
			break;
		}
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<cmath>
#include<unordered_set>
#include<map>
#include<cstring>
#include<utility>
#include<string>
#include<iomanip>
#include<unordered_map>
using namespace std;
#define int long long
#define pb push_back
#define ppb pop_back
#define fr(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
#define LM LONG_MAX
#define LS LONG_MIN
#define cfM 998244353
#define ccM 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define inf 10000000000000000
#define sp setprecision(9)
float pi=3.14159265;
int max(int b,int a)
{if(b>a)return b;else return a;}
int min(int b,int a)
{if(b<a)return b;else return a;}
int ab(int b)
{if(b<0) return (-1*b);else return(b);}
void print(vector<int>&v)
{
	for(int i=0;i<v.size();i++)
		cout<<v[i]<<" ";
	cout<<endl;}
void print(int arr[],int n)
{
	for(int i=0;i<n;i++)
		cout<<arr[i]<<" ";}
int32_t main()
{
	int n;
	cin>>n;
	int k=n-1;
	int b[k];
	for(int i=0;i<k;i++)
		cin>>b[i];
	int a[n];
	a[n-1]=b[k-1];
	for(int i=n-2;i>0;i--)
	{
		if(b[i]<=b[i-1])
		{
			a[i]=b[i];
			a[i-1]=b[i-1];
		}
		else
		{
			a[i]=b[i-1];
			a[i-1]=b[i-1];
		}
	}
	//print(a,n);
	int sum=0;
	fr(i,n)
	sum+=a[i];
	if(n==2)
		sum=2*b[0];
	cout<<sum<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1e9 + 7;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<class T>
istream& operator >> (istream& is, vector<T>& v)
{
	for (auto &i : v) is >> i;
	return is;
}
template<class T>
ostream& operator<<(ostream& os, vector<T>& v)
{
	const string delimiter = "\n";
	REP(i, v.size())
	{
		os << v[i];
		if (i != v.size() - 1) os << delimiter;
	}
	return os;
}
/*--------------------template--------------------*/

const ll INF = 1e16;

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	int n; cin >> n;
	vector<vi> dist(n, vi(n));
	cin >> dist;
	auto cp = dist;
	REP(k, n)REP(i, n)REP(j, n) chmin(dist[i][j], dist[i][k] + dist[k][j]);
	if (cp != dist)
	{
		cout << -1 << endl;
		return 0;
	}
	ll sum = 0;
	REP(i, n)REP(j, n) sum += dist[i][j];
	REP(i, n)REP(j, n)
	{
		if (i == j) continue;
		bool f = false;
		REP(k, n)
		{
			if (i == k || j == k) continue;
			if (dist[i][j] == dist[i][k] + dist[k][j]) f = true;
		}
		if (f) sum -= dist[i][j];
	}
	cout << sum / 2 << endl;
	return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;
 
int main()
{
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i, n) cin >> v[i];
  sort(v.begin(), v.end());
  double ans = 0.5 * (v[0] + v[1]);
  rep(i, n) {
    if (i==0 || i==1) continue;
    ans = 0.5 * (ans+v[i]);
  }
  printf("%.10f", ans);
  return 0;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap};

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;

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

    let mut ans = 0;
    for l in 0..n {
        let s = s[l..n].iter().cloned().collect::<Vec<_>>();
        let n = s.len();

        let mut a = vec![0; n];
        a[0] = s.len();
        let mut i = 1;
        let mut j = 0;
        while i < s.len() {
            while i + j < s.len() && s[j] == s[i + j] {
                j += 1;
            }
            a[i] = j;
            if j == 0 {
                i += 1;
                continue;
            }
            let mut k = 1;
            while i + k < s.len() && k + a[k] < j {
                a[i + k] = a[k];
                k += 1;
            }
            i += k;
            j -= k;
        }
        let mut am = vec![0; n];
        for i in (0..n).rev() {
            if i + 1 < n {
                am[i] = am[i + 1];
            }
            am[i] = max(am[i], a[i]);
        }
        for i in 1..n {
            if am[i] >= i {
                ans = max(ans, i);
            }
        }
    }
    println!("{}", ans);
}


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

#pragma GCC optimize("O3")
#define MOD 1000000007
#define pb push_back
#define fi first
#define se second
#define fr front()
#define ba back()
#define tp top()
#define mem(x,n) memset(x,n,sizeof(x));
#define sz(x) (int)((x).size())
#define all(x) (x).begin(),(x).end()
#define foreach(it,l) for(auto it=l.begin();it!=l.end();it++)
#define pnl printf("\n")
#define len(x) x.length()

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> pii;
typedef pair<pii,int> piii;
const int inf=(1<<30);
const LL llinf=(1ll<<60);
const double eps=(1e-10);
//const double pi=2*acos(0.0);
//const double GOLD=((1+sqrt(5))/2);
const int xx[8]={1,0,-1,0,1,-1,1,-1};
const int yy[8]={0,1,0,-1,-1,1,1,-1};

/* \( ·w·)~ Clapie ~(·w· )/ */

int n;
LL val[100005];
LL memo[100005];

LL dp(int idx){
	if(idx>n) return inf;
	if(idx==n-1) return 0;
	if(memo[idx]!=-1) return memo[idx];
	LL ret=inf;
	ret=min(dp(idx+1)+abs(val[idx]-val[idx+1]),dp(idx+2)+abs(val[idx]-val[idx+2]));
	return memo[idx]=ret;
}

int main(){
	mem(memo,-1);
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%lld",&val[i]);
	}
	LL ans=dp(0);
	printf("%lld\n",ans);
}

Measured memory_bytes: 4096
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

const (
	initialBufSize = 100000
	maxBufSize     = 1000000
)

var sc *bufio.Scanner

func initScanner(r io.Reader) *bufio.Scanner {
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	return sc
}

func main() {
	sc = initScanner(os.Stdin)
	parseProblem()
}

func parseProblem() {
	n := scanInt(sc)
	as := nextIntSlice(sc, n)
	exNums := make([]int, 3)
	for _, v := range as {
		ex := exOf(v, 2)
		exNums[min(2, ex)]++
	}
	if exNums[0]+((exNums[1]+1)/2)&1 > exNums[2]+1 {
		fmt.Println("No")
		return
	}
	fmt.Println("Yes")
	return
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func exOf(n, p int) (ex int) {
	c := n
	for c%p == 0 {
		ex++
		c /= p
	}
	return ex
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	a, _ := strconv.Atoi(sc.Text())
	return int(a)
}

func nextString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func nextIntSlice(sc *bufio.Scanner, n int) (a []int) {

	a = make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt(sc)
	}
	return a
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}


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

int main(){
  int a,b,c;
  char c1,c2;

  int rect=0, loz=0;
  while( cin>>a>>c1>>b>>c2>>c && (a|b|c) ){
    if( a*a + b*b == c*c ){
      rect++;
    }else if(a==b) {
      loz++;
    }
  }
  cout << rect << endl << loz << endl;
  return 0;
}

Measured memory_bytes: 0
from collections import deque
K = int(input())
if K<10:
    print(K)
else:
    dq = deque([i for i in range(1, 10)])
    k = 10
    while k<=K:
        x = dq.popleft()
        d = x%10
        if d!=0:
            dq.append(10*x + (d-1))
            k += 1
        dq.append(10*x + d)
        k += 1
        if d!=9:
            dq.append(10*x + (d+1))
            k += 1
    print(dq[-(k-K)])

Measured memory_bytes: 6132
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	int a[n+1];
	int b[n+1];
	int c[n+1];
	int sum=0;
	for(int i=1;i<=n;i++){
		cin >> a[i];
	}
	for(int i=1;i<=n;i++){
		cin >> b[i];
	}
	for(int i=1;i<n;i++){
		cin >> c[i];
	}
	for(int i=1;i<=n;i++){
		if(i!=1&&a[i]-1==a[i-1])
		sum+=c[a[i-1]];
		sum+=b[a[i]];
	}
	cout << sum;
	return 0;
}

Measured memory_bytes: 256
//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n↑入力 ↓出力');
  Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var one = nextStrArray();
  var S = one[0];
  var T = one[1];
  one = nextIntArray();
  var A = one[0];
  var B = one[1];
  var U = next();
  if(S == U){
    A--;
  }else{
    B--;
  }
  myout(A + " " + B);
}



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

int main(){
  int maxi = 0;
  int N;
  cin >> N;
  int V[N];
  for(int i = 0;i<N;i++){
    cin >> V[i];
  }
  int C[N];
  for(int i=0;i<N;i++){
    cin >> C[i];
  }
  for(int i=0;i<N;i++){
    if(V[i] - C[i] > 0){
      maxi += V[i] - C[i];
    }else{
    }
  }
  cout << maxi << endl;
}
      
      

Measured memory_bytes: 256
from collections import Counter

n = int(input())
d = list(map(int, input().split()))

m = int(input())
t = list(map(int, input().split()))

d_cnt = Counter(d)
t_cnt = Counter(t)

flag = True
for k, v in t_cnt.items():
    if k in d_cnt.keys():
        if v > d_cnt[k]:
            flag = False
            break
    
    else:
        flag = False
        break
print("YES" if flag else "NO")



Measured memory_bytes: 57056
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>

using ll = long long;

using namespace std;

struct coin{ ll a, b, c; };

int main() {
    int x, y, z;
    cin >> x >> y >> z;
    vector<coin> coins(x + y + z);
    for (auto &ci:coins) {
        cin >> ci.a >> ci.b >> ci.c;
    }
    sort(coins.begin(), coins.end(), [](coin l, coin r) {
        return l.a - l.b > r.a - r.b;
    });
    auto cmpac = [](coin l, coin r) {
        return l.a - l.c > r.a - r.c;
    };
    auto cmpbc = [](coin l, coin r) {
        return l.b - l.c > r.b - r.c;
    };
    priority_queue<coin, vector<coin>, decltype(cmpac)> acpq(cmpac);
    priority_queue<coin, vector<coin>, decltype(cmpbc)> bcpq(cmpbc);
    ll prev = 0;
    for (int i=0; i<x; i++) {
        acpq.push(coins[i]);
        prev += coins[i].a;
    }
    vector<ll> cnt(z+1, prev);
    for (int i=0; i<z; i++) {
        if (cmpac(acpq.top(), coins[i+x])) {
            prev += coins[i+x].c;
        } else {
            prev -= acpq.top().a;
            prev += acpq.top().c;
            prev += coins[i+x].a;
            acpq.pop();
            acpq.push(coins[i+x]);
        }
        cnt[i+1] = prev;
    }
    prev = 0;
    for (int i=x+y+z-1; i>=x+z; i--) {
        bcpq.push(coins[i]);
        prev += coins[i].b;
    }
    ll ans = cnt[z] + prev;
    for (int i=z-1; i>=0; i--) {
        if (cmpbc(bcpq.top(), coins[i+x])) {
            prev += coins[i+x].c;
        } else {
            prev -= bcpq.top().b;
            prev += bcpq.top().c;
            prev += coins[i+x].b;
            bcpq.pop();
            bcpq.push(coins[i+x]);
        }
        ans = max(ans, cnt[i] + prev);
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 6900
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return "".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

s = list(input())[:-1]

ans = ""

po = [0 for i in range(26)]

if jo(s) == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()

if len(s) == 26:
    for i in range(25,-1,-1):
        if i == 25:
            po[ord(s[-1])-97] = 1
            continue
        else:
            if s[i] > s[i+1]:
                po[ord(s[i])-97] = 1
                po[ord(s[i+1])-97] = 1
            else:
                ans = jo(s[:i])
                for j in range(26):
                    if po[j] and ord(s[i])-97 < j:
                        ans += chr(97+j)
                        break
                

                break


else:
    for i in range(len(s)):
        on = ord(s[i])-97
        if po[on] == 0:
            ans += s[i]
            po[on] = 1
    for j in range(26):
        if po[j] == 0:
            ans += chr(97+j)
            break

print(ans)



Measured memory_bytes: 3316
import sys

def stdin_parse_int():
    a = list(map(int,input().split()))
    return a

list = stdin_parse_int()
A = list[0]
B = list[1]
K = list[2]

if A > K:
    print(str(A-K) + " " + str(B))
elif A+B > K:
    print(str(0) + " " + str(A+B-K))
else:
    print("0 0")


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

const int N = 1e5;
int n;
ll m, k;
ll a[N];
ll d[N];
int o[N];

vector<int> mult(vector<int> &a, vector<int> &b){ 
  auto res = a;
  for(int i = 0; i < n; i++) {
    res[i] = b[a[i]];
  }
  return res;
}

int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n;
  for(int i = 0; i < n; i++) {
    cin >> a[i];
    if(i) d[i] = a[i] - a[i - 1];
  }
  cin >> m >> k;
  vector<int> ord(n);
  iota(begin(ord), end(ord), 0);
  for(int i = 0; i < m; i++) {
    cin >> o[i], o[i]--;
    swap(ord[o[i]], ord[o[i] + 1]);
  }
  vector<int> b(n);
  for(int i = 0; i < n; i++) {
    b[ord[i]] = i;
  }
  vector<int> ans(n);
  iota(begin(ans), end(ans), 0);
  while(k) {
    if(k & 1) ans = mult(ans, b);
    b = mult(b, b);
    k >>= 1;
  }
  vector<ll> x(n);
  for(int i = 0; i < n; i++) {
    x[ans[i]] = d[i];
  }
  for(int i = 1; i < n; i++) a[i] = a[i - 1] + x[i];
  for(int i = 0 ;i < n; i++) cout << a[i] << endl;
}



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

int main()
{
    ll x;
    cin >> x;
    ll y;
    y = 2 * (x / 11);
    if (x % 11 == 0)
    {
        cout << y << endl;
    }
    else
    {
        if (x % 11 <= 6)
        {
            cout << y + 1 << endl;
        }
        else
        {
            cout << y + 2 << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();

		Double c = Double.valueOf(a) / Double.valueOf(b);

		System.out.println(a / b + " " + a % b + " " + String.format("%.8f", c));

	}

}



Measured memory_bytes: 26568
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

n=int(input())

l=[list(map(str,input().split())) for _ in range(n)]

cnt=0

for i in range(n):
	if l[i][1]=="JPY":
		cnt+=float(l[i][0])
	else:
		cnt+=float(l[i][0])*380000
		
print(cnt)

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

int main(){
	string S,T;
	cin>>S>>T;
	
	if(T.size()-S.size()!=1)  cout<<"No"<<endl;
	
	for(int i=0;i<S.size();i++){
		if(S[i]!=T[i]){
			cout<<"No";
			return 0;
		}
	}
	
	cout<<"Yes"<<endl;
	return 0;
} 

Measured memory_bytes: 3624
#include <stdio.h>

int main(void){
	int N;
	scanf("%d",&N);
	int i;
	long long T[N];
	for(i=0;i<N;i++)scanf("%lld",&T[i]);
	//最小公倍数を求める
	
	long long LCM(long long a,long long b){
		long long tmp;
		long long x = a;
		long long y = b;
		if(a<b){
			tmp = a;
			a = b;
			b = tmp;
		}
		long long r = a % b;
		while( r!=0){
			a = b;
			b = r;
			r = a % b;
		}
		return (x/b)*y;
	}
	long long temp = T[0];
	for(i=0;i<N;i++){
		temp = LCM(temp,T[i]);
	}
	printf("%lld",temp);
}
	

Measured memory_bytes: 128
n = int(input())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
def D(p):
    s = 0
    for i in range(n):
        s += (abs(x[i]-y[i]))**p
    return s**(1/p)
L = []
for i in range(n):
    L.append(abs(x[i]-y[i]))
print(D(1))
print(D(2))
print(D(3))
print(max(L))


Measured memory_bytes: 5648
#include <bits/stdc++.h>
using namespace std;
int main() {
  char c;
  cin >> c;
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') {
    cout << "vowel";
  } else {
    cout << "consonant";
  }
}

Measured memory_bytes: 256
// AOJ 0553: Dungeon
// 2018.1.28 bal4u

#include <stdio.h>

typedef struct { long long d; int h; } Q;
Q q[1000002]; int top, end;

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

int main()
{
    int N, H, i, d, h, ans;
	long long s, t, sd, max;

	N = in(), H = in();
	ans = 0, sd = 0, max = H, top = end = 0;
	for (i = 1; i < N; i++) {
		d = in(), h = in();
		while (top != end && h > q[end-1].h) end--;
		q[end].d = sd, q[end++].h = h;
		sd += d;

		while (sd >= max) {
			s = max;
			while (top != end && s + q[top].h - q[top].d > H) {
				if (max < q[top].d + H) max = q[top].d + H;
				top++;
			}
			if (top != end) {
				h = q[top].h;
				if (max < s + h) max = s + h;
				t = (q[top].d + H - max)/h;
				if (t > (sd - max)/h) t = (sd - max)/h;
				if (t > 0) ans += (int)t, max += t*h;
			}
			ans++;
		}
	}
	printf("%d\n", ans);
	return 0;
}



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

int main(){
	int n; scanf("%d", &n);
    int k=20;
    while(!(n&(1<<k))) k--;
    printf("%d %d\n", k+1, 2*k+__builtin_popcount(n)-1);
    for(int i=0; i<k; i++){
      printf("%d %d %d\n", i+1, i+2, 0);
      printf("%d %d %d\n", i+1, i+2, 1<<i);
    }
    int a=1<<k;
    for(int i=k-1; i>=0; i--){
      if((1<<i)&n){
        printf("%d %d %d\n", i+1, k+1, a);
        a+=1<<i;
      }
    }
}


Measured memory_bytes: 256
h,w,d=gets.split.map(&:to_i)
c=[]
h.times{|i|gets.split.map.with_index{|a,j|c[a.to_i-1]=[i,j]}}
b=[0]*d
(h*w-d).times{|k|b[k+d]=b[k]+(c[k][0]-c[k+d][0]).abs+(c[k][1]-c[k+d][1]).abs}
gets.to_i.times{l,r=gets.split;p b[r.to_i-1]-b[l.to_i-1]}

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

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int a, b, c, d;
  while (cin >> a >> b >> c >> d) {
    const int N = 111;
    int cnt[N];
    fill(cnt, cnt + N, 0);
    for (int i = a; i < b; ++i) {
      ++cnt[i];
    }
    for (int i = c; i < d; ++i) {
      ++cnt[i];
    }
    cout << count(cnt, cnt + N, 2) << endl;
  }
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define ll long long int
using namespace std;

int main(void){
    ll N,ans=1;
    string S;

    cin >> N >> S;
    FOR(i,1,N)
        if(S[i-1] != S[i]) ans++;

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 512
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#define ll long long
using namespace std;
double pi=acos(-1);

int main(){
  double A,B,H,M;
  cin>>A>>B>>H>>M;
  double a,b,th,ans;
  a=pi*(60*H+M)/360;
  b=pi*M/30;
  th=a-b;
  ans=sqrt(A*A+B*B-2*A*B*cos(th));
  printf("%.12f\n",ans);
}

Measured memory_bytes: 4220
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <random>
#include <ctime>
#include <sstream>
#include <numeric>
using namespace std;

int main(){
    int n ;
    cin >> n ;
    vector<int64_t> a(n,0) ;
    vector<int64_t> plus(0) ;
    vector<int64_t> minus(0);
    for (size_t i = 0; i < n; i++)
    {
        cin >> a.at(i) ;
        if (a.at(i) < 0)
        {
            minus.push_back(a.at(i));
            a.at(i) *= -1 ;
        }else
        {
            plus.push_back(a.at(i)) ;
        }
        
    }
    int64_t ans = 0 ;
    for (size_t i = 0; i < n; i++)
    {
        ans += a.at(i) ;
    }
    
    if (minus.size() % 2 == 1)
    {
        sort(a.begin(),a.end()) ;
        ans -= 2*a.at(0) ;
    }
    cout << ans << endl ;
}

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

int main(){
	string S, T;
	cin >> S >> T;
	long long ans = 0;
	for(long long i = 0; i < S.size(); i++) {
		if(S[i] != T[i]) {
			ans++;
		}
	}
	cout << ans << endl;

}

Measured memory_bytes: 3860
#include <bits/stdc++.h>
using namespace std;
int main() {
  string A, B, C;
  cin >> A >> B >> C;
  if (A.at(A.size() - 1) == B.at(0) && B.at(B.size() - 1) == C.at(0)) {cout << "YES" << endl;}
  else {cout << "NO" << endl;}
}

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

using namespace std;

int main( void ){
	long long int power = 1;
	long long int mod = 1e9 + 7;
	long long int n;
	cin >> n;

	for( long long int i = 1; i <= n; i++ ){
		power = power * i % mod;
	}

	cout << power << endl;

	getchar();getchar();
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cmath>
#include<map>
#include<stack>
#include<vector>
#include<queue>
#include<set>
#include<utility>
#define INF 0x3f3f3f3f
#define PI acos(-1)
#define ll long long
using namespace std;
ll s[200005][3];
ll num[200005];
ll a[200005];
ll c(ll n) {
	if (n<2) {
		return 0;
	}
	return n * (n - 1) / 2;
}
int main() {
	//std::ios::sync_with_stdio(false);
	memset(num, 0, sizeof(num));
	memset(a, 0, sizeof(a));
	int n;
	cin >> n;
	for (int i = 0; i < n;i++) {
		cin >> s[i][0];
		num[s[i][0]]++;
	}
	ll sum = 0;
	for (int i = 0; i < n;i++) {
		s[i][1] = c(num[s[i][0]]);
		s[i][2] = c(num[s[i][0]]-1);
		a[s[i][0]] = s[i][1];
	}
	for (int i = 1; i <= n;i++) {
		sum += a[i];
	}
	for (int i = 0; i < n;i++) {
		cout << sum - s[i][1] + s[i][2] << endl;
	}
	return 0;
}


Measured memory_bytes: 10368
using System;
using static System.Console;

namespace gositigo{
  class Program{
    static void Main(string[] args)
    {
      String[] s = ReadLine().Split(' ');
      int[] n = new int[3];
      for(int i = 0; i < 3; i++){
        n[i] = int.Parse(s[i]);
      }
      string ans = "NO";
      
      if(n[0] + n[1] + n[2] == 17){
        if(n[0] + n[1] == 12){
          if(n[2] == 5) {
            WriteLine("YES");
            return;
          }
        }else if(n[0] + n[1] == 10){
          if(n[2] == 7) {
            WriteLine("YES");
            return;
          }
        }
      }
      WriteLine(ans);
      
    }
  }
}

Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i= (a); i < (b); ++i)
typedef long long ll;
typedef pair<int,int> P;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int main() { string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  cout << s1[0] << s2[0] << s3[0] << endl;
}

Measured memory_bytes: 256
def m():
    K, T = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort(reverse=True)
    a = A[0]
    b = sum(A[1:])
    if (a-b) <= 1:
        return 0
    else:
        return (a-b)-1


print(m())


Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define ill long long
#define fcout cout << fixed << setprecision(10)
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<string> v(n);
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  rep(i, 0, n) {
    cin >> v[i];
    if(v[i] == "AC") AC++;
    else if(v[i] == "WA") WA++;
    else if(v[i] == "TLE") TLE++;
    else RE++;
  }
  cout << "AC x " << AC << "\nWA x " << WA << "\nTLE x " << TLE << "\nRE x " << RE << "\n"; 
}


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

int main() {
  int N, M;
  cin >> N >> M;
  
  vector<int> A(M);
  
  for (int i = 0; i < M; i++) {
    cin >> A.at(i);
  }
  
  int sum = 0;
  
  for (int i = 0; i < M; i++) {
    sum += A.at(i);
  }
  
  int days;
  
  if(N - sum >= 0) { 
    cout << N -sum << endl;
  }
  else {
    cout << "-1" << endl;
  }  
}

Measured memory_bytes: 3636
#include <iostream>
using namespace std;
int d[11];
int main()
{
  int A,B,C;
  cin >> A >> B >> C;
  d[A]++;
  d[B]++;
  d[C]++;
  if( d[5] == 2 && d[7] == 1 ){
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;

/**
 * https://atcoder.jp/contests/abc157/tasks/abc157_c
 *
 */
public final class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int scale = scanner.nextInt();
			int max = scanner.nextInt();

			if (max == 0 && scale == 1) {
				System.out.println("0");
				return;
			}

			int[] values = new int[scale];
			for (int i = 0; i < values.length; i++) {
				values[i] = -1;
			}

			for (int i = 0; i < max; i++) {
				int s = scanner.nextInt() - 1;
				int c = scanner.nextInt();

				if (values[s] == -1) {
					values[s] = c;
				} else if (values[s] != c) {
					System.out.println("-1");
					return;
				} else {
					values[s] = c;
				}
			}

			if (scale != 1 && values[0] == 0) {
				System.out.println("-1");
				return;
			}

			for (int i = 0; i < values.length; i++) {
				if (values[i] != -1) {
					break;
				}
				if (i == 0) {
					values[i] = 1;
				} else {
					values[i] = 0;
				}
			}

			StringBuilder sb = new StringBuilder();
			for (int i = 0; i < values.length; i++) {
				sb.append(values[i] == -1 ? "0" : Integer.toString(values[i]));
			}
			System.out.println(Integer.parseInt(sb.toString()));
		}
	}

}


Measured memory_bytes: 23764
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        int c = sc.nextInt();
        while (c != 0) {
            int n = sc.nextInt();
            int k = sc.nextInt();
            int h[] = new int[n];
            int d[] = new int[n - 1];
            int sum = 0;
            for (int i = 0; i < n; i++) {
                h[i] = sc.nextInt();

            }
            if (n <= k) {
                System.out.println(0);
            } else {

                for (int i = 0; i < n - 1; i++) {
                    d[i] = h[i + 1] - h[i];
                    sum += d[i];
                }if(k<=2){
                d[0] = 0;
                d[d.length - 1] = 0;
                }
                Arrays.sort(d);
                for (int i = 0; i < k - 1; i++) {
                    sum -= d[d.length - 1 - i];
                }
                System.out.println(sum);

            }
            c--;
        }
    }
}

Measured memory_bytes: 15000
def InsertionSort(A):
    print(' '.join(map(str, A)))
    for i in range(1,len(A)):
        key = A[i]
        j = i - 1
        while j >= 0 and A[j] > key:
            A[j+1] = A[j]
            j-=1
            A[j+1] = key
        print(' '.join(map(str, A)))

    return A

input()
a=[i for i in map(int, input().split())]
InsertionSort(a)


Measured memory_bytes: 5608
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
    string str;
    int n=0,ans = 0;
    char D;
    while(cin >> str){
        int num=0;
        if(n%2==0){
            num = atoi(str.c_str());
            if(n == 0)ans = num;
            else if(D == '+'){
                ans += num;
            }
            else if(D == '-'){
                ans -= num;
            }
            else if(D == '*'){
                ans *= num;
            }
            else if(D == '/'){
                ans /= num;
            }
        }
        else{
            D = str[0];
            if(D == '='){
                goto end;
            }
        }
        n++;
    }
    end:;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1188
#include <bits/stdc++.h>
#define INF 2e9
#define x first
#define y second
using namespace std;
typedef pair<int,int> P;
P in[5002];
int n,m;
int main(){
  cin>>n>>m;
  for(int i=0;i<n;i++) cin>>in[i].x>>in[i].y;
  sort(in,in+n);

  int a,b,c,d;  
  while(m--){
    scanf("%d%d%d%d",&a,&b,&c,&d);
    int cnt=0;
    for(int i=0;i<n;i++){
      if((a<=in[i].x&&in[i].x<=c)&&(b<=in[i].y&&in[i].y<=d))cnt++;
    }
    cout <<cnt<<endl;
  }
  return 0;
}

Measured memory_bytes: 1288
#include<stdio.h>
#include<stdlib.h>
int a,b,c,i;
int main(){
	scanf("%d%d%d",&a,&b,&c);
	for(i=1;i<=1000;i++)
		if(a*i%b==c)puts("YES"),exit(0);
	puts("NO");
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
const long long INF = 1e7 + 1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector < pair<ll, ll > > vp;
typedef vector <string> vs;
typedef vector <char> vc;
typedef list <ll> lst;
 
ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
//char c;
 
#define Endl endl
 
/*--------------------template--------------------*/
 
bool check(string a)
{
	int ize = a.size() / 2;
	int q = a.size() % 2;
	if (q == 1) {
		return 0;
	}
	string s = a.substr(0, ize);
	string t = a.substr(ize, ize);
	if (s == t) {
		return 1;
	} else {
		return 0;
	}
}
 
int main()
{
	cin >> s;
	while (1) {
		s.pop_back();
		if (check(s)) {
			cout << s.size() << endl;
			break;
		}
	}
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <numeric>

using namespace std;

int main() {
  int N, M, e[9][9]{}, a, b, p[8], ans{};
  cin >> N >> M;
  while (cin >> a >> b) {
    e[a][b] = e[b][a] = 1;
  }
  iota(begin(p), begin(p) + N, 1);
  do {
    ans += [&]() {
      for (int i = 0; i != N - 1; ++i)
        if (!e[p[i]][p[i + 1]]) return 0;
      return 1;
    }();
  } while (next_permutation(begin(p) + 1, begin(p) + N));
  cout << ans << endl;
}


Measured memory_bytes: 3620
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>

using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

int main() {

    ll A,B,C;
    cin >> A >> B >> C;
    ll out = C-A+B;
    if(out<0) out = 0;
    cout << out << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(void){
	int a,b,c,k;
	cin >> a;
	
	if(a%2==0){
		cout << (a/2)*(a/2) << endl;
	}
	else{
		cout << (a/2)*(a/2+1) << endl;
	}
	
	
return 0;
}

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

using namespace std;

#define MOD 1000000007

template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {
	for (T& x : vec) is >> x;
	return is;
}

int d[100000 * 3];

int main() {
	int n;
	int min = 1000, max = 0;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		int buf;
		cin >> buf;
		if (buf > max) max = buf;
		if (buf < min) min = buf;
	}
	cout << max - min << endl;
}

Measured memory_bytes: 256
/******************************************
* AUTHOR : cf/villazer *
******************************************/
#include <iostream>
#include<iomanip>
using namespace std;
#define N 100005
#define mod 1000000007
#define dd double
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i,a,b) for(int i=a;i<b;i++)
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define F first
#define S second
#define debug(x) cout<<(#x)<<" is "<<(x)<<endl
#define lb(arr,n,x) lower_bound(arr,arr+n,x)-arr
#define ub(arr,n,x) upper_bound(arr,arr+n,x)-arr
#define endl "\n"
#define PI 3.14159265358979323846  /* pi */
#define sqr(x) (x)*(x)
#define all(v)  ((v).begin()),((v).end())
#define degreesToRadians(angleDegrees) (angleDegrees * PI / 180.0) // Converts degrees to radians.
#define radiansToDegrees(angleRadians) (angleRadians * 180.0 / PI) // Converts radians to degrees.

typedef long long ll;
typedef long double ld;
//Calculation of (x^y)%mm



int main() {




ll r;
cin>>r;
ld x = 2*PI*r;
cout<<setprecision(18)<<x<<endl;

return 0;
}

Measured memory_bytes: 3784
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(int i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(int i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)


typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vvi;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=100000000;
const double EPS=1e-10;
//int mod=1000000007


int mone[] ={10,50,100,500};


int main(){
	int p;
	bool f = false;
	while(cin>>p && p > 0){
		if(f) cout<<endl;
		f = true;
		int sum = 0;
		vi v(4,0);
		for(int i = 0; i < 4; i++) cin>>v[i],sum += v[i]*mone[i];
		sum -= p;
		//cout<<sum<<endl;
		vi ans(4,0);
		for(int i = 3; i >= 0; i--){
			ans[i] += sum / mone[i];
			sum %= mone[i];
		}
		for(int i = 0; i < 4; i++){
			if(v[i]-ans[i] > 0) cout<<mone[i]<<" "<<v[i]-ans[i]<<endl;
		}
	}
}

Measured memory_bytes: 1192
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define sort(a)         sort((a).begin(), (a).end())
#define uniq(a)         SORT(a);(a).erase(unique((a).begin(), (a).end()), (a).end())
#define reverse(a)      reverse((a).begin(), (a).end())
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define Yes()           printf("Yes\n")
#define No()            printf("No\n")
#define YES()           printf("YES\n")
#define NO()            printf("NO\n")
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }

using namespace std;
using ll = long long;
using P = pair<ll,ll>;

const ll MOD = 1000000007; // 10^9 + 7

void solve() {
  int n, k; cin >> n >> k;
  if ((n + 1) / 2 >= k) YES();
  else NO();
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 632