akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main(){
  
  string S;
  cin>>S;
  bool ok = true;
  
  for(int i=0;i<S.size();i+=2){
        if(S.at(i)=='L'){
          ok = false;
        }
  }
  for(int j=1;j<S.size();j+=2){
    if(S.at(j)=='R'){
      ok = false;
    }
  }
        
  
  if(ok){
    cout<<"Yes"<<endl;
  }
  
  else{
    cout<<"No"<<endl;
  }
  
  return 0;
}

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

int main(void)
{
  char s[101];
  cin>>s;
  int count=0;
  for(int i=0,j=strlen(s)-1;i<strlen(s)/2;i++,j--)
  {
    if(s[i]==s[j])
      continue;
	else
    {   
    	count++;
  	}
  }
  cout<<count;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();

int main() {
    int n;
    cin >> n;
    vector<int> arr(n, 0);
    for(auto& val: arr)
        cin >> val;
    vector<int> cpy = arr;
    sort(cpy.begin(), cpy.end());
    unordered_map<int, int> pos;
    for(int i = 0; i < cpy.size(); i++)
        pos[cpy[i]] = i;
    int ans = 0;
    for(int i = 0; i < n; i++) {
        if (pos[arr[i]] % 2 != i % 2)
            ans += 1;
    }
    cout << ans/2 <<endl;
    return 0;
}




Measured memory_bytes: 5156
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <math.h>
#include<bitset>
#include<stdio.h>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int INF = 100000000;

bool isOK(int a[],int index,int key){
    if(a[index] >= key){
        return true;
    }else{
        return false;
    }
}

int binary_search(int a[],int n,int key){
    int left = -1;
    int right = n;

    while(right-left>1){
        int mid = left + (right - left)/2;
        if(isOK(a,mid,key)){
            right = mid;
        }else{
            left = mid;
        }
    }
    return right;
}

int factrial(int n){
    if(n==0){
        return 1;
    }else{
        return n*factrial(n-1);
    }
}

int main(void){
    int k,x;
    cin >> k >> x;
    if(500*k>=x){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const long long LINF=8931145141919364364,LMOD=998244353;
inline long long mod(long long n,long long m){return(n%m+m)%m;}
// const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int main(){
    int cnt[5]={};
    rep(i,3){
        int a,b; cin>>a>>b;
        cnt[a]++;
        cnt[b]++;
    }
    int a[3]={};
    rep(i,4){
        a[cnt[i+1]]++;
    }
    if(a[1]==2&&a[2]==2) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


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

int main(){
	string s;
	cin >> s;
	
	bool equal = true;
	rep(i, s.size()) {
		if (s.at(i) != s.at(s.size() - i - 1)) {
		equal = false;
		}
	}
  //cout << equal << endl;
	rep(i, (s.size()-1)/2) {
		if (s.at(i) != s.at((s.size()+1)/2+i)) {
			equal = false;
		}
      //cout << equal << endl;
	}
	
	if (equal) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<cmath>
#include<algorithm>
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;


struct S{
	int l,r,h;
}b[20];


int main(){
	int r,n;
	while(cin>>r>>n,r|n){
		rep(i,n)cin>>b[i].l>>b[i].r>>b[i].h;
		double ans=20;
		vector<int> x;
		rep(i,n){x.push_back(b[i].l);x.push_back(b[i].r);}
		x.push_back(0);
		x.push_back(-r);
		x.push_back(r);
		rep(i,x.size()){
			if(x[i]<-r||r<x[i])continue;
			int y=20;
			int f=0;
			if(x[i]==r)f|=1;
			if(x[i]==-r)f|=2;
			rep(j,n){
				if(x[i]==b[j].l||x[i]==b[j].r)
					y=min(y,b[j].h);
				if(x[i]==b[j].l)f|=1;
				if(x[i]==b[j].r)f|=2;
			}
			if(f!=3)y=0;
			rep(j,n){
				if(b[j].l<x[i]&&x[i]<b[j].r){
					y=max(y,b[j].h);
				}
			}
			double t=y+r-sqrt((double)(r*r-x[i]*x[i]));
			ans=min(ans,t);
		}
		printf("%.4f\n",ans);
	}
	return 0;
}

Measured memory_bytes: 1248
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second

void solve() {
	int n; string s;
	cin >> n >> s;
	int c1 = 0, c2 = 0;
	rep(i, n) {
		if (s[i] == 'R')c1++;
		else c2++;
	}
	if (c1 > c2)cout << "Yes" << endl;
	else cout << "No" << endl;
}
int main() {
	solve();
	//stop
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,N) for(int i = 0; i < (N); i++)
#define erep(i,N) for(int i = N - 1; i >= 0; i--)
const ll INF = 1000000000;
//const ll MOD = 1000000007;
const ld PI = (acos(-1));
using Graph = vector<vector<int>>;
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;}
typedef pair<int, int> P;
typedef pair<ll,ll> PLL;
double rad(double a) {return a * 180 / PI;}

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

//dpTable
int dp[100050];

int main(){
    ll N,A,B,ans = 0;
    cin >> N >> A >> B;
    vector<ll> X(N);
    rep (i,N) cin >> X.at(i);
    for (int i = 1; i < N; i++) {
        ans += min(B,A * (X.at(i) - X.at(i - 1)));
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4036
#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long int n;
    cin >> n;
    long long int sum = 0;
    for (long long int i = 1; i <= n; i++)
    {
        if (i % 3 != 0 && i % 5 != 0)
        {
            sum = sum + i;
            //cout << i << " ";
        }
    }
    cout << sum << endl;
}

Measured memory_bytes: 3636
package main

import (
	"fmt"
)

func main() {
	var D int //距離
	var T int //時間
	var S int //分速
	fmt.Scan(&D, &T, &S)
	if D <= T*S {
		fmt.Printf("Yes")
	} else {
		fmt.Printf("No")
	}

}


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

int main() {
	int N, X;
	cin >> N >> X;
	vector<int> vec (N);
	int total = 0;
	for(int i = 0;i < N;i++){
		cin >> vec.at(i);
		total += vec.at(i);
	}
	X -= total;
	sort(vec.begin(),vec.end());
	cout << N + (X / vec.at(0)) << endl;
}

Measured memory_bytes: 256
import numpy as np
n,m,x=map(int,input().split())
N=1<<n
C=[]
A=[0 for i in range(n)]
for i in range(n):
    tmpc,*tmpa=map(int,input().split())
    C.append(tmpc)
    tmpa=np.array(tmpa,dtype=np.int64)
    A[i]=tmpa

ans=10**9
for bit in range(N):
    comp=np.zeros(m,dtype=np.int64)
    tmpans=0
    for i in range(n):
        if bit&(1<<i):
            comp+=A[i]
            tmpans+=C[i]
    flag=True
    for i in range(m):
        if comp[i]<x:
            flag=False
    if flag:
        ans=min(ans,tmpans)

if ans==10**9:
    print(-1)
else:
    print(ans)

Measured memory_bytes: 27272
#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <map>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <iomanip>
#include <time.h>
using namespace std;

typedef long long ll;

int main()
{
    int N;
    cin >> N;
    vector<ll> A(N);
    
    for(int i=0; i<N; i++){
        cin >> A[i];
    }
    sort(A.begin(),A.end(),greater<ll>());
    ll ans=A[0];
    int i=0;
    for(i=0; i<(N-2)/2; i++){
        ans+=A[1+i]*2;
    }
    if(N%2==1) ans+=A[1+i];
    cout << ans << endl;
    
    

    return 0;
}

Measured memory_bytes: 4840
#! /usr/bin/env python
# -*- coding: utf-8 -*-

def main():
	#print ("x???%d??§???" % x)
	for left in range(1, 10):
		for right in range(1, 10):
			print("{0}x{1}={2}".format(left, right, left * right))

if __name__ == '__main__':
    main()

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

int main()
{


        int X;
        cin >> X;

        while (1) {

        bool sosuu = true;

        for (int i = 0; i < X; ++i) {

                if (i == 0 || i == 1) {
                        continue;
                }
                if (X % i == 0) {
                        sosuu = false;
                        break;
                }
        }
        if (sosuu) {
                cout << X << endl;
                break;

        }
                X++;
        }







}


Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, K = mapint()
As = list(mapint())

now = 1
for i in range(N):
    a = As[i]
    if i<K:
        pass
    else:
        past = As[i-K]
        now = a
        if now>past:
            print('Yes')
        else:
            print('No')

Measured memory_bytes: 94136
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
divisors = []
for j in range(2):
    for i in range(1, int(a[j]**0.5)+1):
        if a[j] % i == 0:
            divisors.append(i)
            if i != a[j] // i:
                divisors.append(a[j]//i)
divisors = list(set(divisors))
divisors.sort(reverse=True)

if n == 2:
    print(max(divisors))
else:
    for i in divisors:
        judge = 0
        for j in range(n):
            if judge > 0 and a[j] % i !=0:
                judge += 1
                break
            elif a[j] % i != 0:
                judge += 1
        if judge < 2 :
            print(i)
            break

Measured memory_bytes: 14428
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	int n;
	cin >> n;
	int l;
	vector<int> a(n);
	vector<int> b(n);
	vector<int> suma(n,0);
	vector<int> sumb(n,0);



	for(int i = 0; i < n; i++) {
		cin >> l;
		a[i] = l;
	}
	for(int i = 0; i < n; i++) {
		cin >> l;
		b[i] = l;
	}
	int ans = 0;
	for(int i = 0;i < n;i++){//下に行くところの番号
		int tmp = 0;
		for(int j = 0;j < n;j++){
			if(j == i){
				tmp += a[j] + b[j];
			}
			else if(j < i){
				tmp += a[j];
			}
			else{
				tmp += b[j];
			}
		}
		ans = max (ans,tmp);
	}
	cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
use std::io;

fn main() {
    // 一行目を取得、分割
    let mut one_line_buffer = String::new();

    io::stdin().read_line(&mut one_line_buffer).unwrap();
    let one_line_vec: Vec<i64> = one_line_buffer
        .trim()
        .split_whitespace()
        .map(|c| c.parse().unwrap())
        .collect();

    let popular_product_num = one_line_vec[1]; //M

    // 二行目を取得、分割
    let mut two_line_buffer = String::new();
    io::stdin().read_line(&mut two_line_buffer).unwrap();

    let mut vote_nums: Vec<i64> = two_line_buffer
        .trim()
        .split_whitespace()
        .map(|c| c.parse().unwrap())
        .collect();

    // 処理

    let total_vote_num = {
        let mut total: i64 = 0;
        for i in &vote_nums {
            total = total + i;
        }
        total
    };

    let judge_line_num = total_vote_num as f64 / (4 * popular_product_num) as f64;

    vote_nums.sort_by(|a, b| b.cmp(a));

    // for i in &vote_nums {
    //     println!("{}", i);
    // }

    let popular_product_votes: Vec<i64> = vote_nums[..(popular_product_num as usize)].to_vec();

    // println!("productVotes");
    // for i in &popular_product_votes {
    //     println!("{}", i);
    // }

    let mut is_yes = true;
    for i in &popular_product_votes {
        if (*i as f64) < judge_line_num {
            is_yes = false;
        }
    }
    if is_yes {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using PL = pair<ll, ll>;
// Welcome to my source code!

const int MOD = 1000000007;

ll mod_pow(ll x, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

ll mod_inv(ll x, ll mod) { return mod_pow(x, mod - 2, mod); }

ll mod_comb(int n, int r, ll mod) {
    if (n - r < r) r = n - r;
    ll x = 1, y = 1;
    for (int i = 0; i < r; i++) x = x * (n - i) % mod;
    for (int i = r; i > 0; i--) y = y * i % mod;
    return x * mod_inv(y, mod) % mod;
}

int main() {
    ll n, a, b;
    cin >> n >> a >> b;
    ll ans = mod_pow(2, n, MOD) - 1 - mod_comb(n, a, MOD) - mod_comb(n, b, MOD);
    while (ans < 0) ans += MOD;
    cout << ans << endl;
}

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

int main(){
	while(true){
		int i,j;
		cin>>i;
		cin>>j;
		if(cin.eof())
			break;
		i=i+j;
		cout << (int)log10((float)i)+1<<endl;
	}
	return 0;

}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	int n,m;
	cin>>n>>m;
	int sum=0;
	while(n!=0){
		n/=m;
		sum++;
	}
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int n, m;
    while (cin >> n >> m, n > 0 && m > 0){
        vector<int> v(n), u(m);
        for (auto &&i : v) scanf("%d", &i);
        for (auto &&j : u) scanf("%d", &j);
        int p = 0;
        for (int i = 0; i < m; ++i) {
            p += u[i];
            p += v[p];
            if(p >= n-1) {
                cout << i+1 << "\n";
                break;
            }
        }
    }
    return 0;
}



Measured memory_bytes: 3164
S = raw_input()
odd= set(['R', 'U', 'D'])
even= set(['L', 'U', 'D'])
def check(S):
    for i, ch in enumerate(S):
        if (i +1) % 2==0:
            #even
            if ch not in even:
                return False
        else:
            if ch not in odd:
                return False
    return True
easy= check(S)
if easy:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 2568
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;

int main()
{
	int K;
	cin >> K;
	vector<long long> A(K);
	for (auto i = 0; i < K; ++i)
	{
		cin >> A[i];
	}

	auto minV = 2ll;
	auto maxV = 3ll;
	auto isValid = true;
	if (A[K - 1] != 2)
	{
		isValid = false;
	}
	else
	{
		for (auto i = K - 2; i >= 0; --i)
		{
			auto v = A[i];
			if (v < minV && (minV % v) != 0 && (minV / v + 1) * v > maxV)
			{
				isValid = false;
				break;
			}
			else if (v > maxV)
			{
				isValid = false;
				break;
			}

			maxV = (maxV / v + 1) * v - 1;
			if (minV % v != 0)
			{
				minV = (minV / v + 1) * v;
			}
		}
	}

	if (!isValid)
	{
		cout << -1 << endl;
	}
	else
	{
		cout << minV << " " << maxV << endl;
	}

	return 0;
}

Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Solve.Answer();
            }
            catch (Exception ex)
            {
                WriteLine(ex.ToString());
            }
        }
    }

    static class Solve
    {
        public static void Answer()
        {
            var N = IO_ShortCut.ReadInt;
            long ans = 0;
            for (int i = 1; i <= N; i++)
            {
                if (i % 3 == 0 || i % 5 == 0)
                    continue;

                ans += i;
            }
            WriteLine(ans);
        }
    }

    static class IO_ShortCut
    {
        #region Input
        public static string ReadString => ReadLine();
        public static int ReadInt => int.Parse(ReadLine());
        public static long ReadLong => long.Parse(ReadLine());
        public static double ReadDouble => double.Parse(ReadLine());

        public static List<string> ReadSplitString => ReadLine().Split().ToList();
        public static List<int> ReadSplitInt => ReadLine().Split().Select(s => int.Parse(s)).ToList();
        public static List<long> ReadSplitLong => ReadLine().Split().Select(s => long.Parse(s)).ToList();
        public static List<double> ReadSplitdouble => ReadLine().Split().Select(s => double.Parse(s)).ToList();
        #endregion

        #region Output
        public static void OutJoinSpace<T>(IEnumerable<T> list) => WriteLine(string.Join(" ", list));
        #endregion
    }
}

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

/*  using namespace  */
using namespace std;

/*  local var  */

/*  define  */
#define loop(i,j) for(int i = 0; i < j; i++)

/*  typedef  */
typedef long long ll;

/*  function  */
//None

/*  main program  */
int main()
{
	int a[3];
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	if(a[0]==a[1]&&a[0]==5&&a[2]==7) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,t,a;
    cin >> n >> t >> a;
    vector<int>h(n);
    for(int i = 0; i < n; i++) cin >> h[i];
    double tmp;
    vector<double>res(n);
    for(int i = 0; i < n; i++){
        tmp = t - h[i]*0.006;
        res[i] = abs(tmp - a);
    }
    double min = *min_element(res.begin(), res.end());
    int ans = 0;
    for(int i = 0; i < res.size(); i++){
        ans += 1;
        if(res[i] == min) break;
    }
    cout << ans;
}

Measured memory_bytes: 256
#include<iostream>

 using namespace std ;

 int main()

{

short int c=0,price;

char s[3];

cin>>s;

if(s[0]=='o') ++c;

if(s[1]=='o') ++c;

if(s[2]=='o') ++c;

price=700+c*100;

cout<<price;

}

Measured memory_bytes: 3568
#include <stdio.h>

int main() {
	int a = 0;
	int b = 0;
	int c = 0;
	scanf("%d %d %d", &a, &b, &c);

	if (a < b && b < c) {
		printf("Yes\n");
	}
	else {
		printf("No\n");
	}

	return 0;
}

Measured memory_bytes: 1760
#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 ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
using ll = long long;
using ull = unsigned long long;

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

    int ans = 0;
    FOR(i,1,n+1) {
        if (to_string(i).size() % 2 == 1) ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <iomanip>
#include <map>
using namespace std;

void solve(){
  int r; cin >> r;
  cout << 3 * r * r << endl;
  return;
}

int main(){
  solve();
  return 0;
}


Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;
 
/* 
The read function reads a string according to each one. 
*/
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

//main function
fn main() {
    let n:i64 = read();
    if n == 1{
	println!("Hello World");
    }else {
	let a:i64 = read();
	let b:i64 = read();
	println!("{}",a+b);
    }
}


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

int main() {
	long long X, Y, Z, K, A[1000], B[1000], C[1000];
	static long long AB[1000000];
	static long long ABC[3000000];
	cin >> X >> Y >> Z >> K;
	for (int i = 0; i < X; i++) {
		cin >> A[i];
	}
	for (int i = 0; i < Y; i++) {
		cin >> B[i];
	}
	for (int i = 0; i < Z; i++) {
		cin >> C[i];
	}
	for (int i = 0; i < X; i++) {
		for (int j = 0; j < Y; j++) {
			AB[i * Y + j] = A[i] + B[j];
		}
	}
	sort(AB, AB + X * Y, greater<long long>());
	for (int i = 0; i < K; i++) {
		for (int j = 0; j < Z; j++) {
			ABC[i * Z + j] = AB[i] + C[j];
		}
	}
	sort(ABC, ABC + K * Z, greater<long long>());
	for (int i = 0; i < K; i++) {
		cout << ABC[i] << endl;
	}
}

Measured memory_bytes: 31488
S = str(input())

y = ''
m = ''
d = ''
num = 0
tmp = ''
for index, s in enumerate(list(S)):
  if s == '/':
    if num == 0:
      y = tmp
    elif num == 1:
      m = tmp
    tmp = ''
    num += 1
  else:
    tmp += s
  if index == len(list(S)) - 1:
    d = tmp

if int(y + m + d) > 20190430:
  print("TBD")
else:
  print("Heisei")

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

struct P{
	double x,y,z;
};
P operator + (P a,P b){
	a.x += b.x;
	a.y += b.y;
	a.z += b.z;
	return a;
}

double pi = acos(-1);
int main(){
	double m,t;
	cin >> m >> t;
	m = m / 180 * pi;
	
	t *= 60;
	double tot = 0;
	for(double ms = 0 ; ms < t  ; ms += 1.0){
		P mo,ka;
		mo.x = 380000 * cos(m + ms / 2500000 * 2 * pi);
		mo.y = 380000 * sin(m + ms / 2500000 * 2 * pi);
		mo.z = 0;
		ka.x = 1900 * sin(-ms / 7200 * 2 * pi);
		ka.y = 0;
		ka.z = 1900 * cos(-ms / 7200 * 2 * pi);
		ka = ka + mo;
		double a = ka.x * ka.x + ka.y * ka.y + ka.z * ka.z;
		double b = ka.x * mo.x + ka.y * mo.y + ka.z * mo.z;
		double c = 380000*380000.0 - 1800*1800;
		if( b * b - a*c >= 0 ){
			double s = (b + sqrt(b*b-a*c)) / a;
			//cout << s << endl;
			if( s < 1 ) tot++;
		}
	}
	printf("%.10lf\n",tot/60.);
	
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define long long long
using namespace std;
const int N=2e5,inf=1e9;
int mt[12][12];
int dgt(int x)
{
  int dg=0;
  while(x)
  {
    x/=10;dg++;
  }
  return dg;
}
int msb(int x)
{
  int dg=dgt(x);
  int ml=1;
  for(int i=1;i<dg;i++)ml*=10;
  return x/ml;
}
int pw(int x)
{
  int ml=1;
  for(int i=1;i<=x;i++)ml*=9;
  return ml;
}
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  int n;cin>>n;

  for(int i=1;i<=n;i++)
  {
    int a=msb(i),b=i%10;
    mt[a][b]++;
  }
  long ans=0;
  for(int i=1;i<=n;i++)
  {
    int a=msb(i),b=i%10;
    if(a&&b)ans+=mt[b][a];
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <deque>
#include <iterator>
#include <map>
#include <queue>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
template<class T> inline bool chmax(T& a, T b) {if (a<b) {a=b; return true;} return false;}
template<class T> inline bool chmin(T& a, T b) {if (a>b) {a=b; return true;} return false;}

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;

int main() {
  ll n; cin >> n;
  vll p(4); REP(i, 4) cin >> p[i];
  vll t(4); REP(i, 4) cin >> t[i];
  ll ans = 0, tmpn = 0;
  ll mini = 0;
  rep(i, 1, 4) if (p[i]/(double)t[i] < p[mini]/(double)t[mini]) mini = i;
  while (tmpn < n) {
    ll tmpi = mini;
    REP(i, 4) if (tmpn + t[i] >= n && p[tmpi] > p[i]) tmpi = i;
    ans += p[tmpi];
    tmpn += t[tmpi];
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 3104
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;


int main() {

    long k,x;
    cin>>k>>x;

    long mini=-1000000;
    long maxi=1000000;

    for(long i=(x-k+1);i<=(x+k-1);i++){

        cout<<i<<" ";

    }


	return 0;
}


/*
ll  modularExponentiation(ll x,ll n,ll M)
{

    ll result=1;

    while(n>0)
    {

	if(n%2==1)

 result=(result*x)%M;

  x=(x*x)%M;

  n=n/2;

}

  return result;
}



*/




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

int main() {
  long W,H,x,y; cin >> W >> H >> x >> y;
  double area = W * H / 2.0;
  int way;
  if(x == W - x && y == H - y) {
    way =1;
  } else {
    way =0;
  }
  cout << fixed << setprecision(10) << area;;
  cout <<" " << way << endl;
}

Measured memory_bytes: 3748
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <fstream>

using namespace std;

int N, K;
long long int A[200005];

vector<long long int > P;
vector<long long int > M;

long long int MOD = 1000000007;

int main(void) {

	
	//ifstream ifs("random_max01.txt");



	cin >> N >> K;
	for (int i = 1; i <= N; i++) {
		cin>> A[i];

		if (A[i] >= 0) { P.push_back(A[i]); }
		else { M.push_back(A[i]); }
	}

	sort(P.rbegin(), P.rend());
	sort(M.begin(), M.end());

	long long int ans = 1;

	if (K == N) {
		for (int i = 1; i <= N; i++) {
			ans *= abs(A[i]); ans %= MOD;
		}

		if (M.size() % 2 == 1) { ans = (MOD - ans) % MOD; }

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

	if (P.size() == 0) {
		if (K % 2 == 0) {
			sort(M.begin(), M.end());

			for (int i = 0; i < K; i++) {
				ans *= abs(M[i]); ans %= MOD;
			}

		}
		else {
			sort(M.rbegin(), M.rend());

			for (int i = 0; i < K; i++) {
				ans *= abs(M[i]); ans %= MOD;
			}

			//cout << "ans= " << ans << endl;

			ans = (MOD - ans)%MOD;
		}
	}
	else {

		int cnt = 0;

		int p = 0; int q = 0;
		if (K % 2 == 1) { ans *= P[0]; cnt++; p++; }

		while (1) {

			if (K == cnt) { break; }
			/*else if (q==(int)M.size()-1) {
				ans *= P[p]; ans %= MOD; p++; cnt++;
			}
			else if (p==(int)P.size()-1) {
				ans *= abs(M[q]); ans %= MOD; q++; cnt++;
			}*/
			else {


				if (p >= (int) P.size() - 1) {
					
					ans *= abs(M[q]); ans %= MOD; q++; cnt++;
					ans *= abs(M[q]); ans %= MOD; q++; cnt++;
				}
				else if (q >= (int)M.size() - 1) {

					ans *= P[p]; ans %= MOD; p++; cnt++;
					ans *= P[p]; ans %= MOD; p++; cnt++;
				}
				else {

					if (M[q] * M[q + 1] >= P[p] * P[p + 1]) {
						ans *= abs(M[q]); ans %= MOD; q++; cnt++;
						ans *= abs(M[q]); ans %= MOD; q++; cnt++;
					}
					else {
						ans *= P[p]; ans %= MOD; p++; cnt++;
						ans *= P[p]; ans %= MOD; p++; cnt++;
					}
				}

			}
		}
	}

		cout << ans << endl;

	return 0;
}

Measured memory_bytes: 6648
#include <iostream>
using namespace std;
int main(void){
    int n, a, b;
    
    cin >> n;
    
    if(n == 1){
        cout << "Hello World" << endl;
        exit(0);
    }
    else if(n == 2){
        cin >> a;
        cin >> b;
        cout << a + b;
        exit(0);
    }
    
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Diagnostics.Tracing;

namespace Main
{
    class Program
    {
        static void Main(string[] args)
        {
            //ここから
            //int n=ReadInt();
            //string[] str = Console.ReadLine().Split(' ');

            int n = ReadInt();
            int[] a = ReadArray(n);

            long ans = 0;
            int now = a[0];


            for(int i = 1; i < n; i++)
            {
                if (a[i] < now) ans += now - a[i];
                now = Max(a[i], now);
            }

            Cout(ans);

            //ここまで
        }

        static void Cout(string s)
        {
            Console.WriteLine(s);
            return;
        }

        static void Cout(int n)
        {
            Console.WriteLine(n);
            return;
        }

        static void Cout(long n)
        {
            Console.WriteLine(n);
            return;
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static int[] ReadArray(int n)
        {
            string[] str = Console.ReadLine().Split(' ');
            int[] a = new int[n];
            for (int i=0; i < n; i++){ a[i] = int.Parse(str[i]); }
            return a;
        }
        static long[] ReadArray(long n)
        {
            string[] str = Console.ReadLine().Split(' ');
           long[] a = new long[n];
            for (long i = 0; i < n; i++) { a[i] = long.Parse(str[i]); }
            return a;
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int Min(int a, int b)
        {
            if (a < b) return a;
            return b;
        }

        static int Max(int a, int b)
        {
            if (a > b) return a;
            return b;
        }


    }

}


Measured memory_bytes: 46280
n, k = map(int, input().split())
a = list(input().split()) # str
 
cnt = {} # dict
for a_i in a:
    if a_i not in cnt.keys(): 
        cnt[a_i] = 1
    else:
        cnt[a_i] += 1
        
cnts = sorted(cnt.values())
print(sum(cnts[:len(cnts) - k]))

Measured memory_bytes: 35616
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication47
{
    class Program
    {
        static bool PrimeNumbers(int a)
        {
            if (a == 2) return true;
            for (int b = 2; ; b+=2)
            {
                if (a % b == 0) return false;
                if ((b + 1) * (b + 1) > a) return true;
                if (b == 2) b--;
            }
        }
        static void Main()
        {
            while (true)
            {
                string a = Console.ReadLine();
                if (a == null) break;
                int b = int.Parse(a);
                if (b == 3) { Console.WriteLine("2 5"); continue; }
                if (b == 5) { Console.WriteLine("3 7"); continue; }
                if (b % 2 == 0)
                {
                   for(int c=b-1; ; c -= 2)
                    {
                        if (PrimeNumbers(c)) { Console.Write(c + " "); break; }
                    }
                   for(int d=b+1; ; d += 2)
                    {
                        if (PrimeNumbers(d)) { Console.WriteLine(d); break; }
                    }
                }
                else
                {
                    for (int c = b - 2; ; c -= 2)
                    {
                        if (PrimeNumbers(c)) { Console.Write(c + " "); break; }
                    }
                    for (int d = b + 2; ; d += 2)
                    {
                        if (PrimeNumbers(d)) { Console.WriteLine(d); break; }
                    }
                }
            }
        }
    }
}

Measured memory_bytes: 9052
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

int lis[10], lds[10];

vector<int> go(int N, int A, int B)
{
	vector<int> V;
	REP(i, N)
		V.push_back(i + 1);

	vector<int> res(1, -1);

	do {
		memset(lis, 0, sizeof(lis));
		memset(lds, 0, sizeof(lds));

		lds[0] = lis[0] = 1;

		FOR(i, 1, N)
		{
			lis[i] = lds[i] = 1;
			REP(j, i)
				if (V[i] > V[j])
					lis[i] = max(lis[i], 1 + lis[j]);
				else
					lds[i] = max(lds[i], 1 + lds[j]);
		}

		int vA = 0, vB = 0;
		REP(i, N)
		{
			vA = max(vA, lis[i]);
			vB = max(vB, lds[i]);
		}

		if (vA == A && vB == B)
			return V;
	} while (next_permutation(V.begin(), V.end()));

	return res;
}

vector<int> go1(int N, int A, int B)
{
	vector<int> res;

	if (B > N)
	{
		res.push_back(-1);
		return res;
	}

	int left = N - B; A--;

	if (left < A || (!A && left))
	{
		res.push_back(-1);
		return res;
	}

	if (!A)
	{
		REP(i, B)
			res.push_back(B - i);
		return res;
	}

	int beg = B + 1, ile = left / A, rm = left%A;

	if (ile + (rm ? 1 : 0) > B)
	{
		res.push_back(-1);
		return res;
	}

	REP(i, B)
		res.push_back(B - i);

	REP(i, A)
	{
		vector<int> tmp;
		REP(j, ile)
		{
			tmp.push_back(beg);
			beg++;
		}

		if (rm)
		{
			tmp.push_back(beg);
			beg++;
			rm--;
		}

		reverse(tmp.begin(), tmp.end());
		for (int l : tmp)
			res.push_back(l);
	}

	return res;
}

int main()
{
	/*FORQ(N, 1, 10)FORQ(A, 1, 10)FORQ(B, 1, 10)
	{
		auto res = go(N, A, B), res1 = go1(N, A, B);
		if (res == vector<int>(1, -1))
			assert(res1 == res);
		else
			assert(res.size() == res1.size());
	}*/

	int N, A, B;
	scanf("%d%d%d", &N, &A, &B);

	auto res = go1(N, A, B);

	for (int l : res)
		printf("%d ", l);
	printf("\n");

	return 0;
}

Measured memory_bytes: 3440
#include <stdio.h>

int main(void)
{

    int n, k[100], p[100], a[100], i;

    scanf("%d", &n);

    for(i = 0; i < n; i++) {
        scanf("%d %d", &k[i], &p[i]);
        if(k[i] % p[i] == 0)
            a[i] = p[i];
        else
            a[i] = k[i] % p[i];
    }

    for(i = 0; i < n; i++)
        printf("%d\n", a[i]);

    return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
 
const double EPS = 1e-10;
const ll INF = 100000000;
const ll MOD = 1000000007;

int n;
int v[100000];
P c1[100001], c2[100001];

int main() {
    cin >> n;
    rep(i,n) cin >> v[i];
    rep(i,n) {
        if (i%2){ 
            c1[v[i]].first++;
        } else {
            c2[v[i]].first++;
        }
    }
    for (int i = 1; i <= 100000; i++) {
        c1[i].second = i;
        c2[i].second = i;
    }
    sort(c1, c1+100001, greater<P>());
    sort(c2, c2+100001, greater<P>());
    if (c1[0].second == c2[0].second) {
        cout << n-max(c1[0].first+c2[1].first,c2[0].first+c1[1].first) << endl;
    } else {
        cout << n-c1[0].first-c2[0].first << endl;
    }
}



Measured memory_bytes: 3712
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <complex>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long ll;

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

//container util
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define UNIQUE(a)  (a).erase(unique((a).begin(),(a).end()),(a).end())
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

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

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << "[L " << __LINE__ << "] " << #x << " = " << (x) << "\n";

const int INF = 1e9;
const int _N = 200000;
const int _M = 270000;

struct SEG{ // min
	int d[_M * 2];
	int m;
	void init(int m){
		this->m = m;
		REP(i, m * 2 - 1)d[i] = INF;
	}
	void update(int i, int x){
		i += m - 1;
		d[i] = x;
		while(i>0){
			i = (i -1) / 2;
			d[i] = min(d[i * 2 + 1], d[i * 2 + 2]);
		}
	}
	int query(int a, int b){
		return _query(a, b, 0, 0, m);
	}
	private:int _query(int a, int b, int k, int l, int r){
		if(r <= a || b <= l) return INF;
		if(a <= l && r <=b) return d[k];
		int vl = _query(a, b, k * 2 + 1, l, (l + r) / 2);
		int vr = _query(a, b, k * 2 + 2, (l + r) / 2, r);
		return min(vl, vr);
	}
};

int n, d;
int sizes[_N]; // sizes exist

SEG xms, xMs, yms, yMs;
typedef pair<int, PII> Star;
Star stars[_N];
bool comp(const Star& a, const Star& b){
	return a.first < b.first;
}
int last = -1, si = -1;
int xm = INF, xM, ym = INF, yM;
void calc(){
	sizes[si] = last;
	xms.update(si, xm);
	xMs.update(si, -xM);
	yms.update(si, ym);
	yMs.update(si, -yM);
	xm = INF, xM = 0, ym = INF, yM = 0;
}
// O(N log N)
int main() {
	omajinai;
	cin >> n >> d;

	// segment tree initial
	int m=1;
	while(m<n)m*=2;
	xms.init(m);
	xMs.init(m);
	yms.init(m);
	yMs.init(m);
	//

	REP(i, n){
		int x, y, b;
		cin >> x >> y >> b;
		stars[i] = MP(b, MP(x, y));
	}
	sort(stars, stars + n, comp);
	REP(i, n){
		int b = stars[i].first, x = stars[i].second.first, y = stars[i].second.second;
		if(b!=last){
			if(si > -1)calc();
			si++;
			last = b;
		}
		xm = min(xm, x);
		xM = max(xM, x);
		ym = min(ym, y);
		yM = max(yM, y);
	}
	calc();

	si++; // to use as sizes' size
	ll ans = 0; // max = 2e6 ^ 2 = 4e12
	REP(i, si){
		int ed = upper_bound(sizes, sizes + si, sizes[i] + d) - sizes;
		xm = xms.query(i, ed);
		xM = -xMs.query(i, ed);
		ym = yms.query(i, ed);
		yM = -yMs.query(i, ed);
		ans = max(ans, (ll)(xM - xm) * (yM - ym));
		if(ed == si)break;
	}
	cout << ans << endl;
}

Measured memory_bytes: 14532
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;

int a,b,c,ans;

int main(){
	cin>>a>>b>>c;
	if(a%2!=b%2||a%2!=c%2)
		if(a%2==b%2)
			++a,++b,++ans;
		else if(a%2==c%2)
			++a,++c,++ans;
		else
			++b,++c,++ans;
	if(a>b)swap(a,b);
	if(b>c)swap(b,c);
	if(a>b)swap(a,b);
	ans+=(c-a)/2;
	ans+=(c-b)/2;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
public class Main
{
    static int solve(int h,int k,int height[])
    {
        if(h == 1)
        return 0;
        int dp[] = new int[h];
        dp[0]=0;
        for(int i=1;i<h;i++)
        {
            dp[i] = Integer.MAX_VALUE;
            for(int j=1;j<=k;j++)
            {
                if(i-j>=0)
                dp[i]=Math.min(dp[i-j]+getAbsoluteValue(height[i],height[i-j]),dp[i]);
            }
        }
        return dp[h-1];
   }
    static int getAbsoluteValue(int a,int b)
    {
        return Math.abs(a-b);
    }
    public static void main(String []args)throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));
        int hk[] = Arrays.stream(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        int height[] = Arrays.stream(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        bw.write(Integer.toString(solve(hk[0],hk[1],height)));
        br.close();
        bw.close();
    }
}


Measured memory_bytes: 41108
//abc120_c.cpp
//Tue Mar 12 13:30:24 2019

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

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

	int deflength = s.length();
	int slength = s.length();
	for (int i=0;i<slength-1;i++){
		if (s[i]!=s[i+1]){
			if (i>0 && i+2<slength){
				s = s.substr(0,i) + s.substr(i+2,slength-i-2);
			}else if (i>0 && i+2>=slength){
				s = s.substr(0,i-1);
			}else if (i==0 && i+2<slength){
				s = s.substr(i+2,slength-i-2);
			}else{
				s = "";
			}
			i--;
			if (i>=0){
				i--;
			}
			slength = slength-2;
//			cout << s << endl;
		}
	}



	cout << deflength-slength<< endl;
//	printf("%.4f\n",ans);
}

Measured memory_bytes: 724
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(){
    int i,k=0,n=0,a[3000000]={},first=0,second=0,tmp=0;
    char token[3000000]={};
    fgets(token, sizeof(token), stdin);
    k=atoi(strtok(token, " "));n=atoi(strtok(NULL, " "));
    fgets(token, sizeof(token), stdin);
    a[1]=atoi(strtok(token, " "));
    for (i=2; i<n+1; i++) a[i]=atoi(strtok(NULL, " "));
    a[0]=0;a[n+1]=k;
    for (i=1; i<n; i++) if(tmp<a[i+1]-a[i]) tmp=a[i+1]-a[i];
    first=a[n]-a[1];second=k-tmp;
    if (second>a[n]-a[1]) second=a[n]-a[1];
    if (first>second) printf("%d",second);
    else printf("%d",first);
    return 0;
}



Measured memory_bytes: 14848
N = gets.to_i
if N == 1 then
    puts '0'
    exit
end
result = []
num = N
i = 1
while i <= Math.sqrt(num) do
    if num % i == 0
        result << i
    end
    i += 1
end
min = N*2
result.each do |a|
    b = N/a
    dist = a+b-2
    min = dist if min > dist
end
puts min

Measured memory_bytes: 1788
import math
import operator as op
from functools import reduce
from fractions import Fraction as frac

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom
def rd(p):
    if(p==0):
        return input()
    if(p==1):
        return int(input())
    if(p==2):
        return map(int,input().split())
    if(p==3):
        return list(map(int,input().split()))

global par
par=[-1 for i in range(100001)]
# t=rd(1)
def find(u):
    if(par[u]<0):
        return u
    else:
        return find(par[u])
def uni(x,y):
    u=find(x)
    v=find(y)
    if u==v:
        return
    if(par[u]<par[v]):
        par[u]+=par[v]
        par[v]=u
    else:    
        par[v]+=par[u]
        par[u]=v
t=1
for term in range(1,t+1):
    n,m=rd(2)
    for i in range(m):
        x,y,z=rd(2)
        uni(x,y)
        # print(par[1:n+1])
    ans=0
    for i in range(1,n+1):
        if(par[i]<0):
            ans+=1
    
    print(ans)
        
    
    

Measured memory_bytes: 9232
#include <bits/stdc++.h>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

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

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

int main(){
    string s; cin>>s;
    int n=s.size();
    string t="keyence";

    bool f=false;
    if(s[0]=='k' && s[1]=='e' && s[2]=='y' && s[3]=='e' && s[4]=='n' && s[5]=='c' && s[6]=='e'){
        f=true;
    }

    if(s[n-7]=='k' && s[n-6]=='e' && s[n-5]=='y' && s[n-4]=='e' && s[n-3]=='n' && s[n-2]=='c' && s[n-1]=='e'){
        f=true;
    }

    if(s[0]=='k' && s[n-6]=='e' && s[n-5]=='y' && s[n-4]=='e' && s[n-3]=='n' && s[n-2]=='c' && s[n-1]=='e'){
        f=true;
    }

    if(s[0]=='k' && s[1]=='e' && s[n-5]=='y' && s[n-4]=='e' && s[n-3]=='n' && s[n-2]=='c' && s[n-1]=='e'){
        f=true;
    }

    if(s[0]=='k' && s[1]=='e' && s[2]=='y' && s[n-4]=='e' && s[n-3]=='n' && s[n-2]=='c' && s[n-1]=='e'){
        f=true;
    }

    if(s[0]=='k' && s[1]=='e' && s[2]=='y' && s[3]=='e' && s[n-3]=='n' && s[n-2]=='c' && s[n-1]=='e'){
        f=true;
    }

    if(s[0]=='k' && s[1]=='e' && s[2]=='y' && s[3]=='e' && s[4]=='n' && s[n-2]=='c' && s[n-1]=='e'){
        f=true;
    }

    if(s[0]=='k' && s[1]=='e' && s[2]=='y' && s[3]=='e' && s[4]=='n' && s[5]=='c' && s[n-1]=='e'){
        f=true;
    }

    if(f) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,h,w;
    pair<long long,long long>p[100005];
    cin>>n>>h>>w;
    int count=0;
    for(int i=0;i<n;i++)
    {
        cin>>p[i].first;
        cin>>p[i].second;
        if(p[i].first>=h && p[i].second>=w)
        count++;
    }
    cout<<count;
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  char s;
  bool a = true;
  
  for (int i = 0; i < N; i++) {
    cin >> s;
    if (s == 'Y') {
      a = false;
      break;
    }
  }
  
  if (a) cout << "Three" << endl;
  else cout << "Four" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using PLL = pair<long long, long long>;
const int INF = numeric_limits<int>::max();
constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); }

// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

bool is_prime(ll n) {
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) return false;
    }
    return n != 1;
}

int main()
{
    int n; cin >> n;
    int diff = 0;
    rep(i,n) {
        int tmp; cin >> tmp;
        if (tmp != i + 1)
            diff++;
    }
    if (diff <= 2)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;

    return 0;
}


Measured memory_bytes: 3556
using System;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            var H = int.Parse(Console.ReadLine());
            var W = int.Parse(Console.ReadLine());
            var N = int.Parse(Console.ReadLine());
            var paint = Math.Max(H, W);
            var count = 0;
            while (N > 0)
            {
                N -= paint;
                count++;
            }
            Console.WriteLine(count);
        }
    }
}


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

using namespace std;
int main(){
	string s;
	cin>>s;
	int ans=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T'){
			int cnt=0;
			while(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T'){
				cnt++;
				i++;
			}
			ans=max(ans,cnt);
		}
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256