akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <math.h>
#include <numeric>

using namespace std;

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;
}

int main() {
	int menu_array[5];
	int temp;
	int sum = 0;
	int min = 9999;
	int flg2 = 0;

	for (int i = 0; i < 5; i++) {
		cin >> temp;

		menu_array[i] = temp;

		if (temp % 10 != 0 && flg2 == 0) {
			if (min == 9999) {
				min = temp;
			}
			flg2++;
		}

		if(flg2 == 0){
			min = temp;
		}



		if (temp % 10 != 0) {
			if ((min % 10) > (temp % 10)) {
				min = temp;
			} else {
				continue;
			}
		}

	}

	int flg = 0;

	for (int i = 0; i < 5; i++) {
		if (menu_array[i] == min && flg == 0) {
			flg++;
			continue;
		} else if (menu_array[i] % 10 == 0) {
			sum += menu_array[i];
		} else {
			sum += menu_array[i] + (10 - menu_array[i] % 10);
		}
	}

	sum += min;

	cout << sum << endl;

}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define MOD (1000000007l)
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)

using namespace std;

void solve() {
  ll N;
  cin >> N;
  ll length = 0;
  vector<ll> accum(N+1);
  rep (i, N) {
    ll tmp;
    cin >> tmp;
    length += tmp;
    accum[i+1] = accum[i] + tmp;
  }
  ll ans = length;
  for (ll i = 1; i < N; i++) {
    ll tmp = length - accum[i];
    ll foo = abs(accum[i] - tmp);
    ans = min(ans, foo);
  }
  cout << ans << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  solve();
  return 0;
}


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

typedef vector<int> vi;
struct Edge {
	int idx;
	int len;
	Edge(int idx, int len) :
			idx(idx), len(len) {
	}
};
typedef struct Edge Edge;
typedef vector<Edge> ve;
typedef vector<ve> vve;

#define VLP(v,itr,_end) for(auto itr=v.begin(),_end=v.end();itr!=_end;++itr)
#define VCLP(v,itr,_end) for(auto itr=v.cbegin(),_end=v.cend();itr!=_end;++itr)

void dfs(vi &color, const vve &G, const int idx) {
	int c = color[idx], c_1 = (c ^ 1) & 1;
	VCLP(G[idx],itr,end) {
		if(color[itr->idx]!=-1){
			continue;
		}
		if (itr->len % 2 == 0) {
			color[itr->idx] = c;
		} else {
			color[itr->idx] = c_1;
		}
		dfs(color, G, itr->idx);
	}
}

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

	vve G(N);

	for (int i = 0; i < N - 1; ++i) {
		int u, v, w;
		cin >> u >> v >> w;
		--u;
		--v;
		G[u].push_back(Edge(v, w));
		G[v].push_back(Edge(u, w));
	}

	vi color(N);
	VLP(color,itr,end) *itr=-1;
	color[0] = 0;

	dfs(color, G, 0);

	VCLP(color,itr,end) cout<<*itr<<endl;

	return 0;
}

Measured memory_bytes: 11224
package main

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

func main() {
	sc := NewScanner()
	H, W, N := sc.NextInt(), sc.NextInt(), sc.NextInt()

	A := max(H, W)

	fmt.Println((N + A - 1) / A)

}

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

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextFloat() float64 {
	v, _ := strconv.ParseFloat(s.Next(), 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1)
#define N 1000000007
#define ll long long
#define ull unsigned long long
#define mem(a) memset(a,0,sizeof(a))
char s[200500];
ll s1[2019];
ll a[2019];
void solve()
{
    cin>>s;
	int n=strlen(s);
	ll sum=0;
	int tem;
	for(int i=0;i<n;i++)
	{
		tem=s[i]-'0';
		a[tem]=1;
		for(int j=0;j<2019;j++)
		{
			if(s1[j]!=0)
			{
			    a[(j*10+tem)%2019]+=s1[j];
			}
		}
		memcpy(s1,a,sizeof(a));
		memset(a,0,sizeof(a));
		sum+=s1[0];
	}
	cout<<sum<<endl;
}
int main()
{
    solve();
	return 0;
}


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

int n,k,s,a[6000];
bitset<6000>f;

int main()
{
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]),a[i]=min(a[i],k),s+=a[i];
	sort(a+1,a+n+1);
	f[0]=1;
	for(int i=n;i>=1;i--){
		bool bo=1;
		for(int j=max(k-s,0);j<k;j++)
		  if(f[j]){
		  	bo=0;break;
		  }
		if(bo){
			printf("%d\n",i);
			return 0;
		}
		f|=f<<a[i];s-=a[i];
	}
	printf("0\n");
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
#define pb push_back
 
const int maxn = 1e5 + 20;
const int mod = 998244353;

int a[maxn];

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

	int n;
	cin >> n;

	for(int i = 0; i < n; i++)
		cin >> a[i];

	int res = 0;
	ll sum = 0;
	for(int i = 0; i < n; i++)
	{
		int x;
		cin >> x;
		a[i] -= x;

		if(a[i] < 0)
			res++ , sum += a[i];
	}

	sort(a , a + n);
	for(int i = n; i >= 0; i--)
	{
		sum += a[i];
		res += (i < n);
		if(sum >= 0)
			return cout << res << endl , 0;
	}

	cout << -1 << endl;
}


















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

#define mp make_pair
#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 < n; i++)
#define for1(i,n) for(int i = 1; i <= n; i++)
#define ford(i,n) for(int i = n-1; i >= 0; i--)
#define fore(i,a,b) for(int i = a; i <= b; i++)

using namespace std;

typedef long long ll;
typedef double ld;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;


const  int MAXn= 3e5+5;
const  long long INF= 1e18;
const long long mod= 1e9+7;


