akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int a[] = new int[n];
    double ans=0;
        
    for(int i=0;i<n;i++){
      a[i] = Integer.parseInt(sc.next());
      ans += 1/(double)a[i];
    }
    ans = 1/ans;
    System.out.println(ans);
  }
}

Measured memory_bytes: 23508
//#pragma GCC optimize ("-O3","unroll-loops")
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include <random>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define print(x) cout<<x<<'\n';
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
#define int long long
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ");
//#define double long double

template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int>P;
const int MOD = 1e9 + 7;
const int MAX = 200060;
const double pi = acos(-1);

int dp[100010][13];
void solve() {
	string S; cin >> S;
	VREVERSE(S);
	if (S[0] == '?') {
		REP(r, 10)dp[0][r] = 1;
	}
	else {
		dp[0][S[0] - '0'] = 1;
	}
	int N = S.size();
	int rem = 1;
	FOR(i, 0, N-1) {
		rem *= 10; rem %= 13;
		if (S[i + 1] == '?') {
			REP(r, 13) {
				REP(ne, 10) {
					dp[i + 1][(r + ne * rem) % 13] += dp[i][r];
					dp[i + 1][(r + ne * rem) % 13] %= MOD;
				}
			}
		}
		else {
			int ne = S[i + 1] - '0';
			REP(r, 13) {
				dp[i + 1][(r + ne * rem) % 13] += dp[i][r];
				dp[i + 1][(r + ne * rem) % 13] %= MOD;
			}
		}
	}
	ll ans = dp[N - 1][5] % MOD;
	print(ans);
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	/*REP(i, 100) {
		test(i);
	}*/
	solve();
}

Measured memory_bytes: 10604
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jenish
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        EGetEverything solver = new EGetEverything();
        solver.solve(1, in, out);
        out.close();
    }

    static class EGetEverything {
        public void solve(int testNumber, ScanReader in, PrintWriter out) {

            int n = in.scanInt();
            int m = in.scanInt();
            long dp[] = new long[1 << n];
            Arrays.fill(dp, Long.MAX_VALUE / 3);
            dp[0] = 0;
            for (int i = 0; i < m; i++) {
                int cost = in.scanInt();
                int pp = in.scanInt();
                int canopen = 0;
                for (int j = 0; j < pp; j++) canopen |= (1 << (in.scanInt() - 1));
                for (int mask = 0; mask < (1 << n); mask++)
                    dp[mask | canopen] = Math.min(dp[mask] + cost, dp[mask | canopen]);
            }

            if (dp[(1 << n) - 1] == Long.MAX_VALUE / 3) dp[(1 << n) - 1] = -1;
            out.println(dp[(1 << n) - 1]);
        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int INDEX;
        private BufferedInputStream in;
        private int TOTAL;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (INDEX >= TOTAL) {
                INDEX = 0;
                try {
                    TOTAL = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (TOTAL <= 0) return -1;
            }
            return buf[INDEX++];
        }

        public int scanInt() {
            int I = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    I *= 10;
                    I += n - '0';
                    n = scan();
                }
            }
            return neg * I;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}



Measured memory_bytes: 24084
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def ini():
  fac[0] = 1 % mod
  for i in range(1,N):
    fac[i] = fac[i-1] * i % mod"""

"""mod = 1e9+7
N = 10000000
pw = [0] * N
def ini(c):
  pw[0] = 1 % mod
  for i in range(1,N):
    pw[i] = pw[i-1] * c % mod"""

"""
def YEILD():
  yield 'one'
  yield 'two'
  yield 'three'
generator = YEILD()
print(next(generator))
print(next(generator))
print(next(generator))
"""
"""def gcd_(a,b):
  if b == 0:#結局はc,0の最大公約数はcなのに
    return a
  return gcd_(a,a % b) # a = p * b + q"""
"""def extgcd(a,b,x,y):
  d = a
  if b!=0:
    d = extgcd(b,a%b,y,x)
    y -= (a//b) * x
    print(x,y)
  else:
    x = 1
    y = 0
  return d"""
# 最大公約数 と 最小公倍数
"""def gcd(a,b):
  if b == 0:
    return a
  return gcd(b, a % b)
def lcm(a,b):
  g = gcd(a,b)
  return (a * b) // g"""

def readInts():
  return list(map(int,input().split()))
mod = 10**9 + 7

def main():
  n = int(input())
  dic = {}
  for nya in map(int,input().split()):
    if nya in dic:
      dic[nya] += 1
    else:
      dic[nya] = 1
  
  LIST = []
  
  for k,v in dic.items():
    if v // 2 >= 1 and v > 1: # 最低限2個以上は必要
      LIST.append([k,v])
  LIST = sorted(LIST,reverse = True)
  #print(LIST) # [[5, 3], [4, 3], [3, 4]]
  cnt = 0
  pr_ = 0
  for k,v in LIST:
    #print(k,v)
    if v // 2 >= 2 and cnt == 0:
      print(k * k)
      exit()
    elif v // 2 == 1 and cnt == 0:
      cnt += 2
      pr_ = k
    elif v // 2 >= 1 and cnt == 2:
      print(pr_ * k)
      exit()
  print(0)
  
