akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int a;
  cin >> a;
  
  if (a / 1000 == a % 1000 / 100 && a % 1000 / 100 == a % 100 / 10)
    cout << "Yes" << endl;
  else if (a % 1000 / 100 == a % 100 / 10 && a % 100 / 10 == a % 10)
    cout << "Yes" << endl;
  else 
    cout << "No" << endl;
  
  
}

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

#define ll long long int

int main()
{
    int a, b, c, x;
    int cnt = 0;
    cin >> a >> b >> c >> x;
    for (int i = 0; i <= a; i++)
    {
        for (int j = 0; j <= b; j++)
        {
            for (int k = 0; k <= c; k++)
            {
                if (500 * i + 100 * j + 50 * k == x)
                    cnt++;
            }
        }
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
from collections import Counter

def main():
    N = int(input())
    A = list(map(int, input().split()))
    counter = Counter(A)
    combs = {i: n*(n-1)//2 for i, n in counter.items()}
    total = sum(combs.values())

    dp = [None] * (N+1)
    for i in A:
        if dp[i] is None:
            tmp = total - combs[i]
            new = counter[i] - 1
            dp[i] = tmp + (new * (new-1) // 2)
            yield str(dp[i])
        else:
            yield str(dp[i])


print("\n".join(main()))

Measured memory_bytes: 41804
#include <stdio.h>
#include <string.h>

int main(void)
{
	int i;
	int n;
	
	scanf("%d", &n);
	for (i = 0; i < n; i++){
		int out = 0;
		int hit = 0;
		int point = 0;
		while (1){
			char str[16];
			scanf("%s", str);
			
			if (strcmp(str, "HIT") == 0){
				hit++;
				if (hit > 3){
					hit--;
					point++;
				}
			}
			if (strcmp(str, "HOMERUN") == 0){
				point += hit + 1;
				hit = 0;
			}
			if (strcmp(str, "OUT") == 0){
				out++;
			}
			if (out >= 3) break;
		}
		printf("%d\n", point);
	}
	return (0);
}

Measured memory_bytes: 1024
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
b = [1]*(n + 1)

for i in a:
    b[i] = 0

for i in range(2, n + 1):
    if b[i] != 0:
        b[i] = (b[i - 2] + b[i - 1])%(10**9 + 7)

print(b[-1])

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

public class Hello
{
    public static void Main()
    {
        var s = Console.ReadLine().Trim();
        var n = s.Length - 1;
        var nL = (int)Math.Pow(2, n);
        var ret = 0L;
        for (int i = 0; i < nL; i++)
        {
            var tlist = new List<int>();
            for (int j = 0; j < n; j++)
                if (((i >> j) & 1) == 1) tlist.Add(j);
            var www = getSum(s, tlist);
            ret += getSum(s, tlist);
        }
        Console.WriteLine(ret);
    }
    public static long getSum(string s, List<int> c)
    {
        if (c.Count() == 0) return long.Parse(s);
        var ret = 0L;
        var p = 0;
        var pre = c[0];
        ret += long.Parse(s.Substring(0, pre + 1));
        p += pre + 1;
        for (int i = 1; i < c.Count(); i++)
        {
            var t = c[i];
            var w = s.Substring(p, t - pre);
            ret += int.Parse(w);
            p += t - pre;
            pre = t;
        }
        ret += int.Parse(s.Substring(p));
        return ret;
    }
}


Measured memory_bytes: 11220
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mp make_pair
#define mm(a) memset(a,-1,sizeof(a))
#define rep(i,a,b) for(ll i = a; i < b; i++)
#define repn(i,a,b) for(ll i = a; i >= b; i--)
#define pb push_back
#define ff first
#define ss second
#define fto(k,m) for(auto k:m)
#define debug(this) cerr<<"> "<<#this<<" : "<<this<<"\n"
#define sz(a) ll((a).size())
#define pii 3.1415926535897
#define endl "\n"
#define ld long double
#define mod 1000000007
#define BRAHAMASTRA ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main()
{
    BRAHAMASTRA
    ll t; t=1;
    // cin >>t;
    while(t--)
    {
        ll n; cin >>n;
        string s; cin >>s;
        ll cnt = 0;
        ll l = 0,r=n-1;
        while(l<r)
        {
            if(s[l]=='W' && s[r]=='R')swap(s[l],s[r]),l++,r--,cnt++;
            if(s[l]=='W' and s[r]=='W')r--;
            if(s[l]=='R' and s[r]=='R')l++;
            if(s[l]=='R' and s[r]=='W')l++,r--;
        }
        // cout<<s<<endl;
        cout<<cnt<<endl;
    }
}

Measured memory_bytes: 3732
#include <bits/stdc++.h>
using namespace std;
#define opt ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long int
#define ull unsigned long long int
#define I int
#define S string
#define D long double
#define rep(i,a,b) for(i=a;i<b;i++)
#define repr(i,a,b) for(i=a;i>b;i--)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
// I might be a loser, but I have nothing to lose :p
// g++ -std=gnu++14 A.cpp
int main()
{
opt;
I n,t,b,i,x,y;
cin>>n>>t;
b=INT_MAX;
rep(i,0,n)
{
    cin>>x>>y;
    if(y<=t)
        b=min(b,x);
}
if(b==INT_MAX)
    cout<<"TLE";
else
    cout<<b;
return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)
#define foreach(c,itr) for(__typeof(c)::iterator itr=c.begin();itr!=c.end();itr++)
typedef long long ll;
int i,j;

int main(){
	ios::sync_with_stdio(false);
    cin.tie();
    
    string s;
    cin>>s;
    ll mod=0;
    for(i=0;i<s.size();i++){
    	mod+=s[i]-'0';
    	mod%=9;
	}
	if(mod%9==0) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 3776
#include <iostream>
#include <vector>
#include <set>
#include <utility>
#include <string>
#include <algorithm>
#include <cmath>

typedef long long ll;
using namespace std;


int main()
{
    int a, b, c;
    cin >> a >> b >> c;

    if ((b - a) == (c - b))
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long long X, D, N, r, cnt; 
long long A[200010], L[200010], R[200010], res[200010]; 
map<long long, bool> seen; 
map<long long, vector<pair<long long, long long>>> M; 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0); 
	cin >> N >> X >> D; 
	if(D == 0 && X == 0){
		cout << 1 << endl; return 0; 
	}
	else if(D == 0){
		cout << N + 1 << endl; return 0; 
	}
	if(D < 0){
		X *= -1; D *= -1; 
	}
	r = (X + D * 100000000) % D; 
	for(int i = 1; i <= N; i++) A[i] = X + D * (i-1); 
	for(int i = 1; i <= N; i++) L[i] = L[i-1] + A[i]; 
	for(int i = 1; i <= N; i++) R[i] = R[i-1] + A[N+1-i]; 
	for(int i = 0; i <= N; i++){
		res[i] = (r * i) % D; 
		M[res[i]].push_back(make_pair(L[i], R[i])); 
	}
	for(int i = 0; i <= N; i++){
		if(seen[res[i]]) continue; 
		sort(M[res[i]].begin(), M[res[i]].end()); 
		seen[res[i]] = true; 
		long long right = -1e18; 
		for(auto p : M[res[i]]){
			long long x = p.first, y = p.second; 
			if(right < x){
				cnt += (y - x) / D + 1; right = y; 
			}
			else if(right <= y){
				cnt += (y - right) / D; right = y; 
			} 
		}
	}
	cout << cnt << endl;
}

Measured memory_bytes: 40832
a,b,c = map(int, input().split())
k = int(input())
key = 0

for i in range(0,k+1):
    if i == 0:
        cc = c
    else:
        cc = c*(2**i)
    
    if k-i == 0:
        bb = b
    else:
        bb = b*(2**(k-i))
    
    if cc > bb and bb > a:
        key = 1
        break

if key == 1:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 8732
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int N,M,a,b,ans;
bool g[8][8];

int main(){
    cin>>N>>M;
    vector<int> v;
    rep(i,N-1){
        v.push_back(i+1);
    }
    rep(i,8){
        rep(j,8){
            g[i][j]=0;
        }
    }
    rep(i,M){
        cin>>a>>b;
        a--;
        b--;
        g[a][b]=1;
        g[b][a]=1;
    }
    do{
        rep(i,N-1){
            if(!i){
                if(!g[0][v[0]])break;
            }
            else{
                if(!g[v[i-1]][v[i]])break;
            }
            if(i==N-2){
                ans++;
            }
        }

    }while(next_permutation(v.begin(),v.end()));
    out(ans);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef double ld;
#define pll pair<ll,ll>
#define pii pair<int, int>
#define pb push_back
#define mp(x, y) make_pair((x), (y))
#define F first
#define S second
#define I insert
#define vi vector<int>
#define vll vector<ll>
#define vpll vector<pll>
#define vpii vector<pii>
#define all(x) (x).begin(), (x).end()
#define sz(x) (ll)(x).size()

const ll Mod = 998244353;

bool check(string s){
    for(int i=0;i<s.size();i++){
        if(s[i]!=s[s.size()-i-1]){
            return false;
        }
    }
    return true;
}

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

    string s; cin>>s;
    int n = (s.size()-1)/2;
    string t="";
    for(int i=0;i<n;i++){
        t=t+s[i];
    }
    if(!check(t)){
        cout<<"No\n";
    }
    else{
        t="";
        for(int i=n+1;i<s.size();i++){
            t=t+s[i];
        }
        if(!check(t))
            cout<<"No\n";
        else{
            if(!check(s))
                cout<<"No\n";
            else
                cout<<"Yes\n";
        }
    }
    
    return 0;
}

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

using namespace std;
typedef long long ll;
typedef pair<int,ll> pil;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
const int maxN = 5e2 + 5;
const ll INF = 1ll<<60;

int main()
{
	double a,b;
	scanf("%lf%lf",&a,&b);
	double c = a/b;
	printf("%f\n",c);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

void solve() {
    string s;
    cin >> s;
    int len = s.size();
    int ans = 0;
    VI a(len);
    REP(i,0,len) a[i] = s[i] - '0';
    RREP(i,0,len) {
        if (a[i] > 9) {
            if (i == 0) ans += a[i] / 10;
            else a[i-1] += a[i] / 10;
            a[i] %= 10;
        }
        if (a[i] < 5) ans += a[i];
        else if (a[i] > 5) {
            ans += 10 - a[i];
            if (i == 0) ++ans;
            else a[i-1]++;
        } else {
            if (i == 0 || a[i-1] < 5) {
                ans += 5;
            } else {
                ans += 5;
                a[i-1]++;
            }
        }
    }
    cout << ans << endl;
}

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

Measured memory_bytes: 5252
from itertools import permutations
N = int(input())
pos = [[int(i) for i in input().split()] for j in range(N)]
total = 0
l = 0
for p in permutations([i for i in range(N)], N):
    l += 1
    for j in range(len(p)-1):
        x1,y1 = pos[p[j]]
        x2,y2 = pos[p[j+1]]
        total += ((x1 - x2)**2 + (y1 - y2)**2)**0.5
print(total / l)

Measured memory_bytes: 9316
#!/usr/bin/env python3
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

S = input()

if "RRR" in S:
    print(3)
elif "RR" in S:
    print(2)
elif "R" in S:
    print(1)
else:
    print(0)

Measured memory_bytes: 9052
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author champon
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 1e18
#define ceill(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
ll mod = 1e9+7;
void ans(bool b, ostream& out=cout){ out << (b ? "Yes" : "No") << endl; }
void ans2(bool b, ostream& out=cout){ out << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){fill((T*)array, (T*)(array+N), val);}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

class debug
{
public:
    template<typename T> void vdeb(T vec);
    template<typename T1, typename T2> void adeb(T1 *arr, T2 n);
    template<typename T> void mdeb(T mp);
};

#endif //INCLUDE_DEBUG_HPP

template<typename T> void debug::vdeb(T vec)
{
    cout << "#vector set debug" << endl;
    for(auto vv : vec) cout << vv << " ";
    cout << endl;
}

template<typename T1, typename T2> void debug::adeb(T1 *arr, T2 n)
{
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}

template<typename T> void debug::mdeb(T mp)
{
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
debug dbg;

class AEatingSymbolsEasy {
public:
	void solve(std::istream& in, std::ostream& out)
	{
	    string s;
	    in >> s;
	    int n = 0;
	    for(int i=0; i<s.length(); i++){
	        if(s[i] == '+') n++;
	        else n--;
	    }

	    out << n << endl;
	}
};


int main() {
	AEatingSymbolsEasy solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
import sys
import heapq
from operator import itemgetter
from collections import deque, defaultdict, Counter
from bisect import bisect_left, bisect_right
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10**9 + 7

def sol():
    N = int(input())
    S = input().rstrip()

    isLeft = [(i % 2 == 0) ^ (s == 'W') for i, s in enumerate(S)]

    ans = 1
    left = 0
    for black in isLeft:
        if black:
            left += 1
        else:
            ans = (ans * left) % MOD
            left -= 1

    if left != 0:
        ans = 0

    for i in range(1, N + 1):
        ans = (ans * i) % MOD

    print(ans)

sol()

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

template <typename Arg1>
void pn(Arg1&& arg1)
{ cout<<arg1<<"\n";}
template <typename Arg1, typename... Args>
void pn(Arg1&& arg1, Args&&... args)
{ cout<<arg1<<"\n"; pn(args...); }

template <typename Arg1>
void ps(Arg1&& arg1)
{ cout<<arg1<<" ";}
template <typename Arg1, typename... Args>
void ps(Arg1&& arg1, Args&&... args)
{ cout<<arg1<<" "; ps(args...); }

template <typename Arg1>
void pvs(Arg1&& arg1, ll n)
{ for(ll i=0;i<n;i++)ps(arg1[i]); }
template <typename Arg1>
void pvn(Arg1&& arg1, ll n)
{ for(ll i=0;i<n;i++)pn(arg1[i]); }

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

ll mulmod(ll a,ll b,ll mod) 
{ ll res=0; a=a%mod; 
    while(b>0)
    { if(b%2==1) res=(res+a)%mod; 
      a=(a*2)%mod; b/=2; }
    return res % mod; } 

ll mulpow(ll x,ll y,ll p) 
{ ll res=1; x=x%p;
    while(y>0) 
    { if (y&1) res=(res*x)%p; 
      y=y>>1; x=(x*x)%p; } 
    return res; } 

ll modInverse(ll n, ll p) 
{ return mulpow(n, p-2, p); } 

ll log(ll n, ll b)
{ ll c=0;
	while(n>(b-1))
	{ c++; n/=b; } return c; }

ll fib(ll n) 
{ double phi=(1+sqrt(5))/2; 
  return round(pow(phi,n)/sqrt(5)); } 

vector<bool> prime;
void sieve(int n)
{ prime.resize(n,true);
	for(int p=2;p*p<=n;p++)
		if(prime[p])
			for(int i=p*p;i<=n;i+=p)
				prime[i]=false; }

#define MOD 1000000007 //10^9+7
#define pi 3.14159265358979323846
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<=n;i++)
#define fd(i,n) for(i=n-1;i>=0;i--)
#define fn(i,s,d) for(i=s;i<d;i++)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) a.size()
#define vl vector<ll>
#define vb vector<bool>
#define vd vector<double>
#define vvl vector<vl>
#define vs vector<string>
#define vvs vector<vs>
#define pl pair<ll,ll>
#define pd pair<double,double>
#define vpl vector<pl>
#define vpd vector<pd>
#define vvpl vector<vpl>
#define ff first
#define ss second
#define um unordered_map
#define dsort(v) sort(v); reverse(v);


void solve()
{
	ll i,j;
	cin>>i;
	j=(i+999)/1000;
	j*=1000;
	pn(j-i);
}

int main()
{
	#ifdef Deeksha
		freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    #endif
	std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	solve();/* 
	ll t;
	cin>>t;
	for(ll tt=1;tt<=t;tt++)
	{
		//cout<<"Case #"<<tt<<": ";
		solve();
	}
	//*/
}



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

using namespace std;
typedef long long ll;
typedef pair<long long,long long> P;
#define rep(n) for(ll i=0; i<n; i++)
#define MAX_V 100001
const ll INF = 1e+9;
const ll MOD = 1000000007;

vector<ll> v;

void init()
{
  for (ll i = 0; i < 41; i++)
  {
    v.push_back(i*(i+1)/2);
  }
}

P exponent(ll n, ll p)
{
  if(n%p==0)
  {
    P next = exponent(n/p, p);
    return make_pair(next.first, ++next.second);
  } else {
    return make_pair(n, 0);
  }
}


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

  init();
  /*
  for(auto p:v){
    cout << p << " ";
  }
  cout << endl;
  */
  
  if(n==1){
    cout << 0 << endl;
    return 0;
  }


  ll cur = 1;
  ll ans = 0;
  while(n>1)
  {
    cur++;
    if(n%cur!=0) {
      if(cur*cur>n) 
      {
        ans++;
        break;
      }
      continue;
    }
    P tmp = exponent(n, cur);
    n = tmp.first;
    auto itr = upper_bound(v.begin(), v.end(), tmp.second);
    /*
    cout << n << " ";
    cout << cur << " ";
    cout << tmp.second << " " << itr-v.begin()-1 << endl;
    */
    ans += itr-v.begin()-1;
  }

  cout << ans << endl;
  

  return 0;
}

Measured memory_bytes: 3644
#include <string>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string.h>
#include <utility>
#include <queue>
#include <stack>
#include <iomanip>
#include <ctype.h>
#include <map>
#include <set>
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <sstream>
#include <math.h>
#include <time.h>
#include <iostream>
#include <iomanip>
#include <unordered_set>
#include <unordered_map>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <tuple>
#include <cmath>
#include <stdio.h>      /* printf, fgets */
#include <stdlib.h>
#include <fstream>

using namespace std;

typedef long long LL;

#define FOR(i,n) for(int i = 0;i < n;i++)
#define MP make_pair
#define PB push_back
#define ALL(a) (a).begin(),(a).end()
#define PII pair<int, int>
#define PLL pair<long long, long long>
#define CLEAR(a) memset(a, 0, sizeof(a))
#define INF 2000000007LL
#define y1 uu1
#define y2 uu2
const double EPS = 1E-12;
const double PI = acos(-1.0);
const LL mod = 1000000007;

using namespace std;

int n;
long double x[8], y[8];

int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(0);
  cin >> n;
  FOR(i, n) {
    cin >> x[i] >> y[i];
  }
  long double res = 0;
  FOR(i, n) {
    for (int j = i+1; j < n; j++) {
      res += sqrt((x[i]-x[j])*(x[i]-x[j]) + (y[i]-y[j])*(y[i]-y[j]));
    }
  }

  res *= 2;
  res /= n;

  cout << fixed << setprecision(9) << res << endl;

  return 0;
}


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


def main():
    N, L = map(int, input().split())
    if L >= 1:
        # L + 1 から L + N - 1 の和
        print((N - 1) * (2 * L + N) // 2)
    elif L <= - N + 1:
        # L から L + N - 2 の和
        print((N - 1) * (2 * L + N - 2) // 2)
    else:
        # L から L + N - 1 の和
        print(N * (2 * L + N - 1) // 2)


if __name__ == '__main__':
    main()


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

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

int main() {
	int N, L; cin >> N >> L;
	vector<string> S(N);
	for(int i = 0; i < N; i++) cin >> S[i];
	sort(S.begin(), S.end());
	string ans;
	for(int i = 0; i < N; i++) ans += S[i];
	cout << ans << endl;
	return 0;
}

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

using ll = long long;

int main() {
    int N;
    cin >> N;
    vector<ll> v;
    priority_queue<ll> lque;
    priority_queue<ll, vector<ll>, greater<ll> > gque;

    ll smf = 0, smb = 0;
    for(int i = 0; i < 3*N; i++) {
        ll x;
        cin >> x;
        if(i < N) {gque.push(x); smf += x; }
        else if(i < 2*N) {v.push_back(x); }
        else {lque.push(x); smb += x; }
    }

    vector<ll> smfv, smbv;
    smfv.push_back(smf);
    smbv.push_back(smb);
    for(int i = 0; i < N; i++){
        gque.push(v[i]);
        ll n = gque.top(); gque.pop();

        smf = smf - n + v[i];
        smfv.push_back(smf);
        
        lque.push(v[N-1-i]);
        n = lque.top(); lque.pop();
        smb = smb - n + v[N-1-i];
        smbv.push_back(smb); 
    }

    ll ans = -1e18-1;
    for(int i = 0; i < N+1; i++) {
        ans = max(ans, smfv[i] - smbv[N-i]);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 4980
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
const int maxn = 1<<18;
int n, t;
int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin >> n >> t;
	vector<int> a(n);
	for(auto &i : a) cin >> i;
	int q = 0, r;
	for(int m = 1<<30, i = 0; i < n; i++) {
		m = min(m, a[i]);
		q = max(q, a[i] - m);
	}
	for(int m = 1<<30, i = 0; i < n; i++) {
		m = min(m, a[i]);
		r += q == (a[i] - m);
	}
	cout << r;
}


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


int main(){
	long long input,answer;
	int amari;
	cin >> input;
	answer=input/11*2;
	amari = input%11;
	
	if (amari == 0){
	}else if (amari > 6){
		answer+=2;
	}else{
		answer+=1;
	}
	cout << answer << endl;
	return 0;
}


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

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,n,0)
#define pb push_back

using namespace std;

using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,int>;

const int mod=1e9+7,INF=1<<30;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll lmod = 1e9+7,LINF=1LL<<60;
const int MAX_N = 2003;

vector<int> graph[MAX_N];
bool passed[MAX_N];

int main(){
  int N,K; cin >> N >> K;
  rep(i,N-1){
    int a,b;
    scanf("%d%d",&a,&b);
    a--; b--;
    graph[a].pb(b); graph[b].pb(a);
  }
  if(K==1){
    cout << N-2 << endl;
    return 0;
  }else if(K%2==0){
    int ans = INF;
    rep(i,N){
      // i からの距離が全てK/2以下
      queue<P> que;
      fill(passed,passed+N,false);
      que.push(P(i,0));
      int rest = 0;
      while(!que.empty()){
        int u,d;
        tie(u,d) = que.front(); que.pop();
        if(d>K/2) continue;
        passed[u] = true;
        rest++;
        for(auto v:graph[u]) if(!passed[v]) que.push(P(v,d+1));
      }
      ans = min(ans,N-rest);
    }
    cout << ans << endl;
  }else{
    int ans = INF;
    rep(i,N) for(auto j:graph[i]){
      // 辺 i - j からの距離が全て(K-1)/2以下
      queue<P> que;
      fill(passed,passed+N,false);
      que.push(P(i,0)); que.push(P(j,0));
      int rest = 0;
      while(!que.empty()){
        int u,d;
        tie(u,d) = que.front(); que.pop();
        if(d>(K-1)/2) continue;
        passed[u] = true;
        rest++;
        for(auto v:graph[u]) if(!passed[v]&&v!=i&&v!=j) que.push(P(v,d+1));
      }
      ans = min(ans,N-rest);
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 384
#include <iostream>
using namespace std;
 
int main(){
    int n,a,b,c;
    cin>>n;
    while(cin>>a>>b>>c){
        if(a*a==b*b+c*c || b*b==a*a+c*c || c*c==a*a+b*b){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
 
    return 0;
}


Measured memory_bytes: 3052
#include <bits/stdc++.h>
using namespace std;
#define ll long long
string s,s2;
int main() {
    cin>>s>>s2;
    ll n=s.size(),m=s2.size();
    ll dp[n + 1][m + 1] = {0};
    for (ll i = 0; i <= n; i++) {
        for (ll j = 0; j <= m; j++) {
            dp[i][j] = 0;
        }
    }
    pair<ll,ll>dad[n+1][m+1];
    for (ll i = 0; i < n; i++) {
        for (ll j = 0; j < m; j++) {
            if (s[i] == s2[j]) {
                dad[i + 1][j + 1] = {i, j};
                dp[i + 1][j + 1] = dp[i][j] + 1;
            } else if (dp[i][j + 1] > dp[i + 1][j]) {
                dp[i + 1][j + 1] = dp[i][j + 1];
                dad[i + 1][j + 1] = {i, j + 1};
            } else {
                dp[i + 1][j + 1] = dp[i + 1][j];
                dad[i + 1][j + 1] = {i + 1, j};
            }
        }
    }
    ll n1 = s.size(), n2 = s2.size();
    vector<ll> v;
    while (n1 != 0 or n2 != 0) {
        if (n1 * n2 > 0 and s[n1 - 1] == s2[n2 - 1]) v.push_back(n1 - 1);
        ll temp = n1;
        n1 = dad[n1][n2].first;
        n2 = dad[temp][n2].second;
    }
    if (v.size() == 0) cout << "";
    else {
        for (ll i = v.size() - 1; i >= 0; i--) cout << s[v[i]];
        cout << "\n";
    }
}

Measured memory_bytes: 211456
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
 
#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
 
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
 
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
 
#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
 
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
 
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
 
    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };
 
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };
 
    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
      h: usize,
      w: usize,
      boards: [chars; h],  
    }

    let d = 1000000000 + 7;
    let mut dp = vec![vec![0; w+1]; h+1];

    let mut left;
    let mut top;

    for i in 0..h {
        for j in 0..w {
            if j > 0 {
                left = if boards[i][j-1] == '.' { dp[i][j-1] } else { 0 };
            } else {
                left = 0;
            }
            if i > 0 {
                top = if boards[i-1][j] == '.' { dp[i-1][j] } else { 0 };
            } else {
                top = 0;
            }
            if i == 0 && j == 0 {
                dp[i][j] = 1;
            } else {
                dp[i][j] = (top + left) % d;
            }
            
        } 
    }
    //println!("{}", dp[0][1]);
    println!("{}", dp[h-1][w-1]);


}

Measured memory_bytes: 12540
#include<bits/stdc++.h>
/************************************************/
#define rep(i,n) for(int i=0;i<n;i++)
#define mp make_pair
#define pb push_back
#define fr first
#define se second
#define forn(i,a,n) for(int i=a;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define pii pair<int,int>
#define vi vector<int>
#define ll long long
#define sz(s) s.size()
#define all(s) s.begin(),s.end()
#define zero(x) memset(x,0,sizeof(x))
#define vii vector<pair<int,int> >
#define mpis map<int,string>
#define mpii map<int,int>
#define mpsi map<string,int>
#define re return
/************************************************/
using namespace std;
string s;
int n;
long long get(){
	char c=getchar();
	long long x=0LL;
	while(c<'0'||c>'9')
	c=getchar();
	while(c>='0'&&c<='9'){
		x*=10LL;
		x+=(c-'0');
		c=getchar();
	}
	return x;
}
int main(){
	cin>>n; 
	cin>>s;
	for(int i=0;i<s.size();i++){
		s[i]=(s[i]-'A'+n)%26+'A';
	}
	cout<<s;
	re 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<limits.h>
#include<stdio.h>
#include<cstring>
#include<string>
using namespace  std;
typedef long long ll;
typedef long double ld;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define sz(a) a.size()
#define fi first
#define se second
#define rsz(a,n) a.resize(n)
#define test(t) ll t;cin>>t;while(t--)
#define forn(i,e) for(int i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(int i = s; i >= 0; i--)
#define rforsn(i,s,e) for(int i = s; i >= e; i--)
#define fillv(a,k) memset(a,k,sizeof(a))
#define leadzero(a) __builtin_clz(a) //count leading zeros
#define trailzero(a) __builtin_ctz(a) //count trailing zeros
#define bitcount(a) __builtin_popcount(a) // count set bits (add ll)
#define ln cout<<"\n"
#define sp cout<<" "
#define spaceprint(a,i,s,n) {forsn(i,s,n) { cout<<a[i]; sp;}}
#define lineprint(a,i,s,n) {forsn(i,s,n) {cout<<a[i]; ln;}}
#define maxe(a) *max_element(a.begin(),a.end())
#define maxi(a) max_element(a.begin(),a.end())-a.begin()
#define mine(a) *min_element(a.begin(),a.end())
#define mini(a) min_element(a.begin(),a.end())-a.begin()
#define all(c) c.begin(),c.end()
#define trav(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define present(container, element) (container.find(element) != container.end())
#define cpresent(container, element)  (find(all(container),element) != container.end())// check the presence of element
//copy(from_begin, from_end, to_begin); copy function
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<ll,ll> p64;
typedef pair<int,int> p32;
typedef pair<int,p32> p96;
typedef vector<ll> v64;
typedef vector<string> vs;
typedef vector<int> v32;
typedef vector<v32> vv32;
typedef vector<v64> vv64;
typedef vector<p32> vp32;
typedef vector<p64> vp64;
typedef vector<vp32> vvp32;
typedef map<int,int> m32;
typedef map<ll,ll> m64;
const int LIM = 1e5+5, MOD =  1e9;
#define sumv(v) accumulate(all(v),ll(0))
#define productv(v) accumulate(all(v), ll(1), multiplies< ll >())
ll gcd(ll a, ll b) { if(b == 0) return a; return gcd(b, a % b); }
ll fastpowMOD(ll a, ll p,ll MOD){ if(p==0) return 1; ll z = fastpowMOD(a,p/2,MOD); z = (z*z)%MOD; if(p%2) z = (z*a)%MOD; return z; }
bool seive[100005];
void SieveOfEratosthenes(ll n)
{ memset(seive, true, sizeof(seive)); for (ll p=2; p*p<=n; p++) if (seive[p] == true) for (ll i=p*p; i<=n; i += p) seive[i] = false; }
// ll a[11*LIM]={0},b[11*LIM]={0};
// vp64 v[LIM];
typedef struct 
{
	ll one,two,three;
}data;



v64 factorize (ll temp)
{
	v64 fac;
	while (temp%2==0)
	{
		fac.pb(2);
		temp/=2;
	}
	for (ll i=3;i*i<=temp;i+=2)
	{
		while (temp%i==0)
		{
			fac.pb(i);
			temp/=i;
		}
	}
	if (temp!=1)
	{
		fac.pb(temp);
	}

	reverse(all(fac));

	return fac;
}



int main()
{
	fast;
	ll n,k,s;
	cin>>n>>k>>s;
	ll a[n];
	for (ll i=0;i<k;i++)
		a[i]=s;
	if (s==1e9)
	{
		for (ll i=k;i<n;i++)
			a[i]=s-1;
	}
	else
	{
		for (ll i=k;i<n;i++)
			a[i]=s+1;
	}
	for (ll i=0;i<n;i++)
		cout<<a[i]<<" ";

} 

Measured memory_bytes: 2176
#include <stdio.h>

void swap(int,int);
int A[100],c=0;

main(){
  int i,j,n,mini;

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }


  for(i=0;i<=n-1;i++){
    mini=i;
    for(j=i;j<=n-1;j++){
      if(A[j]<A[mini]) {
	mini=j;
      }
    }
    if(A[i]>A[mini])
    swap(i,mini);
  }

  for(i=0;i<n;i++){
    if(i==n-1) {
      printf("%d",A[i]);
      break;
    }
    printf("%d ",A[i]);
  }
  printf("\n%d\n",c);

  return 0;
}


void swap(int x,int y){
  int tmp;

  tmp=A[x];
  A[x]=A[y];
  A[y]=tmp;

  c++;
}

Measured memory_bytes: 600
n,a,b=gets.split
n=n.to_i
a=a.to_i
b=b.to_i

if a>b
    puts 0
elsif a==b
    puts 1
    elsif n==1
    puts 0
    elsif n==2 
    puts 1
else
    puts (n-2)*(b-a)+1
end


Measured memory_bytes: 1788
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while(sc.hasNext()){
			String s = sc.next();

			int p;
			StringBuffer ans = new StringBuffer();
			for(int i=0;i<s.length();i++){
				p = s.codePointAt(i);
				if(p<68)p+=26;
				p-=3;
				ans.append((char)p);
			}
			System.out.println(ans.toString());
			
		}
	}
}

Measured memory_bytes: 17132
# include <algorithm>
# include <iostream>
# include <cmath>
# include <string>
# include <vector>
#include <numeric>

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


using namespace std;

int main() {

    ll N,a,b,c;
    cin >> N;
    ll A[N+4], B[N+4], C[N+4];
    Rep(i,N) {
        cin >> a >> b >> c;
        A[i] = a;
        B[i] = b;
        C[i] = c;
    }
    ll dp[N+4][4];
    dp[1][0] = A[1];
    dp[1][1] = B[1];
    dp[1][2] = C[1];

    for(ll i=2; i<=N; i++) {
        dp[i][0] = max(dp[i-1][1], dp[i-1][2]) + A[i];
        dp[i][1] = max(dp[i-1][2], dp[i-1][0]) + B[i];
        dp[i][2] = max(dp[i-1][0], dp[i-1][1]) + C[i];
    }

    cout << max(dp[N][0], max(dp[N][1], dp[N][2])) << endl;

    return 0;
}


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

#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define debug3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define debugB(x, y) cerr<<#x<<": "<<bitset<y>(x) << endl;
#define line() cerr << "---------------" << endl;

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

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

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

int px[100000];
int py[100000];
int cost[100000];

int main() {
   int H, W, D;
   cin >> H >> W >> D;
   rep (i, H) {
      rep (j, W) {
         int A;
         cin >> A;
         px[A] = j, py[A] = i;
      }
   }

   for (int i = D+1; i <= H*W; i++) {
      cost[i] = cost[i-D] + abs(px[i] - px[i-D]) + abs(py[i] - py[i-D]);
   }

   int Q;
   cin >> Q;
   while (Q--) {
      int l, r;
      cin >> l >> r;
      cout << cost[r] - cost[l] << endl;
   }

   return 0;
}

Measured memory_bytes: 2176
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	if ((tmp & ma0) ^ ma0) {
		int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
		tmp = tmp << dig & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += (72 - dig >> 3);
	}
	else {
		tmp = tmp & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += 8;
		if ((ct = *ci++) >= '0') {
			tmp = tmp * 10 + ct - '0';
			if (*ci++ == '0') {
				tmp = tmp * 10;
				ci++;
			}
		}
	}
	return tmp;
}
void okuri() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	if ((tmp & ma0) ^ ma0) {
		ci += 4 + __builtin_ctzll((tmp & ma0) ^ ma0) >> 3;
	}
	else {
		ci += 8;
		tmp = *(ll*)ci;
		ci += 4 + __builtin_ctzll((tmp & ma0) ^ ma0) >> 3;
	}
}

int A[200001];
int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	int N = getint(), M = getint(), K = getint();

	int p = 0;
	for (; p < N; p++) {
		A[p + 1] = A[p] + getint();
		if (A[p + 1] > K) break;
	}
	for (int q = p + 1; q < N; q++) okuri();

	while (A[p] > K) p--;
	ll kotae = p;

	rep1(i, M) {
		K -= getint();
		if (K < 0) break;
		while (A[p] > K) p--;
		if (kotae < i + p) kotae = i + p;
	}

	printf("%d\n", kotae);

	Would you please return 0;
}

Measured memory_bytes: 2468
import java.util.*;
 
public class Main {
	public static void main(String args[]){
		Scanner s = new Scanner(System.in);
		int[] x = new int[5];
		int sum = 0;
		for(int i=0;i<5;i++){
			x[i] = s.nextInt();
			sum += x[i];
		}
		System.out.println(15-sum);
	}
 
}

Measured memory_bytes: 35712
using System;
using System.Collections.Generic;

namespace ABC177
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(" ");

            int d = int.Parse(input[0]);
            int t = int.Parse(input[1]);
            int s = int.Parse(input[2]);

            if(s*t >= d)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 27512
#include <stdio.h>
int main(void){
    // Your code here!
    int N;
    int a,i;
    scanf("%d",&N);
    
    int V[N];
    int C[N];
    a=0;
    
    for(i=0; i<N; i++)
        scanf("%d",&V[i]);
    
    for(i=0; i<N; i++)
        scanf("%d",&C[i]);
    
    
    for(i=0; i<N; i++){
        if(V[i]-C[i]>0)
            a+=(V[i]-C[i]);
    }
    
    printf("%d",a);
    
    return 0;
}

Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main() {
    int H, W;

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

    return 0;
}


Measured memory_bytes: 3084
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        String s = sc.next();

        // 主処理
        boolean judge = false;
        if (n % 2 == 0) {
            String head = s.substring(0, s.length() / 2);
            String foot = s.substring(s.length() / 2, s.length());
            judge = head.equals(foot);
        }

        String result = judge ? "Yes" : "No";
        // 出力
        System.out.println(result);
        sc.close();
    }
}


Measured memory_bytes: 21716
/*
 
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <iomanip>
#include <set>
#include <map>
#include <stack>
#include <deque>
 
#define ll long long
#define cint const int
#define ld long double
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
 
using namespace std;
 
typedef vector <long long> vll;
typedef vector <string> vs;
typedef vector <char> vc;
typedef set <int> si;
typedef set <string> ss;
typedef pair <int, int> pi;
typedef pair <long long, long long> pll;
typedef pair <int, long long> pil;
typedef pair <int, string> pis;
typedef pair <int, char> pic;
typedef pair <long long, int> pli;
typedef pair <long long, string> pls;
typedef pair <long long, char> plc;
typedef pair <string, int> psi;
typedef pair <string, long long> psl;
typedef pair <string, char> psc;
typedef pair <char, int> pci;
typedef pair <char, long long> pcl;
typedef pair <char, string> pcs;
 
int n;
 
int main () {
	cin >> n;
	for (int i = n;; ++i) {
	    int c = 0;;
	    for (int j = 1; j <= sqrt(i); ++j) {
	        if (i % j == 0) {
	            c++;
	            if (i == i / j) {
	                c++;
	            }
	        }
	    }
	    if (c == 2) {
	        cout << i;
	        return 0;
	    }
	}
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
using namespace std;
string s[1100],ans[1100];
bool hang[1100],lie[1100];
int h,w;
int main()
{
    scanf("%d%d",&h,&w);
    for (int i=0;i<h;i++) cin >> s[i];
    memset(hang,1,sizeof(hang));
    memset(lie,1,sizeof(lie));
    for (int i=0;i<h;i++)
    {
        bool all=1;
        for (int j=0;j<w;j++)
            if (s[i][j]=='#') {all=0;break;}
        if (all) hang[i]=0;
    }
    for (int i=0;i<w;i++)
    {
        bool all=1;
        for ( int j=0;j<h;j++)
            if (s[j][i]=='#') {all=0;break;}
        if (all) lie[i]=0;
    }
 
    for (int i=0;i<h;i++)
    {
        bool out=0;
        for (int j=0;j<w;j++)
            if ((hang[i]) && (lie[j])) {cout << s[i][j];out=1;}
        if (out) cout << endl;
    }
    return 0;
}


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

using namespace std;

int main(void){
  int n, cnt=0;
  cin >> n;
  vector<int> p(n);
  for(int i=0; i<n; ++i)
    cin >> p[i];

  vector<int> p_org(p.begin(), p.end());

  sort(p.begin(), p.end());

  for(int i=0; i<n; ++i){
    if(p[i] != p_org[i]){
      cnt++;
    }
  }
  if(cnt == 2 || cnt == 0)
    cout << "YES" << '\n';
  else
    cout << "NO" << '\n';
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 5000000000000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

int main()
{
  ll N;
  cin >> N;
  vector<pll> ab(N);
  for (ll i = 0; i < N; ++i) {
    ll a, b;
    cin >> a >> b;
    ab.at(i) = {a, b};
  }
  sort(ab.begin(), ab.end(), [] (pll a, pll b) {
    return a.second < b.second;
  });
  ll time = 0;
  for (ll i = 0; i < N; ++i) {
    time += ab.at(i).first;
    if (time > ab.at(i).second) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


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

int main()
{
    string T;
    cin >> T;
    for (int i = 0; i < T.size(); i++)
    {
        if (T[i] == '?')
        {
            T[i] = 'D';
        }
    }
    cout << T << endl;
    return 0;
}

Measured memory_bytes: 3764
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

var N, A, B, C int
var ls []int

func main() {
	N, A, B, C = ReadInt(), ReadInt(), ReadInt(), ReadInt()
	ls = ReadInts(N)
	fmt.Println(dfs(0, 0, 0, 0))
}

func dfs(i, a, b, c int) int {
	if i == N {
		if a*b*c == 0 {
			return math.MaxInt32
		}
		return Abs(A-a) + Abs(B-b) + Abs(C-c) - 30
	}
	return Min(
		10+dfs(i+1, a+ls[i], b, c),
		10+dfs(i+1, a, b+ls[i], c),
		10+dfs(i+1, a, b, c+ls[i]),
		dfs(i+1, a, b, c),
	)
}

func Abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func Min(xs ...int) int {
	min := xs[0]
	for _, x := range xs[1:] {
		if min > x {
			min = x
		}
	}
	return min
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int) { Scan(&i); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


Measured memory_bytes: 1844
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9+7;
//const long long MOD = 998244353;
const long long INF_LL = 1e18+11; const int INF_int = 1e9+11;
#define ll long long
#define mp std::make_pair
#define rep(i,n) for(int i = 0;i<n;i++)
#define lrep(i,n) for(long long i = 0;i<n;i++)
#define All(a) a.begin(),a.end()
#define Debug_Output_ALL(a) for(auto x:a) cout << x << " ";cout << endl;
bool check(vector<int> p,int a){
    rep(i,p.size()) if(p[i]==a) return false;
    return true;
}
int main(){
    int x,n;
    cin >> x >> n;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    rep(i,100){
        if(check(p,x-i)){
            cout << x-i << endl;
            return 0;
        }
        if(check(p,x+i)){
            cout << x+i << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 3596
#include<cstdio>
#include<iostream>
#include<cstring>
#define RG register
#define LL long long
using namespace std;
const int N=2e5+10;
struct dabt{
	int next,to; LL dis;
}e[N];
int n,r,c,head[N],k;
bool vis[N];
LL num[N],minr,minc;
template<typename I> inline void read(I &ot){
	I ch=getchar(), x=0, f=1;
	while(ch<'0' || ch>'9'){if(ch=='-') f=-1; ch=getchar();	}
	while(ch>='0' && ch<='9'){x=x*10+ch-'0'; ch=getchar();	}
	ot=x*f;}
template<typename I, typename... U> inline void read(I &x,U&... y){read(x); read(y...);}
template<typename I>inline I mi(const I &a,const I &b){return a<b ? a : b;}
inline void add(int from,int to,LL d){e[++k]=(dabt){head[from],to,d}; head[from]=k;}
bool dfs(int st,LL sum)
{
	if(vis[st])
	{
		return num[st]==sum;
	}
	if(st<=r) minr=mi(minr,sum);
	else minc=mi(minc,sum);
	vis[st]=1; num[st]=sum;
	for(int i=head[st];i;i=e[i].next)
	{
		int v=e[i].to;
		if(!dfs(v,e[i].dis-sum)) return 0;
	}
	return 1;
}
int main()
{
//	freopen("Grid and Integers.in","r",stdin);
	//freopen(".out","w",stdout);
	read(r,c,n);
	for(int i=1,x,y,z;i<=n;i++)
	{
		read(x,y,z);
		add(x,y+r,z); add(y+r,x,z);
	}
	for(int i=1;i<=r+c;i++)
	{
		if(!vis[i])
		{
			minr=3e18, minc=3e18;
			if(!dfs(i,0) || minc+minr<0)
			{
				printf("No\n");
				return 0;
			}
		}
	}
	printf("Yes\n");
	//fclose(stdin); fclose(stdout);
	return 0;
}


Measured memory_bytes: 9088