int main(){
        ll 	a,b;
        cin>>a>>b;
        
        ll n= __gcd(a,b);
        
        int count=0;
        if(n%2==0){
        while (n % 2 == 0)n=n/2;
        count++;
	}
          
    for (ll i = 3; i*1LL*i <= n; i = i + 2){
		if(n%i==0){
        while (n % i == 0)n = n/i;
        count++;  
        }  
    }  
  
    if(n>2) count++;
    cout<<count+1;
}  
    


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
	int a[10000];
	int i=0;
	int b=0;
	for(i=0;i<11000;i++){
		cin>>a[i];
		if(a[i]==0){
			break;
		}
		b++;
	}
	for(i=0;i<b;i++){
		cout<<"Case "<<i+1<<": "<<a[i]<<endl;
	}
}

Measured memory_bytes: 1196
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <complex>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <stack> 
#include <bitset>
#include <queue>
#include <assert.h>
#include <unordered_map>
using namespace std;

const int N = 200010;
int a[N], b[N];
long long sum1[N], sum2[N];
int main()
{
	int n, m, r;
	scanf("%d%d%d", &n, &m, &r);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
		sum1[i] = sum1[i - 1] + a[i];
	}
	for (int i = 1; i <= m; i++) {
		scanf("%d", &b[i]);
		sum2[i] = sum2[i - 1] + b[i];
	}

	int ans = 0;
	for (int i = 0; i <= n; i++) {
		if (sum1[i] > r) break;
		int lt = 0, rt = m, mid, pos = 0;
		while (lt <= rt) {
			mid = (lt + rt) >> 1;
			if (sum1[i] + sum2[mid] <= r) {
				pos = mid;
				lt = mid + 1;
			} else rt = mid - 1;
		}
		ans = max(ans, i + pos);
	}

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


Measured memory_bytes: 7920
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
#include <iostream>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
#define pf(n) cout << n << endl
#define ps() cout <<" ";
#define sf(n) cin >> n
#define in(i,n) for (int i = 0; i < n; i++)
#define vi vector<int>
#define vp vector<pair<int, int>>
#define graph vector< vector<int> >
#define vs vector<string>
/**  '' "\n" ^ -  =**/

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    cout<<pow(n,3);
}


Measured memory_bytes: 384
# -*- coding: utf-8 -*-
S = input()
s = list(S)

result = True

for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == "L":
            result = False
            break
        continue
    if i % 2 == 1:
        if s[i] == 'R':
            result = False
            break
if result:
    print("Yes")
else:
    print("No")
            

Measured memory_bytes: 38256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int N;
	ll A[100001],B[100001];
	ll husoku=0;
	ll amari[100001];
	ll ans=0;
	ll nowsum=0;
	ll minuscount=0;
	scan(N);
	rep(i,N){
		scan(A[i]);
	}
	rep(i,N){
		scan(B[i]);
		amari[i]=max(0LL,A[i]-B[i]);
		husoku+=max(0LL,B[i]-A[i]);
		if(B[i]>A[i]) minuscount++;
	}
	sort(amari,amari+N);
	for(int i=N-1;i>=0;i--){
		if(nowsum>=husoku){
			prin(N-i-1+minuscount);
			return 0;
		}
		else{
			nowsum+=amari[i];
		}
	}
	prin(-1);
	return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;

struct arm{
    ll min, max;
};
bool cmp_max(const arm &x, const arm &y){
    return x.max < y.max;
}

int main(){
    int n;
    cin >> n;
    vector<arm> Arm;
    for(int i=0;i<n;i++){
        ll x, l;
        cin >> x >> l;
        arm a;
        a.min = x - l;
        a.max = x + l;
        Arm.push_back(a);
    }
    sort(Arm.begin(), Arm.end(), cmp_max);
    int ans = 1;
    ll max = Arm[0].max;
    for(int i=1;i<n;i++){
        if(max <= Arm[i].min){
            ans++;
            max = Arm[i].max;
        }
    }

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

Measured memory_bytes: 2420
#include <bits/stdc++.h>
using namespace std;
// define
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (((a)%mod) * ((b)%mod)) % mod
#define rollcall cout << "I'm Sucu." << endl;
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define dmt(x, y, z) make_tuple(x, y, z)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define fi first
#define se second
// debug
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p){
  os << "(" << p.first << "," << p.second << ")";return os;
}
template <typename T, typename U, typename V>
ostream &operator<<(ostream &os, const tuple<T, U, V> &t){
  os << "(" << get<0>(t) << "," << get<1>(t) << "," << get<2>(t) << ")";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  for (auto it = v.begin();it != v.end();++it){
    if(it != v.begin())os << " ";os << *it;
  }return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &mp){
  for(auto x: mp)os << "(" << x.first << "," << x.second << ")" << endl;
  return os;
}
template<typename T, int SIZE>
int array_length(const T (&)[SIZE]){return SIZE;}
template<typename T, int N>
void PRINTF(const T (&a)[N], int s = N, int t = -1, bool f = true){
	if(t == -1){rep(i,s){if(i)cout << " ";cout << a[i];}}
	else repi(i,s,t){if(i!=s)cout << " ";cout << a[i];}
	if(f)cout << "\n";
}
template<typename T, int N1, int N2>
void PRINTF(const T (&a)[N1][N2], int h = N1, int w = N2){
	rep(i,h){rep(j,w){cout << a[i][j] << " \n"[j==w-1];}}
}
string substr(const string &str, int S1, int S2 = -1){
  if(S2 == -1)return str.substr(S1);
  return str.substr(S1, S2-S1);
}
// typedef
typedef complex<double> Point;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef tuple<int, int, int> TT;
typedef pair<int, TT> PT;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;
// int sum = accumulate(a, a+n, 0LL);
// int mx = max_element(a, a+n);
// int mn = min_element(a, a+n);
// int cnt = count(a, a+n, k);