if __name__ == '__main__':
  main()

Measured memory_bytes: 23820
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif 

using namespace std;

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef long long lint;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
	lint n;
	cin >> n;
	lint st = 100;
	int c =  0;
	while(st < n){
		st += 0.01 * st;
		c++;
	}
	cout << c;
    return 0;
}
// Write Here


Measured memory_bytes: 3652
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define puts(i) cout << i << endl
#define INF INT_MAX
#define INFL LLONG_MAX
typedef long long ll;
using namespace std;


int main(){
  ll n,a,b,c,d,e;
  cin >> n >> a >> b >> c >> d >> e;

  ll mini,time,movetime;

  mini=min(a,min(b,min(c,min(d,e))));

  time=(n+mini-1)/mini;

  movetime=time+4;


  cout << movetime << endl;

}


Measured memory_bytes: 3608
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

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

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

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

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



#[allow(non_snake_case, unused_variables)]
fn main() {
    input! {
        N: usize,
        AB: [(usize, usize); N],
    }
    let mut lowest: usize = 0;
    let mut min_score = 0;
    for i in 0..N {
        if lowest<AB[i].0 {
            lowest = AB[i].0;
            min_score = AB[i].1;
        }
    }
    println!("{}", lowest+min_score);
}


Measured memory_bytes: 8444
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
l = list(map(int, input().split(" ")))

p = lcm_list(l)
c = 0
z = 10 ** 9 + 7
for i in l:
  c += p // i
print(c % z)

Measured memory_bytes: 6112
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();

            // 0. すべてAとBを買うときの金額を初期値とする。
            int ans = a * x + b * y;
            // 1. AとBを2xCに交換し、合計金額の減少or増加を確認する
            // このとき、Cは2枚セットで交換する必要があることに注意
            // 1-1. 合計金額が減少する場合は処理を継続
            // 1-2. 合計金額が減少しない場合は処理を終了
            int max = Math.max(x, y);
            for (int i = 0; i < max; i++) {
                int deltaX = Math.min(x, 1);
                int deltaY = Math.min(y, 1);
                int candidate = ans - (a * deltaX + b * deltaY) + 2 * c * Math.max(deltaX, deltaY);
                if (candidate < ans) {
                    ans = candidate;
                    x -= deltaX;
                    y -= deltaY;
                } else {
                    break;
                }
            }

            System.out.println(ans);
        }
    }

}


Measured memory_bytes: 22612
#include <iostream>
#include <string>
#include <iomanip>
#include <vector>
#include <stdlib.h>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <stack>
#include <queue>
#include <set>

#define mod 1000000007
#define mp make_pair
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main(){
    const double PI=3.14159265358979323846;
    cin.tie(0);
    ios::sync_with_stdio(false);
    double a, b, h, m, x;
    double ans;
    cin >> a >> b >> h >> m;
    x=abs((double)PI*(double)h/(double)6-(double)PI*(double)m*(double)11/(double)360);
    if(x>PI) x=2*PI-x;
    ans = sqrt((double)a*(double)a+(double)b*(double)b-(double)2*(double)a*(double)b*(double)cos(x));
    cout << fixed << setprecision(15) << ans;
    return 0;
}


Measured memory_bytes: 4232
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;