int a[100000];
signed main(){
  int n, mx;cin >> n >> mx;
  rrep(i,n)cin >> a[i];
  int x = 0, ans = 0;
  rep(i,n+1){
    x += a[i];
    if(x <= mx)ans++;
  }
  cout << ans << endl;
  return 0;
}






Measured memory_bytes: 256
inp = input()
split_input = inp.split()
n = int(split_input[0])
x = int(split_input[1])
inp = input()
split_input = inp.split()
number = 0
count = 1
for st in split_input:
    l = int(st)
    number += l
    if number > x:
        break
    count += 1
print(count)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <cmath>

using namespace std;
using ll = long long;
using ull = unsigned long long;

namespace
{
	ll GCD(ll a, ll b)
	{
		return a == 0 ? b : GCD(b % a, a);
	}
}
void ABC109C()
{
	int N, X;
	cin >> N >> X;
	vector<int> x(N);
	for (auto& y : x)
	{
		cin >> y;
		y -= X;
		y = abs(y);
	}
	sort(x.begin(), x.end());
	x.erase(unique(x.begin(), x.end()), x.end());
	int M = static_cast<int>(x.size());
	ll gcd = x.front();
	for (int i = 1; i < M; ++i)
	{
		gcd = GCD(gcd, x[i]);
	}
	cout << gcd << endl;
}

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

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

int main(){

	long int W,a,b;

	cin >> W >> a >> b;

	if(b < a - W){
		cout << a-(b+W);
	}else if(a-W <= b && b <= a + W){
		cout << 0;
	}else{
		cout << b-(a+W);
	}

	cout << endl;
	
	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/python3

import os
import sys


def main():
    N = read_int()
    ans = solve(N)
    if ans is None:
        print(':(')
    else:
        print(ans)


def solve(N):
    M = N * 100 // 108
    for d in range(20):
        if (M + d) * 108 // 100 == N:
            return M + d
        if (M - d) * 108 // 100 == N:
            return M - d
    return None


###############################################################################

DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
#include "bits/stdc++.h"
using namespace std;
int main(){
    int a[4],i,j,now;
    string s,ans[9];
    cin >> s;
    for(i=0;i<4;i++){
        a[i]=s[i]-'0';
        ans[2*i]=s[i];
    }
    for(i=0;i<(1<<3);i++){
        now = a[0];
        for(j=0;j<3;j++){
            if(i&(1<<j)){
                now += a[j+1];
                ans[2*j+1]='+';
            }else{
                now -= a[j+1];
                ans[2*j+1]='-';
            }
        }
        if(now==7) break;
    }
    ans[7]='=';ans[8]='7';
    for(i=0;i<9;i++) cout << ans[i];
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int k=0;
while(n){
    if(n%10==7)
    {
        k=1;
        break;
    }
    n/=10;
}
if(k)
    cout<<"Yes";
else cout<<"No";

}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define REP(i,n) for (long long i=0;i<(n);i++)
#define FOR(i,a,b) for (long long i=(a);i<(b);i++)
#define RREP(i,n) for(long long i=n;i>=0;i--)
#define RFOR(i,a,b) for(long long i=(a);i>(b);i--)
#define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i]) << endl
#define dump2d_arr(array) REP(i,array.size()) REP(j,array[i].size()) cerr << #array << "[" << (i) << "]" << "[" << (j) << "] ==> " << (array[i][j]) << endl
#define dump(x)  cerr << #x << " => " << (x) << endl


#define dumpP(p) cerr << "( " << p.first << " , " << p.second << " )" << ends
#define SORT(c) sort((c).begin(),(c).end())
#define MIN(vec) *min_element(vec.begin(), vec.end())
#define MAX(vec) *max_element(vec.begin(), vec.end())
#define UNIQ(vec) vec.erase(unique(vec.begin(), vec.end()),vec.end()) //ソートの必要あり
#define IN(n,m)  (!(m.find(n) == m.end()))
#define ENUM(m) for (auto itr = m.begin(); itr != m.end(); ++itr)
#define dump_MAP(m) for(auto itr = m.begin(); itr != m.end(); ++itr) { cerr << itr->first << " --> "  << itr->second << endl; }
#define FINDL(vec,x) (lower_bound(vec.begin(),vec.end(),x) - vec.begin())
#define FINDU(vec,x) (upper_bound(vec.begin(),vec.end(),x) - vec.begin())
#define ROUND(N) setprecision(N)
#define ROUND_PRINT(N,val) cout << fixed;cout << setprecision(N) << val << endl
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define INARR(h,w,x,y) (0 <= y && y < h && 0 <= x && x < w)
#define EQ(a,b) (abs(a - b) < 1e-10)
using namespace std;
constexpr int dx[4] = {0,1,0,-1};
constexpr int dy[4] = {1,0,-1,0};
constexpr long double pi = M_PI;
constexpr double eps = 1e-10;
constexpr long mod = 1000000007;
constexpr short shINF = 32767;
constexpr long loINF = 2147483647;
constexpr long long llINF = 9223372036854775807;
typedef long long LL;
typedef vector<LL> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<LL,LL> pr;
typedef vector<bool> VB;
typedef vector<pr> VP;
typedef priority_queue<pr,vector<pr>,greater<pr>> pq;

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	long n;
	cin >> n;
	VI A(n),B(n),C(n);
	REP(i,n) cin >> A[i];
	REP(i,n) cin >> B[i];
	REP(i,n) cin >> C[i];
	SORT(A);SORT(B);SORT(C);
	long num1,num2,cnt = 0;
	REP(i,n) {
		num1 = FINDL(A,B[i]);
		num2 = (n - FINDU(C,B[i]));
		cnt += (num1 * num2);
	}
	cout << cnt << endl;
}






Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,b,c,sum;
  cin >> a >> b >> c;
  int mn = 300;
  for(int i=0;i<101;i++)
    {
      sum = abs(a - i) + abs(b - i) + abs(c - i);
      mn = min(sum,mn);
    }
  cout << mn << endl;


  return 0;
}


Measured memory_bytes: 256
def lscan; gets.split.map(&:to_i); end

str = gets.chomp

8.times do |i|
    rs = "^keyence$"
    r = Regexp.new(rs[0..i]+".*"+rs[(i+1)..-1])
    if r =~ str
        puts "YES"
        exit
    end
end
puts "NO"

Measured memory_bytes: 1788
#include<stdio.h>
int main(void){
  int n;
  scanf("%d",&n);
  int a[n],b[n],c[n-1],sum=0;
  for(int i=0;i<n;i++){
	scanf("%d",&a[i]);
  }
  for(int i=0;i<n;i++){
	scanf("%d",&b[i]);
    sum+=b[i];
  }
  for(int i=0;i<n-1;i++){
	scanf("%d",&c[i]);
  }
  for(int i=0;i<n-1;i++){
    if(a[i+1]-a[i]==1)sum+=c[a[i]-1];
  }
  printf("%d",sum);
  return 0;
}


Measured memory_bytes: 128
import java.util.*;

public class Main {
	int ans;
	ArrayList<Integer> ansList;
	int n;
	int [][] pass;
	private void solve(int sum, ArrayList<Integer> list){
		if(ans < sum){
			ans = sum;
			ArrayList<Integer> work = new ArrayList<Integer>();
			work.addAll(list);
			ansList =work;
		}
		//find
		int last = list.get(list.size() - 1);
		//System.out.println(last + " " + deep + " " + list.toString());
		for(int i=0; i < n; i++){
			//check a duplicate pass
			
			if(check(last,i,list) && pass[last][i] != -1){
				//System.out.println(last + " " + i + " " + pass[last][i] );
				list.add(i);
				solve(sum + pass[last][i], list);
				list.remove(list.size()-1);
			}
		}
	}
	
	private boolean check(int last , int now, ArrayList<Integer> list){
		for(int i=0; i < list.size()-1; i++){
			if((list.get(i) == last && list.get(i+1) == now) || (list.get(i) == now && list.get(i+1) == last)){
				return false;
			}
		}
		return true;
	}
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(true){
			n = sc.nextInt();
			int m = sc.nextInt();
			if(n == 0 && m == 0){
				break;
			}
			pass = new int[n][n];
			for(int i=0; i < n; i++) Arrays.fill(pass[i], -1);
			for(int i=0; i < m; i++){
				int from = sc.nextInt() - 1;
				int to = sc.nextInt() - 1;
				int dis = sc.nextInt();
				pass[from][to] = dis;
				pass[to][from] = dis;
			}
			ans = 0;
			ansList = new ArrayList<Integer>();
			for(int i=0; i < n; i++){
				ArrayList<Integer> work = new ArrayList<Integer>();
				work.add(i);
				solve(0,work);
			}
			//print
			//System.out.print("ANS= ");
			System.out.println(ans);
			System.out.print(ansList.get(0) + 1);
			for(int i=1; i < ansList.size(); i++){
				System.out.print(" " + (ansList.get(i) + 1));
			}
			System.out.println();
			//debug
//			System.out.println("debug=");
//			for(int i=0; i < n; i++){
//				for(int j=0; j < n; j++){
//					System.out.print(pass[i][j] +" ");
//				}
//				System.out.println();
//			}
//			System.out.println();
		}
	}

	public static void main(String[] args) {
		Main obj = new Main();
		obj.doit();
	}
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;

typedef tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// order_of_key(val): returns the number of values less than val
// find_by_order(k): returns an iterator to the kth largest element (0-based)

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl "\n"

template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) 
{
    os << "{ ";
    for(auto& y : x) 
    {
        os << y << " ";
    }
    return os << "}";
}

template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) 
{
    return os << "[" << p.ff << ", " << p.ss << "]";
}

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

    return gcd(b, a%b);
}

ll modexp(ll a, ll b, ll c)
{   
    a%=c;

    ll ans = 1;

    while(b)
    {
        if(b&1)
        {
            ans = (ans*a)%c;
        }

        a = (a*a)%c;
        b >>= 1;
    }

    return ans;
}

const ll L = 1e5+5;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    ll N;
    cin >> N;

    string s, t;
    cin >> s >> t;

    for(ll i=0; i<N; i++)
    {
        cout << s[i] << t[i];
    }
    cout << endl;

    return 0;
}

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

#define rep(i,s,n) for (int i = (int)s; i < (int)n; i++)
#define ll long long
#define pb push_back
#define eb emplace_back
#define All(x) x.begin(), x.end()
#define Range(x, i, j) x.begin() + i, x.begin() + j
#define lbidx(x, y) lower_bound(x.begin(), x.end(), y) - x.begin()
#define ubidx(x, y) upper_bound(x.begin(), x.end(), y) - x.begin()
#define llbidx(x, y, z) lower_bound(x.begin(), x.end(), z) - lower_bound(x.begin(), x.end(), y) // 二要素間の距離
#define deg2rad(deg) ((((double)deg)/((double)360)*2*M_PI))
#define rad2deg(rad) ((((double)rad)/(double)2/M_PI)*(double)360)
#define Find(set, element) set.find(element) != set.end()
#define Decimal(x) printf("%.10f\n", x) // 小数点を10桁まで表示
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << endl;

typedef pair<int, int> PI;
typedef pair<ll, ll> PLL;

int POWINT(int x, int n) {
  int ret = 1;
  rep(i, 0, n) ret *= x;
  return ret;
};