int main() {
    long long a,b;
    cin >> a >> b;
    long long c = b-a;
    for ( int i = 2; i <= 999; i++ ) {
        if ( i*(i+1)/2 - ( i*(i-1)/2 ) == c ) {
            cout << i*(i+1)/2 - b << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#define llint long long 

using namespace std;

llint N, x;
llint a[100005];
llint sum[100005];

int main(void)
{
	cin >> N >> x;
	for(int i = 1; i <= N; i++) cin >> a[i];
	for(int i = 0; i <= N; i++) sum[i] = a[i] + a[i+1];
	
	llint ans = 0, dif;
	for(int i = 0; i <= N; i++){
		if(sum[i] > x){
			dif = sum[i] - x;
			sum[i] -= dif;
			sum[i+1] -= dif;
			ans += dif;
		}
	}
	
	cout << ans << endl;
	return 0;
}

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define PB push_back
#define MP make_pair
#define SORT(c) sort((c).begin(),(c).end())
#define COUT(x) cout<<x<<endl;

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const double MOD = 1e9 + 7;

//function
//--------------------------------------------
LL gcd(LL, LL);

int main() {
	VLL a(3);
	REP(i, 3)cin >> a[i];
	SORT(a);
	int ANS = 0;
	ANS = abs(a[0] - a[1] + a[1] - a[2]);

	COUT(ANS)
	return 0;
}

LL gcd(LL a, LL b) {
	if (a == 0 || b == 0)return 0;
	if (a < b)swap(a, b);
	if (a % b == 0)return b;
	else gcd(b, a % b);
}

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

int main(){
    int ans=0;
    for(int i=0;i<5;i++){
        ans++;
        int a=0;
        cin >> a;
        if(a!=i+1){
            cout << ans << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}()); 
const int mod=1000000007;
#define ll long long
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head
int _,a,b,n,k,m;
int main() {
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
        int a;cin>>a;
        cout<<(a)+(a*a)+(a*a*a)<<endl;
    }

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

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) RFOR(i, n, 0)
#define MFOR(i, m) for(auto i=(m).begin();i!=(m).end();i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1 << 30;

template<typename T>
void printv(vector<T> const& s) {
  REP(i, SZ(s)) {
    cout << s[i] << " ";
  }
  cout << endl;
}

int main () {
  cin.tie(0);
  cout << setprecision(10);

  int n; cin >> n;
  string s1, s2; cin >> s1 >> s2;
  vll a;
  REP(i, SZ(s1)) {
    if(s1[i] == s2[i]) {
      a.pb(1);
    } else {
      a.pb(2);
      i++;
    }
  }

  ll ans = 0;
  if(a[0] == 1) ans = 3;
  else ans = 6;
  FOR(i, 1, SZ(a)) {
    if(a[i-1] == 1) {
      ans = (2*ans) % MOD;
    } else if(a[i-1] == 2 && a[i] == 2) {
      ans = (3*ans) % MOD;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<stack>
#include<string>
#include<algorithm>
using namespace std;
typedef long long ll;
int main()
{
    string s;
    cin>>s;
    int l=s.size();
    stack<char> ss;
    for(int i=0; i<l; i++)
    {
        if(s[i]=='0' || s[i]=='1')
            ss.push(s[i]);
        else if(!ss.empty())
            ss.pop();
    }
    string a;
    while(!ss.empty())
    {
        a+=ss.top();
        ss.pop();
    }
    reverse(a.begin(),a.end());
    cout<<a<<endl;
    return 0;
}


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

using namespace std;

using ll = long long;
using ld = long double;

const int INF = (1 << 30) - 1;
const ll INF64 = ((ll)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

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

string solve(string s) {
	if (s.size() < 26) {
		for (int i = 0; i < 26; i++) {
			if (count(begin(s), end(s), i + 'a') != 0) {
				continue;
			}

			s += i + 'a';
			return s;
		}
	} else {
		for (int i = 24; i >= 0; i--) {
			if (s[i] >= s[i + 1]) {
				continue;
			}

			for (int j = 25; j > i; j--) {
				if (s[i] >= s[j]) {
					continue;
				}

				swap(s[i], s[j]);
				return s.substr(0, i + 1);
			}
		}
	}

	return "-1";
}

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

	string s;
	cin >> s;

	cout << solve(s) << endl;
	return 0;
}


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

const int SIZE=100010;

vector<int> G[SIZE];
int color[SIZE],num[2];

bool dfs(int v,int c)
{   
    color[v]=c; num[c]++;
    for(int u:G[v]){
        if(color[u]==c){
            return false;
        }
        if(color[u]==-1 and !dfs(u,c^1)){
            return false;
        }
    }
    return true;
}

signed main()
{
    int N,M; cin>>N>>M;
    for(int i=0;i<M;i++){
        int a,b; cin>>a>>b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    memset(color,-1,sizeof(color));
    if(dfs(0,0)){
        cout<<num[0]*num[1]-M<<endl;
    }else{
        cout<<N*(N-1)/2-M<<endl;
    }
}


Measured memory_bytes: 7424
#include <cstdio>

int main(void){
    int a, b;
    char op;
    while (1) {
        scanf("%d %c %d", &a, &op, &b);
        if (op == '?') {
            break;
        } else if (op == '+') {
            printf("%d\n", a + b);
        } else if (op == '-') {
            printf("%d\n", a - b);
        } else if (op == '*') {
            printf("%d\n", a * b);
        } else if (op == '/') {
            printf("%d\n", a / b);
        }
    }
    return 0;
}

Measured memory_bytes: 1028
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int main(void)
{
	char s[6];
	int n,i,j,w,z;
	while(1){
		scanf("%d",&n);
		if(n==0) break;
		z=1;
		int a[4]={4,1,5,1};
		for(i=0;i<n;i++){
			scanf("%s",s);
			if(s[0]=='N'){
				w=a[2]; a[2]=a[3]; a[3]=7-w; a[1]=a[3];
			}
			else if(s[0]=='E'){
				w=a[1]; a[1]=a[0]; a[0]=7-w; a[3]=a[1];
			}
			else if(s[0]=='W'){
				w=a[0]; a[0]=a[1]; a[1]=7-w; a[3]=a[1];
			}
			else if(s[0]=='S'){
				w=a[3]; a[3]=a[2]; a[2]=7-w; a[1]=a[3];
			}
			else if(s[0]=='L'){
				w=a[0]; a[0]=a[2]; a[2]=7-w; 
			}
			else if(s[0]=='R'){
				w=a[2]; a[2]=a[0]; a[0]=7-w; 
			}
//			printf("%d %d %d %d\n",a[0],a[1],a[2],a[3]);
			z+=a[1];
		}
		printf("%d\n",z);
	}
	return 0;
}

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

char s[200022];
long long ans,cnt[222];

int main(){
    scanf("%s",s);
    int n = strlen(s);
    for(int i = 0;i < n;++i) cnt[s[i]]++;
    ans = 1LL * n * (n+1) / 2 + 1 - n;
    for(int i = 'a';i <= 'z';++i) ans -= cnt[i] * (cnt[i]-1) / 2;
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 384
z[9999],r[9999],x,a,b,c,h;
f(a,b){
	fflush(!printf("? %d %d\n",a,b));
	scanf("%s",&x);
	return x=='Y';
}
main(i){
	if(scanf("%d%d",&a,&b),a<=b){puts("Impossible");return 0;}
	for(i=a+=b;~--i;)!c||f(i,z[c-1])?(z[c++]=i):c--;
	for(h=*z,i=a;~--i;)r[i]=f(h,i);
	for(printf("! "),i=0;i<a;)printf("%d",r[i++]);
	puts("");
}

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

using namespace std;

int main(){
  int n, m;
  std::cin >> n >> m;

  vector<int> a(n);
  int sum = 0;
  for(int idx = 0; idx < n; idx++){
    std::cin >> a[idx];
    sum += a[idx];
  }
  // std::cout << sum << '\n';

  double threshold = (sum + (4 * m - 1)) / (4 * m);
  // std::cout << threshold << '\n';
  int select_count = 0;
  for(int idx = 0; idx < n; idx++){
    if(threshold <= a[idx]){
      select_count++;
    }
  }
  // std::cout << select_count << '\n';
  if(m <= select_count){
    std::cout << "Yes" << '\n';
  }else{
    std::cout << "No" << '\n';
  }
  return 0;
}


Measured memory_bytes: 888
import java.util.Scanner;

public class Main {

    private String winner;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();

        String  winner = "";
        while(a > 0 && b > 0) {
            c = c - b;
            if (c <= 0) {
                winner = "Yes";
                break;
            }
            a = a - d;
            if (a <= 0) {
                winner = "No";
                break;
            }
        }

        System.out.println(winner);
    }
}

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


using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0; i<ll(n); i++)
#define FOR(i,m,n) for(ll i=ll(m); i<ll(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VP vector<pair<int,int>>
#define VPP vector<pair<int,pair<int,int>>>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)
typedef pair <int, int> P;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

const int  INF = 1 << 29;
const ll INFL = 1LL << 60;
const ll mod = 1000000007;

ll pow_mod(ll n, ll k, ll m) {
	ll r = 1;
	for (; k > 0; k >>= 1) {
		if (k & 1)r = (r*n) % m;
		n = (n*n) % m;
	}
	return r;
}


int main() {

	ll n, k;
	cin >> k >> n;

	VLL dp(n + 1, 0);

	for (ll i = n; i >= 1; i--) {

		ll a = n / i;

		ll cur = pow_mod(a, k, mod);

		for (int j = i * 2; j <= n; j += i) {
			cur -= dp[j];
			cur += mod;
			cur %= mod;
		}
		dp[i] = cur;
	}

	ll ans = 0;
	FOR(i, 1, n + 1) {
		ans += dp[i] * i;
		ans %= mod;
	}
	cout << ans << endl;


}

Measured memory_bytes: 4056
// Working program with FastReader
import java.io.BufferedReader; 

import java.io.IOException; 
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner; 
import java.util.StringTokenizer;
import java.lang.*;
public class Main
{ 
	static class FastReader 
	{ 
		BufferedReader br; 
		StringTokenizer st; 

		public FastReader() 
		{ 
			br = new BufferedReader(new
					InputStreamReader(System.in)); 
		} 

		String next() 
		{ 
			while (st == null || !st.hasMoreElements()) 
			{ 
				try
				{ 
					st = new StringTokenizer(br.readLine()); 
				} 
				catch (IOException e) 
				{ 
					e.printStackTrace(); 
				} 
			} 
			return st.nextToken(); 
		} 

		int nextInt() 
		{ 
			return Integer.parseInt(next()); 
		} 

		long nextLong() 
		{ 
			return Long.parseLong(next()); 
		} 

		double nextDouble() 
		{ 
			return Double.parseDouble(next()); 
		} 

		String nextLine() 
		{ 
			String str = ""; 
			try
			{ 
				str = br.readLine(); 
			} 
			catch (IOException e) 
			{ 
				e.printStackTrace(); 
			} 
			return str; 
		} 
	} 

	long gcd(long a, long b) {
		if(b==0) {
			return a;
		}
		return gcd(b,a%b);
	}
	public static void main(String[] args) {
		FastReader ob = new FastReader();
		String s = ob.next();
		char c = s.charAt(0);
		int i =c;
		i++;
		c=(char)i;
		System.out.println(c);
	}

} 


Measured memory_bytes: 21076
from _collections import deque

n,m=map(int,input().split())
f=[[] for i in range(n+1)]
for i in range(m):
    a,b=map(int,input().split())
    f[a].append(b)
    f[b].append(a)
g=[0]*(n+1)
p=[0]*(n+1)
for i in range(1,n+1):
    if p[i]==0:
        p[i]=i
        data=[i]
        data=deque(data)
        while len(data)>0:
            pos=data.popleft()
            p[pos]=i
            for j in f[pos]:
                if p[j]==0:
                    p[j]=i
                    data.append(j)
for i in range(n):
    g[p[i+1]]+=1
print(max(g))


Measured memory_bytes: 106948
def main():
	N = int(input())
	A = list(map(int,input().split()))
	B = list(map(int,input().split()))
	ans = 0
	p = 1
	for k in range(29):
		a_m = sorted([i & (2*p-1) for i in A], reverse=True)
		b_m = sorted([i & (2*p-1) for i in B])
		s = 0
		l1 = 0
		r1 = 0
		l2 = 0
		r2 = 0
		for a in a_m:
			while l1 < N and a + b_m[l1] < p:
				l1 += 1
			while r1 < N and a + b_m[r1] < 2*p:
				r1 += 1
			while l2 < N and a + b_m[l2] < 3*p:
				l2 += 1
			while r2 < N and a + b_m[r2] < 4*p:
				r2 += 1
			s += r2 - l2 + r1 - l1
		if s&1 == 1:
			ans += p
		p *= 2

	print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 141856
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mx = 1e5+10;
int dp[mx];
vector<int>G[mx];
int dfs(int u)
{
    int& ret = dp[u];
    if(dp[u]!=0) return ret;
    for(int a:G[u])
    {
        ret = max(ret,1+dfs(a));
    }
    return ret;
}
int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        int a,b;
        cin>>a>>b;
        G[a].push_back(b);
    }
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        ans = max(ans,dfs(i));
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 7424
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define debug(a) cout << #a << ": " << a << endl
#define sz(a) int(a.size())
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) (v).begin(),(v).end()
#define fast cin.tie(0); ios::sync_with_stdio(false)

int32_t main(){
	int l; cin>>l;
	float ans = l * l * l * 1.0 / 27;
	cout<<fixed<<setprecision(10)<<ans<<endl;
}


Measured memory_bytes: 256
class UnionFindTree:
    """Disjoint-Set Data Structure
       Union-Find Tree
       
       used in SRM505 div.2 900
    """
    def __init__(self, n):
        self.par = list(range(n)) # parent
        self.rank = [0] * n # depth of tree

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

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

        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

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

class Kruskal:
    """ Kruskal's algorithm: find minimum spanning tree
        Complexity: O(E log(V))
        used in GRL2A(AOJ)
    """

    def __init__(self, V, E, start=0, INF=10**9):
        """ V: the number of vertexes
            E: adjacency list (undirected graph)
        """
        self.kruskal(V, E)

    def kruskal(self, V, E):
        edges = []
        for v1 in range(V):
            for v2, cost in E[v1]:
                if v1 < v2: edges.append((cost, v1, v2))
        edges.sort(reverse=True)
        self.mincost = 0
        self.minSpanningTree = []
        uf = UnionFindTree(V)
        while len(self.minSpanningTree) < V - 1:
            cost, v1, v2 = edges.pop()
            if uf.same(v1, v2) == False:
                self.mincost += cost
                uf.unite(v1, v2)
                self.minSpanningTree.append((v1, v2, cost))

    def minCost(self):
        return self.mincost

    def getMinSpanningTree(self):
        return sorted(self.minSpanningTree)
    
V, E = map(int, input().split())
edge = [[] for _ in range(V)]
for _ in range(E):
    s, t, w = map(int, input().split())
    edge[s].append((t, w))
    edge[t].append((s, w))

msp = Kruskal(V, edge)
print(msp.minCost())

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

int main() {
  int n;
  cin >> n;
  
  int a, b, c, d;
  a = n % 10;
  n = n / 10;
  
  b = n % 10;
  n = n / 10;
    
  c = n % 10;
  
  d = n / 10;
  
  if ((b == c) && (a == b || c == d)) {
  	cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int N;
int P[1010];
int X[1010];
vector<vector<int> >G(1010);
int oth[1010];
int ok;
int vi[5010], vi2[5010];
int res;

void dfs3(int u)
{
	int i, j;
	int v;
	if(ok == 0)
		return ;
	if(G[u].size() == 0){
		oth[u] = 0;
		return ;
	}
	for(i=0; i<G[u].size(); i++){
		v = G[u][i];
		dfs3(v);
	}
	v = G[u][0];
	int a1=X[v], a2=oth[v];
	if(a1 > a2)
		swap(a1, a2);
	int a[4];
	for(i=0; i<=5005; i++){
		vi[i] = vi2[i] = -1;
	}
	vi[a2] = a1;
	int tmp1, tmp2;
	for(i=1; i<G[u].size(); i++){
		v = G[u][i];
		for(j=0; j<=5005; j++)
			vi2[j] = -1;////
		//for(i=0; i<=5005; i++){
		for(j=0; j<=5005; j++){
			if(vi[j] >= 0){
				tmp1 = vi[j] + X[v];
				if(tmp1 > 5000)
					tmp1 = 5001;
				tmp2 = j + oth[v];
				if(tmp2 > 5000)
					tmp2 = 5001;
				if(tmp1 > tmp2)
					swap(tmp1, tmp2);
				if(vi2[tmp2]==-1 || vi2[tmp2]>tmp1)
					vi2[tmp2] = tmp1;
				tmp1 = vi[j] + oth[v];
				if(tmp1 > 5000)
					tmp1 = 5001;
				tmp2 = j + X[v];
				if(tmp2 > 5000)
					tmp2 = 5001;
				if(tmp1 > tmp2)
					swap(tmp1, tmp2);
				if(vi2[tmp2]==-1 || vi2[tmp2]>tmp1)
					vi2[tmp2] = tmp1;
			}
		}
		for(j=0; j<=5005; j++)
			vi[j] = vi2[j];
		/*a[0] = a1 + X[v];
		a[1] = a2 + X[v];
		a[2] = a1 + oth[v];
		a[3] = a2 + oth[v];
		sort(a, a+4);
		a1 = a[0];
		a2 = a[1];*/
	}
	int rx=-1, ro;
	for(i=0; i<=5005; i++){
		if(vi[i] >= 0){
			a2 = i;
			a1 = vi[i];
			if(a1 > X[u]){
			}
			else{
				if(a2 > X[u]){
					if(rx==-1 || ro>a2){
						ro = a2;
						rx = X[u];
					}
				}
				else{
					if(rx==-1 || ro>a1){
						ro = a1;
						rx = X[u];
					}
				}
			}
		}
	}
	if(rx == -1){
		ok = 0;
	}
	else{
		oth[u] = ro;
	}
	/*if(a1 > X[u]){
		ok = 0;
		return ;
	}
	else{
		if(a2 > X[u]){
			oth[u] = a2;
		}
		else
			oth[u] = a1;
	}*/
}

void dfs(int u)
{
	int i;
	int v;
	if(ok == 0)
		return ;
	if(G[u].size() == 0){
		oth[u] = 0;
		return ;
	}
	for(i=0; i<G[u].size(); i++){
		v = G[u][i];
		dfs(v);
	}
	v = G[u][0];
	int a1=X[v], a2=oth[v];
	if(a1 > a2)
		swap(a1, a2);
	int a[4];
	for(i=1; i<G[u].size(); i++){
		v = G[u][i];
		a[0] = a1 + X[v];
		a[1] = a2 + X[v];
		a[2] = a1 + oth[v];
		a[3] = a2 + oth[v];
		sort(a, a+4);
		a1 = a[0];
		a2 = a[1];
	}
	if(a1 > X[u]){
		ok = 0;
		return ;
	}
	else{
		if(a2 > X[u]){
			oth[u] = a2;
		}
		else
			oth[u] = a1;
	}
}

void solve()
{
	int i;
	for(i=0; i<N; i++)
		G[i].clear();
	for(i=1; i<N; i++){
		G[P[i]].push_back(i);
	}
	ok = 1;
	dfs3(0);
	if(ok){
		res = 1;
		printf("POSSIBLE\n");
	}
	else{
		res = 0;
		printf("IMPOSSIBLE\n");
	}
}

int main()
{
	//test();
	//freopen("in.txt", "r", stdin);
	int i;
	scanf("%d", &N);
	for(i=1; i<N; i++){
		scanf("%d", &P[i]);
		P[i] --;
	}
	for(i=0; i<N; i++)
		scanf("%d", &X[i]);
	solve();
	//solve2();
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define ss second
#define ff first
#define all(x) x.begin(), x.end()
 
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
 
const int oo = 1e9 + 7;
const int mod = 1e9 + 7, maxn = 2010;
const long double PI = acos(-1);
int n, x, y;
vector<int> ans(maxn, 0);

int main (){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> x >> y;
    int var = y - x - 1;

    for (int i=1; i<n; i++){
        for (int j=i+1; j<=n; j++){
            int dist;
            if (i > x and j < y){
                dist = min(j - i, (i -x) + (y - j) + 1);
            }
            else if (j > x and j < y){
                dist = min(j-i, (y - var - i) + (y-j));
            }
            else if (i <= x and j>= y){
                dist = j - i - var;
            }
            else if (i > x and i < y){
                dist = min(j - i, (i-x) + j - x - var);
            }
            else {
                dist = j-i;
            }
            ans[dist]++;
        }
    }

    for (int i=1; i<n; i++){
        cout << ans[i] << endl;
    }
    return 0;
}

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

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

int main(){
  int n;
  ll x;
  cin >> n >> x;
  vector<ll> sumdp(n+1), pdp(n+1);
  sumdp[0]=1;
  pdp[0]=1;
  for(int i=1; i<=n; i++){
    sumdp[i] = sumdp[i-1]*2+3;
    pdp[i] = pdp[i-1]*2+1;
  }
  ll ans=0;
  while(x && n>=2){
    if(x==sumdp[n]){
      x=0;
      ans+=pdp[n];
      n=0;
    }
    else if(x>sumdp[n]/2){
      ans += pdp[n]/2+1;
      x -= sumdp[n]/2+1;
      n--;
    }else{
      x--;
      n--;
    }
  }
  if(x && n==1){
    x--;
    ans+=min(x,3LL);
    n--;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }


//FUNCTION
void solve(void)
{
  string str;
  cin>>str;
  map<char,int> mp;
  int N = str.size();
  int ANS = N*(N-1)/2;
  for (int i = 0; i < N; i++)
  {
    mp[str[i]]++;
  }
  for (auto i : mp)
  {
    int X = i.second;
    ANS -= (X)*(X-1)/2;
  }
  cout<<ANS+1<<endl;
  

    
  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(15);
  solve();

  return 0;
}


Measured memory_bytes: 720
#include <iostream>
#include <vector>
#include <string>
#include <stdlib.h>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <climits>

#define INF (int)(1e9)

using namespace std;

int main()
{
  string S;

  cin >> S;

  for (auto &i : S) {
    i = 'x';
  }

  cout << S;

  return 0;
}


Measured memory_bytes: 256
import math

def koch(n, p1, p2):
    if n == 0:
        return False

    #p1, p2??????s, t, u????¨????
    s = [0 for i in range(2)]
    t = [0 for i in range(2)]
    u = [0 for i in range(2)]
    s[0] = (2*p1[0] + 1*p2[0]) / 3
    s[1] = (2*p1[1] + 1*p2[1]) / 3
    t[0] = (1*p1[0] + 2*p2[0]) / 3
    t[1] = (1*p1[1] + 2*p2[1]) / 3
    u[0] = (t[0]-s[0]) * math.cos(60 * math.pi / 180) - (t[1]-s[1]) * math.sin(60 * math.pi / 180) + s[0]
    u[1] = (t[0]-s[0]) * math.sin(60 * math.pi / 180) + (t[1]-s[1]) * math.cos(60 * math.pi / 180) + s[1]

    koch(n-1, p1, s)
    print(*s)
    koch(n-1, s, u)
    print(*u)
    koch(n-1, u, t)
    print(*t)
    koch(n-1, t, p2)

p1 = [0, 0]
p2 = [100,0]
n = int(input())
print("0.00000 0.00000")
koch(n, p1, p2)
print("100.0000 0.0000")

Measured memory_bytes: 7900
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
#define PI 3.141592653589793
//vector < vector<int>>a(0, vector<int>(0));二次元配列宣言


int main()
{
	int p, q, r;
	int ans;
	cin >> p >> q >> r;
	ans = min(p + q, q + r);
	ans = min(ans, r + p);
	cout << ans << endl;
}

Measured memory_bytes: 3656
a=input()
b=int(a)

def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

name=num2alpha(b)
print(name.swapcase())



    

Measured memory_bytes: 61796
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int w = sc.nextInt();
        int masu[][] = new int[h + 2][w + 2];
        String s[] = new String[h];
        for (int i = 0; i < h; i++) {
            s[i] = sc.next();
        }
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                char c = s[i].charAt(j);
                if (c == '#') {
                    masu[i + 1][j + 1] = 1;
                }
            }
        }
        for (int i = 1; i < h + 1; i++) {
            for (int j = 1; j < w + 1; j++) {
                if (masu[i][j] == 1) {
                    System.out.print('#');
                } else {
                    int wa = masu[i - 1][j - 1];
                    wa += masu[i - 1][j];
                    wa += masu[i - 1][j + 1];
                    wa += masu[i][j - 1];
                    wa += masu[i][j + 1];
                    wa += masu[i + 1][j - 1];
                    wa += masu[i + 1][j];
                    wa += masu[i + 1][j + 1];
                    System.out.print(wa);
                }
            }
            System.out.println();
        }

    }
}

Measured memory_bytes: 21716
using System;
using System.ComponentModel.Design.Serialization;

namespace rensyuu1
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            //大文字定義
            char[] bigs = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
            //小文字定義
            char[] smalls = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
            //読み取り長
            int l = input.Length;
            //読み取り文字列分解
            char[] c = input.ToCharArray();
            for (int i1 = 0; i1 < l; i1++)
            {
                //大文字を1文字ずつ確かめて、一致すれば小文字へ
                for (int i2 = 0; i2 < 26; i2++)
                {
                    if (c[i1] == bigs[i2])
                    {
                        c[i1] = smalls[i2];
                    }
                    //小文字を1文字ずつ確かめて、一致すれば大文字へ
                    else if (c[i1] == smalls[i2])
                    {
                        c[i1] = bigs[i2];
                    }
                    else
                    {
                        continue;
                    }
                }
            }

            string str = new string(c);
            Console.WriteLine(str);

        }
    }
}


Measured memory_bytes: 17828
#include<bits/stdc++.h>
using namespace std;
int main()
  {
  int n,k;
  cin>>n>>k;
  if(n<=k)
    cout<<0<<endl;
  
  else {
    int a[n];
    for(int i=0;i<n;++i)
      cin>>a[i];
    
    sort(a,a+n);
    long long sum=0;
    for(int i=0;i<n-k;++i)
      sum+=a[i];
    cout<<sum<<endl;
    }
  return 0;
  }


Measured memory_bytes: 1024
fun main (args : Array<String>) {
	val (x, a) = readLine()!!.split(" ").map(String::toInt)
	val X : Int = x.toInt()
	val A : Int = a.toInt()
	return if (X < A) {
		println("0")
	} else {
		println("10")
	}
}

Measured memory_bytes: 37692
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n, k;
    cin >> n >> k;
    if (k > (n - 1) * (n - 2) / 2) {
        cout << -1 << endl;
        return 0;
    }
    cout << n - 1 + (n - 1) * (n - 2) / 2 - k << endl;
    for (int i = 2; i <= n; ++i) {
        cout << 1 << " " << i << endl;
        for (int j = i + 1; j <= n; ++j)
            if (k < (n - 1) * (n - 2) / 2)
                ++k, cout << i << " " << j << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define int long long
 
#define PB push_back
#define MP make_pair
#define S second
#define F first
//#define D cout<<"*\n";
#define fast ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define mod 1000000007 
const double pi = 3.14159265358979323846; 


signed main()
{
    fast
    int t=1;
   // cin>>t;
    
    while(t--)
    {
      int n,k;
	  cin>>n>>k;
	  int a[n+1];
	  for(int i=0;i<n;i++)
	  {
	  	cin>>a[i+1];
		  }	
		int dp[n+1];
		dp[0]=0;
		dp[1]=0;
		a[0]=10e8;
		for(int i=2;i<=n;i++)
		{
		int mn=INT_MAX;
		for(int j=i-1,l=0;j>=1&&l<k;j--,l++)
		{
				int t=dp[j]+abs(a[i]-a[j]);
				if(t<mn)
				{
					mn=t;
				}
			
		}
			dp[i]=mn;
		  }  
		  cout<<dp[n];
    }
	return 0;
}

	

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < int(n); ++ (i))
using ll = long long;
using namespace std;
template <typename X, typename T> auto vectors(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto vectors(X x, Y y, Z z, Zs... zs) { auto cont = vectors(y, z, zs...); return vector<decltype(cont)>(x, cont); }

ll solve(int n, vector<vector<int> > const & a) {
    REP (k, n) REP (i, n) REP (j, n) {
        if (a[i][k] + a[k][j] < a[i][j]) {
            return -1;
        }
    }
    ll acc = 0;
    REP (i, n) REP (j, i) {
        bool is_required = true;
        REP (k, n) if (k != i and k != j) {
            if (a[i][k] + a[k][j] == a[i][j]) {
                is_required = false;
                break;
            }
        }
        if (is_required) {
            acc += a[i][j];
        }
    }
    return acc;
}
int main() {
    int n; cin >> n;
    auto a = vectors(n, n, int());
    REP (i, n) REP (j, n) cin >> a[i][j];
    ll result = solve(n, a);
    cout << result << endl;
    return 0;
}


Measured memory_bytes: 640
X = int(input())

while X > 99:
    if str(X)[-1] >= "5" or str(X)[-2] != "0":
        X -= 105
    elif str(X)[-1] == "4":
        X -= 104
    elif str(X)[-1] == "3":
        X -= 103
    elif str(X)[-1] == "2":
        X -= 102
    elif str(X)[-1] == "1":
        X -= 101
    elif str(X)[-1] == "0":
        X -= 100
# print(X)
if X == 0:
    print(1)
else:
    print(0)

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;

using System.Text;
using System.Threading.Tasks;

using System.Globalization;

namespace AtCoder
{
    class Program
    {
        public static void Main()
        {
            string[] str = Console.ReadLine().Split(' ');
            decimal N = decimal.Parse(str[0]);
            decimal A = decimal.Parse(str[1]);
            decimal B = decimal.Parse(str[2]);
            decimal Sum = 0;
            decimal Q = 0;

            Q = Math.Floor(N / (A + B));

            Sum += A * Q;
            N -= (A + B) * Q;

            if(N >= A)
            {
                Sum += A;
            }
            else
            {
                Sum += N;
            }

            Console.WriteLine("{0}", Sum);
            
        }   
    }
}

Measured memory_bytes: 13140
#include <iostream>
//#include <numeric>
//#include <vector>
	//#include<math.h>
	//#include <algorithm>
	//#include <functional>
	//#include <numeric>
	//#include<cmath>
//#include <stdio.h> 
//#include <cstdint>
	//#include <string>
	//#include <cstdlib>
	//#define pi 3.14159265359
using namespace std;


	int main() {

		int a, b;
		cin >> a >>b;

		if (a > b) {
			for (int i = 0; i < a; i++)
				cout << b;
		}

		else {
			for (int i = 0; i < b; i++)
				cout << a;
		}
		


		return 0;

	}

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

int main(){
  string S;
  string T;
  getline(cin, S);
  getline(cin, T);
  bool judge = true;
  for(auto i = 0; i < S.size(); i++){
    if(S.at(i) != T.at(i)) judge = false;
  }
  if(T.size() == S.size() + 1 && judge == true) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3592
fn solve(n: i32) -> i32 {
    let m: i64 = 1_000_000_007;
    (1i64..(n as i64 + 1)).fold(1i64, |s, i| s * i % m) as i32
}

fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let n = s.trim().parse().ok().unwrap();
    let res = solve(n);
    println!("{}", res);
}


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

using namespace std;

int main (int argc, char const* argv[])
{
	int n;
	cin >> n;
	while(n)
	{
		vector<int> ary = vector<int>(n);
		for (unsigned int i = 0; i < n; i += 1)
		{
			cin >> ary[i];
		}
		int s = 0;
		for(int i = 0;i < n;i++)
		{
			for(int j = 1;j < (n-i);j++)
			{
				if(ary[j-1] > ary[j])
				{
					int tmp = ary[j-1];
					ary[j-1] = ary[j];
					ary[j] = tmp;
					s++;
				}
			}
		}
		cout << s << endl;
		cin >> n;
	}
	return 0;
}

Measured memory_bytes: 1200