ll POWLL(int x, int n) {
  ll ret = 1;
  rep(i, 0, n) ret *= x;
  return ret;
};

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;
};

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

  int N, M;
  cin >> N >> M;

  int nc2, mc2;
  if (N < 2) {
    nc2 = 0;
  } else {
    nc2 = N*(N-1)/2;
  }

  if (M < 2) {
    mc2 = 0;
  } else {
    mc2 = M*(M-1)/2;
  }

  cout << nc2 + mc2 << endl;



  return 0;
};


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
bool contains(string &s){
  for(int i = 0; i < s.length(); i++){
    if(s[i] == '#') return true;
  }
  return false;
}
void printV(vector<vector<int>> &v){
  for(int i = 0; i < v.size(); i++){
    for(int j = 0; j < v[i].size(); j++){
      cout << v[i][j] << " ";
    }
    cout << endl;
  }
}
int main(){
  int H, W, K; cin >> H >> W >> K;
  vector<vector<int>> res (H, vector<int> (W));
  vector<string> m (H);
  int c = 0;
  for(int i = 0; i < H; i++){
    cin >> m[i];
    if(contains(m[i])) c++;
    bool b = false;
    for(int j = 0; j < W; j++){
      if(m[i][j] == '#'){
        if(b) c++;
        b = true;
      }
      res[i][j] = c;
    }
  }
  for(int i = 1; i < H; i++){
    if(!contains(m[i])) res[i] = res[i-1];
  }
  for(int i = H-2; i >= 0; i--){
    if(!contains(m[i])) res[i] = res[i+1];
  }
  printV(res);
}


Measured memory_bytes: 1280
while True:
    n, x = map(int, input().split())
    if 0 == n == x: break
    count = 0
    a_max = min(n, x - 3)
    for a in range(a_max, a_max // 3, -1):
        b_max = min(a - 1, x - a - 1)
        for b in range(b_max, b_max // 3, -1):
            if x - a - b >= b: break
            count += 1
    print(count)



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

const int MAX_N = 110;
int d[MAX_N], X;

int main()
{
    int N;
    cin >> N;
    string Sd;

    string S;
    cin >> S;
    Sd = ' ' + S; // 1-indexedにする

    X = 1000000000;
    for(int i = 1; i <= N; ++i) {
        if(Sd[i] == '(') ++d[i];
        else            --d[i];
        d[i] += d[i-1];
        X = min(X, d[i]);
    }
    //printf("ds: %d X: %d\n", d[N], X);
    if(X > 0) {
        S += string(d[N], ')');
        cout << S << endl;
    }
    else {
        cout << string(-X,'(') + S + string(d[N]-X, ')') << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){
  int n;
  scanf("%d", &n);
  int c=0;
  for(int i=1;i<=n;i++){
    int a;
    scanf("%d", &a);
    if(i%2!=0){
      if(a%2!=0){
        c++;
      }
    }
  }
  printf("%d", c);
  return 0;
}

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

#define REP(i,n) for(int i=0;i<n;i++)
typedef long long int lli;
typedef pair<int, int> P;

int main() {
    string s;
    cin >> s;
    string front = s.substr(0,2);
    string back = s.substr(2);
    int front_num = atoi(front.c_str());
    int back_num = atoi(back.c_str());
    if (front_num == 0 && back_num == 0)
        cout << "NA" << endl;
    else if (front_num == 0) {
        // front が 0 => front が 年
        if (back_num <= 12)
            cout << "YYMM" << endl;
        else
            cout << "NA" << endl;
    }
    else if (back_num == 0) {
        // back が 0 => back が 年
        if (front_num <= 12)
            cout << "MMYY" << endl;
        else
            cout << "NA" << endl;
    }
    else if (front_num <= 12 && back_num <= 12)
        cout << "AMBIGUOUS" << endl;
    else if (front_num <= 12)
        cout << "MMYY" << endl;
    else if (back_num <= 12)
        cout << "YYMM" << endl;
    else
        cout << "NA" << endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

void solve()
{
	int n;
	while(cin >> n)
	{
		int sum = 0;
		if(n == -1)
		{
			break;
		}
		if(n > 30)
		{
			sum += (n - 30) * 160;
			n = 30;
		}
		if(n > 20)
		{
			sum += (n - 20) * 140;
			n = 20;
		}
		if(n > 10)
		{
			sum += (n - 10) * 125;
			n = 10;
		}
		if(n >= 0)
		{
			sum += 1150;
		}
		cout << 4280 - sum << endl;
	}
}

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

Measured memory_bytes: 0
//
// Created by 26019 on 2020/6/14/014.
//

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;
vector<int> arr;
int h[101];

void solve() {
    int x, n;
    cin >> x >> n;
    if (n == 0) {
        cout << x << endl;
        return;
    }
    for (int i = 0; i < n; ++i) {
        int t;
        cin >> t;
        arr.push_back(t);
        h[t]++;
    }
    sort(arr.begin(), arr.end());
    int num1 = x++;
    int num2 = --x;
    // 先向左边找
    while (h[num1]) {
        num1++;
    }
    while (h[num2]) {
        num2--;
    }
    int res = 0;
    res = abs(num1 - x) < abs(num2 - x) ? num1 : num2;
    cout << res;
}

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


Measured memory_bytes: 3196
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
#define FOR(i, a, b) for(ll i = a; i < (ll)(b); i++)

#define ALL(x) (x).begin(), (x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

using namespace std;
using ll = long long;
using vel = vector<ll>;
using ves = vector<string>;
using veb = vector<bool>;
using qul = queue<ll>;

int binary_search(ll x, vel a){
    auto ite = lower_bound(ALL(a), x);
    if(ite != a.end() && *ite == x) {
        return ite - a.begin() ;
    } else {
        return -1;
    }

}

ll modpow(ll a, ll n, ll mod) {
    if(n == 0)
        return 1;
    if(n == 1)
        return a % mod;
    if(n % 2 == 1)
        return (a * modpow(a, n - 1, mod)) % mod;
    ll t = modpow(a, n / 2, mod);
    return (t * t) % mod;
}

int main() {
    ll K, ans = -1, seven = 0,num;
    bool flag = false, over = true; 
    cin >> K;
    if (K % 2 == 0){
        cout << ans << endl;
    } else {

        ans = 1;

        REP(i, 16) {
            seven *= 10;
            seven += 7;
            if(seven % K == 0){
                flag = true;
                break;
            } else {
                ans ++;
            }

            if(seven > K) {
                over = true;
                break;
            }
        }


        if (flag == true){
            cout << ans << endl;
        } else {
            if(over == true) {
                num = seven % K;
                REP(i, 2000000){
                    num = num * 10  + 7;
                    
                    if(num % K == 0) {
                        flag = true;
                        break;
                    }
                    ans++;
                    num %= K;
                }
            }
            if(flag == true) {
                cout << ans << endl;
            } else {
                cout << -1 << endl;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define sz(arr) (int)arr.size()
#define all(arr) arr.begin(), arr.end()

using namespace std;

void _cin() {}
template <class Head, class... Tail>
void _cin(Head&& head, Tail&&... tail) {
  cin >> head;
  _cin(forward<Tail>(tail)...);
}

#define Cin(T, ...) \
  T __VA_ARGS__;    \
  _cin(__VA_ARGS__)

int main() {
  Cin(string, s);

  for (int i = 0; i < sz(s) - 1; ++i) {
    if (s[i] == s[i + 1]) {
      puts("Bad");
      return 0;
    }
  }
  puts("Good");

  return 0;
}

Measured memory_bytes: 256
// ACM-ICPCà\I2008 E. åÊ]ªµ

#include <iostream>
#include <complex>
#include <stdio.h>

using namespace std;

typedef complex<double> P;
double EPS = 1e-8;

double dot(P a, P b) { return real(conj(a)*b); }
double cross(P a, P b) { return imag(conj(a)*b); }

double dist(P la, P lb, P p){
	if(dot(lb-la,p-la)<EPS) return abs(p-la);
	if(dot(la-lb,p-lb)<EPS) return abs(p-lb);
	return abs(cross(lb-la,p-la)) / abs(lb-la);
}

bool crossLine(P la, P lb, P ma, P mb){
	return cross(lb-la,ma-la)*cross(lb-la,mb-la)<0&&
		cross(mb-ma,la-ma)*cross(mb-ma,lb-ma)<0;
}

double distSquare(P la, P lb, double ma, double mb, double Ma, double Mb){
	P L[2]; L[0] = la, L[1] = lb;
	P M[4]; M[0] = P(ma,mb); M[1] = P(Ma,mb); M[2] = P(Ma,Mb); M[3] = P(ma,Mb);
	double a = dist(L[0], L[1], M[0]);
	for(int i=1;i<4;i++){
		double b = dist(L[0], L[1], M[i]);
		if(a>b) a = b;
	}
	for(int i=0;i<4;i++){
		for(int j=0;j<2;j++){
			double b = dist(M[i],M[(i+1)%4],L[j]);
			if(a>b) a = b;
		}
	}
	return a;
}

bool rightup(P a, P b){
	return real(a)<real(b)&&imag(a)<imag(b);
}

bool crossSquare(P la, P lb, double ma, double mb, double Ma, double Mb){
	if(crossLine(la,lb,P(ma,mb),P(Ma,mb))) return true;
	if(crossLine(la,lb,P(ma,mb),P(ma,Mb))) return true;
	if(crossLine(la,lb,P(Ma,mb),P(Ma,Mb))) return true;
	if(crossLine(la,lb,P(ma,Mb),P(Ma,Mb))) return true;
	if(rightup(P(ma,mb),la)&&rightup(la,P(Ma,Mb))
		&&rightup(P(ma,mb),lb)&&rightup(lb,P(Ma,Mb))) return true;
	return false;
}

int main(){
	int N;
	P a, b;
	int mx[50], my[50], Mx[50], My[50], h[50];
	while(cin >> N, N){
		int sx, sy, ex, ey; cin >> sx >> sy >> ex >> ey;
		a = P(sx,sy); b = P(ex,ey);
		for(int i=0;i<N;i++)
			cin >> mx[i] >> my[i] >> Mx[i] >> My[i] >> h[i];
		bool flag = false;
		for(int i=0;i<N;i++){
			if(crossSquare(a, b, mx[i], my[i], Mx[i], My[i])){
				flag = true;
				break;
			}
		}
		if(flag) { cout << 0 << endl; continue; }
		double r = 10000;
		for(int i=0;i<N;i++){
			double d = distSquare(a,b,mx[i],my[i],Mx[i],My[i]);
			if(d<h[i]) { if(d<r) r = d; }
			else    {
				double tmp = (d*d+h[i]*h[i])/(2*h[i]);
				if(tmp<r) r = tmp;
			}
		}
		printf("%.8lf\n", r);
	}
}

Measured memory_bytes: 0
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int m = scan.nextInt();
    int k = scan.nextInt();
    int sum = 0;
    for (int i=n;i<=m;i++){
      if (i%k == 0){
        sum += 1;
      }
    }
    System.out.println(sum);
  }
}


Measured memory_bytes: 35768
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt() * 2;
        int[] l = IntStream.rangeClosed(1, k).toArray();
        int m = sc.nextInt();
        while (m-- > 0) {
            int n = sc.nextInt();
            int[] t = new int[k];
            if (n == 0) {
                for (int i = 0; i < k; i++) {
                    t[i] = l[(i % 2 == 0 ? i : k + i) / 2];
                }
            } else {
                for (int i = 0; i < k; i++) {
                    t[i] = l[(i + n) % k];
                }
            }
            l = t;
        }
        for (int i : l) {
            System.out.println(i);
        }
    }
}



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

typedef double du ;
typedef string st ;
typedef long long ll ;
typedef long double ld ;
typedef long long int lli ;

#define vi vector <lli>
#define loop(num) for (lli i = 0 ; i < num ; i ++ )
#define loopcin(num , ar ) for (lli i = 0 ; i < num ; i ++ ) {cin >> ar [i] ;}
#define loopcout(num , ar) for (lli i = 0 ; i < num ; i ++ ) {cout << ar [i] << ' '; }

#define forr(num1 , num2) for (lli i = num1 ; i < num2 ; i ++ )
#define forrcin(num1 , num2 , ar ) for (lli i = num1 ; i < num2 ; i ++ ) {cin >> ar [i] ;}
#define forrcout(num1 , num2 , ar) for (lli i = num1 ; i < num2 ; i ++ ) {cout << ar [i] << ' '; }

#define D2forrcin(num1_1 , num1_2 , num2_1 , num2_2 , A ) for (lli i = num1_1 ; i < num1_2 ; i ++){ for (lli j = num2_1 ; j < num2_2 ; j++){cin >> A[i][j] ;}}
#define D2forrcout(num1_1 , num1_2 , num2_1 , num2_2 , A ) for (lli i = num1_1 ; i < num1_2 ; i ++){ for (lli j = num2_1 ; j < num2_2 ; j++){cout << A[i][j] << ' ' ;}cout << endl ;}

#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl

#define F first
#define S second

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main ()
{
    fastio
    lli num ;
    cin >> num ;
    cout << num * 800 - num / 15 * 200 ;

    return 0 ;
}

/*___________________________________________________________________functions___________________________________________________________________________*/

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;

int main() {        
    string s;
    cin >> s;
    if (s[0] == s[1] && s[1] == s[2]) {
        cout << "Yes" << endl;
        return 0;
    }
    if (s[1] == s[2] && s[2] == s[3]) {
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;
}


Measured memory_bytes: 3636
import sys

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

A, B, C = rs().split()
bool = A[-1] == B[0] and B[-1] == C[0]
print('YES' if bool else 'NO')

Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#define pii pair<ll, ll>
#define ll long long
#define inf 100000000000000

using namespace std;

ll dp[100010];
pii niz[110];
int main()
{
	int sumVal = 0;
	int n, weight;
	cin >> n >> weight;
	for (int i = 1; i <= n; i++)
	{
		cin >> niz[i].first >> niz[i].second;
		sumVal += niz[i].second;
	}
	for (int j = 1; j <= sumVal; j++)
		dp[j] = inf;
	ll maxHappines = 0;
	for (int i = 1; i <= n; i++)
		for (int j = sumVal; j >= niz[i].second; j--)
			dp[j] = min(dp[j], dp[j - niz[i].second] + niz[i].first);
	for (int i = 0; i <= sumVal; i++)
		if (dp[i] <= weight)
			maxHappines = max(maxHappines, (ll)i);
	cout << maxHappines << endl;
}

Measured memory_bytes: 1024
#include <stdio.h>

typedef enum
{
	true = 1,
	false = 0
} bool;

void swap(int *xp, int *yp)
{
    int temp = *xp;
    *xp = *yp;
    *yp = temp;
}

void sort(int arr[], int n)
{
   int i, j;
   for (i = 0; i < n-1; i++)  
       for (j = 0; j < n-i-1; j++) 
           if (arr[j] > arr[j+1])
              swap(&arr[j], &arr[j+1]);
}

int main()
{
	int a[3];
	for (int i = 0; i < 3; i++) scanf("%d", a+i);
	//for (int i = 0; i < 3; i++) printf("%d ", a[i]);
	sort(a, 3);
	//for (int i = 0; i < 3; i++) printf("%d ", a[i]);
	printf("%d\n", a[2]-a[1] + a[1]-a[0]);
	
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;

int main(){
  int n,m,a,b,s,t;
  cin >> n >> m;
  vector<vector<int>> edge(n,vector<int>());
  for(int i=0;i<m;i++){
    cin >> a >> b;
    a--; b--;
    edge[a].push_back(b);
  }
  cin >> s >> t;
  s--; t--;
  queue<P> q;
  q.push(P(s,0));
  int ans[n][3],flag[n][3]={};
  for(int i=0;i<n;i++) for(int j=0;j<3;j++) ans[i][j]=-3;
  ans[s][0]=0,flag[s][0]=1;
  while(!q.empty()){
    P p=q.front();
    q.pop();
    for(auto i:edge[p.first]){
      int now=(p.second+1)%3;
      if(!flag[i][now]){
        q.push(P(i,now));
        ans[i][now]=ans[p.first][p.second]+1;
        flag[i][now]=1;
      }
    }
  }
  cout << ans[t][0]/3 << endl;
}

Measured memory_bytes: 8064
using System;

namespace C_sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            var nml = Console.ReadLine().Split(' ');
            var n = int.Parse(nml[0]);
            var m = int.Parse(nml[1]);
            var l = int.Parse(nml[2]);

            var A = new int[n, m];
            for (var i = 0; i < n; i++)
            {
                var items = Console.ReadLine().Split();
                for (var j = 0; j < m; j++)
                {
                    A[i, j] = int.Parse(items[j]);
                }
            }

            var B = new int[m, l];
            for (var i = 0; i < m; i++)
            {
                var items = Console.ReadLine().Split();
                for (var j = 0; j < l; j++)
                {
                    B[i, j] = int.Parse(items[j]);
                }
            }

            var C_i = new long[l];
            for (var i = 0; i < n; i++)
            {
                for (var j = 0; j < l; j++)
                {
                    long c_ij = 0;
                    for (var k = 0; k < m; k++)
                    {
                        c_ij += A[i, k] * B[k, j];
                    }
                    C_i[j] = c_ij;
                }
                Console.WriteLine(String.Join(" ", C_i));
            }
        }
    }
}



Measured memory_bytes: 20116
using System;
using System.Numerics;
using System.Linq;
using System.Collections.Generic;
class ProgramB
    {
        static void Main(string[] args)
        {
            
            //入力
            string[] input = Console.ReadLine().Split(' ');
            int n = int.Parse(input[0]);
            int r = int.Parse(input[1]);
            
          if(n < 10)
            Console.WriteLine(r + (10 -n)*100);
          else
            Console.WriteLine(r);
            

            
    
        }
    }

Measured memory_bytes: 11092
#include <cstdio>
#include <utility>

int straight[100][100];
int right[100][100];
int down[100][100];
int right_dash[100][100];
int down_dash[100][100];

int main() {
    while (1) {
        int i;
        int w, h;
        scanf("%d %d", &w, &h);
        if (w == 0 && h == 0) return 0;
        for (i=0;i<h;i++) {
            int j;
            for (j=0;j<w;j++) {
               down[i][j] = 0;
               right[i][j] = 0;
               down_dash[i][j] = 0;
               right_dash[i][j] = 0;
            }
        }

        for (i=0;i<w;i++) {
            down_dash[0][i] = 1;
            right_dash[0][i] = 1;
        }

        for (i=0;i<h;i++) {
            right_dash[i][0] = 1;
            down_dash[i][0] = 1;
        }
    
        for (i=1;i<h;i++) {
            int j;
            for (j=1;j<w;j++) {
                down[i][j] += right_dash[i-1][j];
                down[i][j] %= 100000;
                right[i][j] += down_dash[i][j-1];
                right[i][j] %= 100000;
                down_dash[i][j] = down[i-1][j] + (i==1 ? 0 : down_dash[i-1][j]);
                down_dash[i][j] %= 100000;
                right_dash[i][j] = right[i][j-1] + (j==1 ? 0 : right_dash[i][j-1]);
                right_dash[i][j] %= 100000;
            }
        }

        printf("%d\n", (right[h-1][w-1] + right_dash[h-1][w-1] + down[h-1][w-1] + down_dash[h-1][w-1]) % 100000);
    }
}

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


int main(){
	int n;
	int x[100100];
	int y[100100];
	int t[100100];
	x[0]=0;y[0]=0;t[0]=0;
	cin>>n;
	for(int i=1; i<n+1;i++){
		cin >> t[i]>>x[i]>>y[i];
	}
	
	for(int i=1;i<n+1;i++){
		int distance=abs(x[i]-x[i-1])+abs(y[i]-y[i-1]);
		int time=t[i]-t[i-1];
		int po= time-distance;

		if(po>=0 && po%2==0){ continue;}
		else{
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
	return 0;
}



Measured memory_bytes: 1408
#include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
 
#define endl '\n'
#define loop(i, m, n) for (ll i = m; i < n; i++)
#define loope(i, m, n) for (ll i = m; i <= n; i++)
#define epool(i, m, n) for (ll i = m; i >= n; i--)
#define mod 1000000007
#define mod2 998244353
#define vi vector<ll>
#define fi first
#define se second
#define pb push_back
#define MP make_pair
#define empf emplace_front
#define empb emplace_back
#define ret(x) return cout << x,0;
#define all(v) v.begin(),v.end()

#define naman                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
using namespace std;

ll mpow(ll base, ll exp){
    base %= mod;
    ll result = 1;
    while (exp > 0){
        if (exp & 1)
            result = ((ll)result * base) % mod;
        base = ((ll)base * base) % mod;
        exp >>= 1;
    }
    return result;
}

const ll INF=1e18;
const double PI=4*atan(1);


void solve(){
    char c;
    cin >> c;
    cout << char(c+1) << endl;

}

int32_t main(){
    naman
    ll i = 0,j = 0;

// #ifndef ONLINE_JUDGE
//     freopen("input.txt","r",stdin);
//     freopen("output.txt","w",stdout);
// #endif

    //cout << fixed << setprecision(10);

    int t;
    t=1;
    //cin >> t;
    while (t--){
        solve();

    }

}

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

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

const int MAX = 2e5 + 10;

VI G[MAX];
int ans[MAX];
void calc_dist() {
    fill(ans, ans + MAX, -1);
    queue<int> que;
    que.emplace(0);
    while (!que.empty()) {
        const auto el = que.front();
        que.pop();
        FORE(e, G[el]) if (ans[e] == -1) {
            ans[e] = el;
            que.emplace(e);
        }
    }
}

int main(void) {
    int N, M;
    cin >> N >> M;
    REP(i, M) {
        int a, b;
        scanf("%d%d", &a, &b);
        a--; b--;
        G[a].EB(b);
        G[b].EB(a);
    }
    calc_dist();

    REP(i, N - 1) if (ans[i + 1] == -1) {
        puts("No");
        return 0;
    }
    puts("Yes");
    REP(i, N - 1) {
        printf("%d\n", ans[i + 1] + 1);
    }
}


Measured memory_bytes: 13384
n=gets.chomp.to_i
max_root=Math.sqrt(n).to_i
prime=Array.new
m=n
i=2
while i <= max_root
	if n%i==0
		prime << i
		n=n/i
	elsif i==2
		i+=1
	else
		i+=2
	end
end
if m==n || n!=1
	prime << n
end

print "#{m}: #{prime.join(" ")}\n"

Measured memory_bytes: 8616