akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h> 
using namespace std; 
typedef   long long int ll;
int main () {
   ll a,b,c,x;
   cin>>a>>b>>c;
   x=a;
   a=b;
   b=x;
   x=a;
   a=c;
   c=x;
   cout<<a<<" "<<b<<" "<<c<<endl;
}

    
    
    

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
int INF = (1 << 31) - 1;
struct segment_tree {
	int n;
	std::vector<int> data;
	void init(int &n_) {
		int N = 1;
		while (N < n_)N *= 2;
		n_ = N;
		for (int i = 0; i < N*2 - 1; i++)data.push_back(INF);
	}
	void update(int k, int x) {
		k += n - 1;
		data[k] = x;
		while (k > 0) {
			k = (k - 1) / 2;
			data[k] = std::min(data[k * 2 + 1], data[k * 2 + 2]);
		}
	}
	int find(int a, int b, int k, int l, int r) {
		if (b <= l || r <= a)return INF;
		if (a <= l&&r <= b)return data[k];
		int vl1 = find(a, b, k * 2 + 1, l, (l + r) / 2);
		int vl2 = find(a, b, k * 2 + 2, (l + r) / 2, r);
		return std::min(vl1, vl2);
	}
};

int main() {
	int q;
	segment_tree T;
	std::cin >> T.n >> q;
	T.init(T.n);
	for (int i = 0; i < q; i++) {
		int a, x, y;
		std::cin >> a >> x >> y;
		if (!a)T.update(x, y);
		else std::cout << T.find(x, y + 1, 0, 0, T.n) << std::endl;
	}
	return 0;
}


Measured memory_bytes: 3932
N = input()
l = list(map(int, input().split()))

count=0
for i in range(len(l)-1):
    if i == len(l)-2:
        if l[i] == l[i+1]:
            l[i] = l[i]+1
            count=count+1
            break
    if l[i] == l[i+1]:
        if l[i+1]+l[i+2]< 10000:
            l[i+1] = l[i]+l[i+2]
        elif l[i+1] - l[i+2] > 0:
            l[i+1] = l[i]-l[i+2]
        else:
            l[i+1] = l[i]+1
        count=count+1
print(count)


Measured memory_bytes: 3064
#include<iostream>
using namespace std;
int main() {
	int N;
	cin >> N;
	int A[N];
	for (int i = 0; i < N; i++)
		cin >> A[i];
	int i;
	bool flag = true;
	for (i = 0;; i++) {
		for (int j = 0; j < N; j++) {
			if (A[j] % 2 != 0) {
				flag = false;
				break;
			}
			else
				A[j] /= 2;
		}
		if (!flag)
			break;
	}
	cout << i << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
#define allR(v) v.rbegin(), v.rend()
#define PRINT(v) for (auto x : (v)) cout <<x <<" " ; cout <<endl;
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
typedef pair<int,int> Pi;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
const int inf = 1001001001;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
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;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m=numeric_limits<T>::max()){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void hey(){ cout <<"hey" <<endl; }

template<class T> struct edge { int to; T cost;};


int main() {
  string s; cin >>s;
  stack<int> sta;
  rep(i, s.size()){
    if (s[i] == 'T' && sta.size() > 0 && sta.top() == 0){
      sta.pop();
    }else{
      sta.push(s[i]-'S');
    }
  }
  int res = sta.size();
  cout <<res <<endl;
}


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

int main() {
  long long A, B, C;
  cin >> A >> B >> C;
  int ans = 0;
  if (A == B && B == C) {
    if (A % 2 == 0)
      cout << -1 << endl;
    else
      cout << 0 << endl;
  } else {
    while (A % 2 == 0 && B % 2 == 0 && C % 2 == 0) {
      long long newA = (B + C) / 2, newB = (A + C) / 2, newC = (A + B) / 2;
      A = newA, B = newB, C = newC;
      ans++;
    }
    cout << ans << endl;
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<unordered_map>
#include<bitset>
#include<math.h>
#include<vector>
#include<set>
#include<algorithm>
#include<ctype.h>
#include<unordered_set>
#include<string>
#include<iomanip>
#include<queue>
#include<limits>
#include<map>
#include<stack>
#include<iterator>
#include<cstring>
#include<deque>
#include<chrono>
using namespace std;
#define pi 3.141592653589793238


#define MOD 1000000007
#define INF 999999999999999999 
#define pb push_back
#define ff first
#define ss second
#define mt make_tuple
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define f0 get<0>
#define f1 get<1>
#define f2 get<2>
typedef vector<ll> vi;
typedef vector<vi> vvi;


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const int N = 1e5 + 1;
vector<ll> adj[N];
ll color[N];
bool visited[N];
void dfs(ll a){
    visited[a] = true;
    for(auto u : adj[a]){
        if(!visited[u]){
            
            dfs(u);
        }
    }
}
int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    fast;
    ll T = 1, i, j;
    
    
    //cin >> T;
    while (T--) {
        ll n, m;
        ll a ,b, c;
        cin >> n >> m;
        for(i = 0; i < m; i++){
            cin >> a >> b >> c;
            adj[a].pb(b);
            adj[b].pb(a);
        }
        ll ans =0;
        for(i = 1; i <= n; i++){
            if(!visited[i]){
                ans++;
                dfs(i);
            }
            
        }
        cout << ans;
    }

    return 0;
}


Measured memory_bytes: 12276
import java.util.Scanner;

public class Main {

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

		String N = sc.next();

		String ans = " ";

		if ( N.charAt(0) == N.charAt(1) && N.charAt(1) == N.charAt(2)) {
			ans = "Yes";
		} else if (  N.charAt(1) == N.charAt(2) && N.charAt(2) == N.charAt(3) ) {
			ans = "Yes";
		} else {
			ans = "No";
		}

		System.out.println( ans );
	}
}

Measured memory_bytes: 22612
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


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

  std::cout << std::fixed << std::setprecision(12);
  std::cerr << std::fixed << std::setprecision(12);

  int N;

  long double v[55];

  std::cin >> N;

  for (int i = 0; i < N; i ++)
    std::cin >> v[i];

  std::sort(v, v + N, std::greater<long double>());

  for (int i = N - 2; i >= 0; i --)
    v[i] = (v[i] + v[i + 1]) / 2.0;

  std::cout << v[0] << std::endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define pb push_back
#define eb emplace_back
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
const ll INF = numeric_limits<ll>::max()/4;
const int n_max = 1e5+10;


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

int main(){
    string s;cin >> s;
    ll n = s.size();
    ll ans = INF;
    rep(i,n-2){
        ll temp = 0;
        temp += (s[i] - '0') * 100;
        temp += (s[i+1] - '0') * 10;
        temp += (s[i+2] - '0') * 1;
        chmin(ans, abs(temp - 753));
    }
    cout << ans << endl;
}

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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>
#define Graph vector<vector<int>>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

const string YES = "Yes";
const string NO = "No";

void func(std::string S, std::string T){

}

int main(){

    std::string S;
    std::cin >> S;
    std::string T;
    std::cin >> T;
    
    if(T.substr(0,S.size())==S){
        cout << "Yes" << endl;
    }

    else
    {
        cout << "No" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 3596
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)

	scanner.Scan()
	A, err := strconv.Atoi(scanner.Text())
	if err != nil {
		log.Fatal(err)
	}

	scanner.Scan()
	B, err := strconv.Atoi(scanner.Text())
	if err != nil {
		log.Fatal(err)
	}
	scanner.Scan()
	K, err := strconv.Atoi(scanner.Text())
	if err != nil {
		log.Fatal(err)
	}

	if K >= (A + B) {
		fmt.Println(0, 0)
	} else if A >= K {
		fmt.Println(A-K, B)
	} else {
		B -= (K - A)
		fmt.Println(0, B)
	}

}


Measured memory_bytes: 1832
#include <iostream>
#include <vector>
#include <string>
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
typedef unsigned long ul;
typedef pair<ul, ul> P;

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

	int A, P;
	cin >> A >> P;
	cout << (A * 3 + P) / 2 << '\n';
}

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

int main() {
	int N, M;
	cin >> N >> M;
	int H[N];
	bool G[N];
	for (int i = 0; i < N; i++) {
		cin >> H[i];
		G[i] = true;
	}
	for (int i = 0; i < M; i++) {
		int A, B;
		cin >> A >> B;
		if (H[A-1] > H[B-1]) {
			G[B-1] = false;
		} else if (H[A-1] < H[B-1]) {
			G[A-1] = false;
		} else if (H[A-1] == H[B-1]) {
			G[A-1] = false;
			G[B-1] = false;
		}
	}
	int ans = 0;
	for (int i = 0; i < N; i++) {
		if (G[i]) {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4104
//---Vaidik Patel---//
//-------------------Proud to be Indian--------------------------------//
#include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp> // include the associative containers or group of templates such as set,multi multimap, map etc.
#include<ext/pb_ds/tree_policy.hpp> // include the tree_order_statistics_node update
using namespace __gnu_pbds;
#define int long long int
#define ld long double
#define pii pair<int,int>
typedef tree<int,null_type,greater<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; // find_by_order()
#define deb1(x) cout<<#x<<" : "<<x<<"\n";
#define deb2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<"\n";
#define deb3(x,y,z) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<" "<<#z<<": "<<z<<"\n";
#define deb4(x,y,z,w) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\t"<<#z<<" : "<<z<<"\t"<<#w<<" : "<<w<<endl;
#define deb5(a, b, c, d, e)    cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl;
#define deb6(a, b, c, d, e, f) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rFOR(i,a,b) for(int i=a;i>=b;i--)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define vvi vector<vector<int>>
#define M 1000000007
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int powermodm(int x,int n,int m)
{int ans=1;   while(n){if(n&1){ans=(ans*x)%m;}x=(x*x)%m;n=n>>1;}return ans;}
int d, x, y;
void extendedEuclid(int A, int B) {
    if(B == 0) {
        d = A;
        x = 1;
        y = 0;
    }
    else
    {
        extendedEuclid(B, A%B);
        int temp = x;
        x = y;
        y = temp - (A/B)*y;
    }
}
// return modulo inverse of a wrt modulo p(should be prime)
// retunt -1 if modulo inverse does not exist
int MMI(int a, int p)
{
    extendedEuclid(a,p);
    if(d==1 && p!=1)
        return ((x%p)+p)%p;
    else
        return -1;
}

void solve()
{
    int n;
    cin>>n;
    int dp[n+1];
    if(n<3)
    {
        cout<<0<<"\n";
        return;
    }
    memset(dp,0,sizeof(dp));
    for(int i=3;i<=n;i++)
    {
        dp[i]=(dp[i-1]%M +dp[i-3]%M + 1%M)%M;
    }
    cout<<(dp[n-3]%M + 1%M)%M<<"\n";
}
signed main()
{
    
    FIO
    int t;
    t=1;
    //cin>>t;
    FOR(i,0,t)
    {
        solve();
    }
}


Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep2(i,n) for(ll i=1;i<=(n);i++)
#define rep3(i,i0,n) for(ll i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
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; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll N;
    cin >>N;
    vector<ll>A(N);
    vector<ll>B(N);
    ll sum=0;
    rep(i,N){
        cin>>A[i];
        B[i]=A[i]-i-1;
    }
    sort(all(B));
    ll ans1 = 0;
    ll b1 = B[N/2];
    rep(i,N){
        ans1+=abs(A[i]-b1-i-1);
    }
    

    cout << ans1 << endl;


    return 0;
    

}

Measured memory_bytes: 6424
#include <stdio.h>

int main(void)
{
	static char data[1001];
	static int dp[1000][1000];
	int n;
	int i,j;
	int maxdp;
	
	for(;;){
		maxdp=0;
		scanf("%d",&n);
		if(n==0) break;
		
		for(i=0;i<n;i++){
			scanf("%s",data);
			
			if(data[0]=='*') dp[i][0]=0;
			else dp[i][0]=1;
			
			if(i==0){
				for(j=1;j<n;j++){
					if(data[j]=='*') dp[0][j]=0;
					else dp[0][j]=1;
				}
			} else {
				for(j=1;j<n;j++){
					if(data[j]=='*'){
						dp[i][j]=0;
						continue;
					}
					
					dp[i][j]=dp[i-1][j];
					if(dp[i][j]>dp[i][j-1]) dp[i][j]=dp[i][j-1];
					if(dp[i][j]>dp[i-1][j-1]) dp[i][j]=dp[i-1][j-1];
					dp[i][j]++;
					
					if(maxdp<dp[i][j]) maxdp=dp[i][j];
				}
			}
			
		
		}
		
		
		printf("%d\n",maxdp);
		
		
	}
	
	return 0;
}

Measured memory_bytes: 4672
#include <iostream>
#include <numeric>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <set>
#include <map>
#include <iterator>
#include <stack>
#include <string.h>
#include <cstdlib>
#include <queue>
#include <list>
#include <string>
#include <iterator>
#include <iomanip>
#define rep(i,n) for(int i = 0; i < (n); i++) 
using namespace std;

int main() {
    long long int n,x,ans=0,count=1;
    cin >> n >> x;
    vector<int> v(n);
    rep(i,n) cin >> v[i];
    rep(i,n) {
        ans += v[i];
        
        if (ans <= x){
            count += 1;
        } else {
            break;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
 
class Program {
    static List<long> rep;
    static void Main(string[] args){
        //入力を受け取る
       
        var AB  = Console.ReadLine().Split().Select(a => long.Parse(a)).ToArray();
        var A = AB[0];
        var B = AB[1];
        long ans = A+B/2;
        
        
       　Console.WriteLine(ans);
        
        
    }
    
    static int LowerBound(long num){
        
        var l = 0;
        var r = rep.Count()-1;
      
        while(l <= r){
            
            var mid = l+(r-l)/2;
            if(rep[mid] < num){
                l = mid+1;
            }else{
               
                r = mid-1;
            }
        }
        return l;
    }     
}


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

vector<int> dx = {1,1,0,-1,-1,-1,0,1};
vector<int> dy = {0,1,1,1,0,-1,-1,-1};

int main(){
    int h,w;
    cin >> h >> w;
    // 入力されるマップの外側を'.'で埋めておく
    vector<vector<char>> data(h+2,vector<char>(w+2,'.'));
    for(int i = 1;i <= h;i++){
        for(int j = 1;j <= w;j++){
            cin >> data[i][j];
        }
    }

    for(int i = 1;i <= h;i++){
        for(int j = 1;j <= w;j++){
            int cnt = 0;
            if(data[i][j] == '#') cout << '#';
            else{
                // 周り8マスを調べる
                for(int k = 0;k < 8;k++){
                    if(data[i+dx[k]][j+dy[k]] == '#') cnt++;
                }
                cout << cnt;
            }
        }
        cout << endl;
    }
}

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

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

pub fn array_to_num(a: &[u32]) -> u32 {
    let mut n = 0;
    let mut d = u32::pow(10, (a.len() - 1) as u32) as u32;
    for i in a {
        n += i * d;
        d /= 10;
    }
    n
}

fn main() {
    input! {
        ss: chars
    }
    let mut nums = Vec::new();
    for i in 2..ss.len() {
        let ns: Vec<u32> = ss[i-2..i+1].iter()
            .map(|x| x.to_digit(10).unwrap()).collect::<Vec<u32>>();
        nums.push(array_to_num(&ns) as i64);
    }
    println!("{}",
        nums.into_iter().map(|n| (753-n).abs()).min().unwrap());
}


Measured memory_bytes: 4352
import java.util.*;

class Main{
    static boolean hitachi(String hi){
        if(hi.equals("hi")){
            return true;
            
        }
        else{
            return false;
        }
    }
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int l = str.length();
        int i = 0;
        boolean ans = false;

        while(i+2 <= l){
            String hi = str.substring(i, i+2);
            ans = hitachi(hi);
            if(ans == false) break;
            i = i+2;
        }
        if(l%2!=0) ans = false;
        String answer = "a";
        if(ans == true){
            answer = "Yes";
        }
        else{
            answer = "No";
        }
        System.out.println(answer);
    }
}

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

int main()
{
    int n;
    cin >> n;
    int a[n];
    rep(i, n) cin >> a[i];
    int ans = 0;
    rep(i, n) ans += a[i] - 1;
    OP(ans);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <complex>
#include <iomanip>
#include <cassert>
 
using namespace std;
 
typedef long long ll;

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
#endif  
  int n;
  cin >> n;
  vector <pair <int, int>> a(n);
  for (int i = 0; i < n; ++i) {
    int x, l;
    cin >> x >> l;
    a[i].first = x - l;
    a[i].second = x + l;
  }
  sort(a.begin(), a.end(), [&] (pair <int, int> f, pair <int, int> s) {
    if (f.second != s.second) return f.second < s.second;
    return f.first > s.first;
  });
  int cr = -2e9, cnt = 0;
  for (auto p : a) {
    if (p.first >= cr) {
      ++cnt;
      cr = p.second;
    }
  }
  cout << cnt << '\n';
}


Measured memory_bytes: 1024
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner scanner = new Scanner(System.in);
		int k = scanner.nextInt()+1;
		int s = scanner.nextInt();
		int count = 0;
		for(int i = 0; i < k; i++){
			for(int j = 0; j < k; j++){
				int a = s - (i+j);
				if(a <= k-1 && a >= 0){
					count++;
				}
			}
		}
		System.out.println(count);
	}
}

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> city(N,0);
  for (int i=0; i < M*2; i++) {
    int a;
    cin >> a;
    city.at(a-1)++;
  }
  for (int i=0; i < N; i++) {
    cout << city.at(i) << endl;
  }
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(I, a, b) for (int i = (a); i < (b); ++i)
using namespace std;
using ll = long long;

int main() {
  ll n,a,b,c,d,e;
  cin >> n >> a >> b >> c >> d >> e;
  ll w = min({a,b,c,d,e});
  if(n <= w){
    cout << 5 << endl;
    return 0;
  }
  ll ans = n/w - (n%w == 0);
 
  ans += 5;
  cout << ans << endl;
}


Measured memory_bytes: 3636
#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
#include<string>
#include<queue>
#include<set>
#include<stack>
#include<map>

using namespace std;

map<string,int> mp;

int solve(int i,int j,int pi,int pj){//i以上，j未満に必ず解が存在する．pi，pjは必ず0でない．
    int mid=(i+j)/2;
    cout<<mid<<endl;
    string s;
    cin>>s;
    if(mp[s]==0){
        return 0;
    }
    //場合分けが面倒すぎる．
    int pm=mp[s];
    int x=mid-i;
    int k;
    if(pi==pj){
        if(pm==pi){
            if(x%2==0){
                k=2;
            }else{
                k=1;
            }
        }else{
            if(x%2==0){
                k=1;
            }else{
                k=2;
            }
        }
    }else{
        if(pm==pi){
            if(x%2==0){
                k=2;
            }else{
                k=1;
            }
        }else{
            if(x%2==0){
                k=1;
            }else{
                k=2;
            }
        }
    }
    
    if(k==1){
        solve(i,mid,pi,pm);
    }else{
        solve(mid,j,pm,pj);
    }
    return 0;
}

int main(){
    int N;
    cin>>N;
    mp["Vacant"]=0;
    mp["Male"]=1;
    mp["Female"]=2;
    cout<<0<<endl;
    string s;
    cin>>s;
    if(mp[s]!=0) solve(0,N,mp[s],mp[s]);
    return 0;
}


Measured memory_bytes: 972
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=0x3f3f3f3f;
vector<int> v[3];// v[0]->'R' ,v[1]->'G' ,v[2]->'B'
//record position 
const int N=4005;
int n;
char s[N]; 
int main()
{
	ios::sync_with_stdio(false);
	cin>>n;
	cin>>s+1;
	for(int i=1;s[i];i++)
	{
		if(s[i]=='R')
			v[0].push_back(i);
		else if(s[i]=='G')
			v[1].push_back(i);
		else if(s[i]=='B')
			v[2].push_back(i);
	}
	ll ans=0;
	for(int i=0;i<v[0].size();i++)
	{
		for(int j=0;j<v[1].size();j++)
		{
			int a=v[0][i],b=v[1][j];
			if(a>b)
				swap(a,b);
			int cnt=v[2].size();
			if(binary_search(v[2].begin(),v[2].end(),b+b-a))
				cnt--;
			if(binary_search(v[2].begin(),v[2].end(),a-(b-a)))
				cnt--;
			if((b-a)%2==0)
			{
				if(binary_search(v[2].begin(),v[2].end(),(a+b)>>1))
					cnt--;
			}
			ans+=cnt;
			
		}
	}
	cout<<ans<<endl;
 	return 0;
}



Measured memory_bytes: 3672
function Cmod(n, k, Mod=10^9+7)
    ret = 1
    for i in 1:k
        ret *= mod((n-i+1)*invmod(i, Mod) , Mod)
        ret = mod(ret, Mod)
    end
    return ret
end
function Redistribution()
    S = parse(Int, readline())
    p = S ÷ 3
    q = mod(S, 3)
    Mod=10^9+7
    ans = 0
    for n in 0:p-1
        ans += Cmod(p+q+2n-1, q+3n)
        ans = mod(ans, Mod)
    end
    return println(ans)
end
Redistribution()

Measured memory_bytes: 165048
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N; cin>>N;
  vector<long long> S(N);
  for(int i=0; i<N; i++){
    cin>>S.at(i);
  }
  if(N<=2)
    cout<<0<<endl;
  else{
    sort(S.begin(),S.end());
    int K=0;
    int Ans=0;
    for(int i=0; i<N-2; i++){
      for(int j=i+1; j<N-1; j++){
        for(int l=j+1;l<N; l++){
          if(S.at(i)!=S.at(j)&&S.at(j)!=S.at(l)){
            K++;
          }
            if(S.at(i)+S.at(j)>S.at(l)){
              K++;
            }
          if(K==2){
            Ans++;
          }
          K=0;
        }
      }
    }
    cout<<Ans<<endl;
            
  }
}


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

int main() {
  int N, A, B, X, Y;
  cin >> N >> A >> B;
  X = A * N;
  Y = B;
  if (X > Y) {
    cout << Y << endl;
  }
  if (Y > X) {
    cout << X << endl;
  }
  if (Y == X){
    cout << X << endl;
  }
}


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

int main() {
  int N,K,a;
  cin >> N >> K;
  vector<int> count(N);
  rep(i,N) {
    cin >> a;
    count[a-1]++;
  }
  sort(count.begin(),count.end());
  int ans=0;
  for(int i=0; i<N-K; i++) ans += count[i];
  cout << ans << endl;
}

Measured memory_bytes: 4060
#include <iostream>
  #include <string>
  #include <vector>
  #include <algorithm>
  #include <deque>
  using namespace std;
  typedef long long ll;
  #define rep(i,n) for (int i=0;i < (int)(n);i++)

  
  int main(){
    int n,m;
    string s,t,u;
    cin >> s;
    for (int i=0;i < s.size()/2;i++){
      if (s[i] != s[s.size()-1-i]){
        cout << "No" << endl;
        return 0;
      }
    }
    n=s.size();
    t=s.substr(0,(n-1)/2);
    u=s.substr((n+3)/2-1,(n-1)/2);
    for (int i=0;i < t.size()/2;i++){
      if (t[i] != t[t.size()-1-i]){
        cout << "No" << endl;
        return 0;
      }
    }
    for (int i=0;i < u.size()/2;i++){
      if (u[i] != u[u.size()-1-i]){
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    

    
    return 0;
  }


Measured memory_bytes: 256
s = [input() for i in range(3)]

s = {'a': s[0]+'@', 'b': s[1]+'@', 'c': s[2]+'@'}
l = {'a': len(s['a'])-1, 'b': len(s['b'])-1, 'c': len(s['c'])-1}
if len(s['a'])==1:
    print('A')
    exit()

ini = s['a'][0]
while True:
    l[ini] += -1
    tem_s=s[ini][0]
    s[ini] = s[ini][1:]
    if tem_s=='@':
        print(ini.upper())
        exit()
    ini =tem_s




Measured memory_bytes: 3064
use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn main() {
    let n: usize = input();
    let mut answers: Vec<u64> = vec![0; n+1];
    for x in 1..200 {
        for y in 1..200 {
            for z in 1..200 {
                let m = x * x + y * y + z * z + x * y + y * z + z * x;
                if m <= n {
                    answers[m] += 1;
                }
            }
        }
    }
    for i in 1..(n+1) {
        println!("{}", answers[i]);
    }
}


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

using namespace std;

int main() {
    int a, b, c, x;
    cin >> a >> b >> c >> x;
    int xx = x / 50, ans = 0;
    for (int i = 0; i <= a; ++i) {
        for (int j = 0; j <= b; ++j) {
            int cc = xx - 10 * i - 2 * j;
            if (cc >= 0 && cc <= c) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


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

int main() {
	
	long long r,b,n,ans;
	string s;
	cin >> n>>b>>r;

	cout << ((long long)n/(r+b))*b +min((long long)n%(r+b),b)<< "\n";
	return 0;
}


Measured memory_bytes: 256
//https://atcoder.jp/contests/dp/tasks/dp_a

#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
int main(){
    int n; cin>>n;
    vector<int> a(n);
    for(int i = 0; i<n; i++){
        cin>>a[i];
    }
    vector<int> dp(n, INF);
    dp[0] = 0;
    for(int i = 0; i<n; i++){
        for(int j = i+1; j<=i+2; j++){
            if(j<n){
                dp[j] = min(dp[j], dp[i] + abs(a[i]- a[j]));
            }
        }
    }
    cout<<dp[n-1];

    return 0;
}

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

using namespace std;

int main()
{
    int n;
    cin >> n;
    
    long overshoot = 0;
    vector<int> listA(n);
    vector<int> listB(n);
    for (int i = 0; i < n; i++) {
        cin >> listA[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> listB[i];
        if (listA[i] == listB[i]) {
            continue;
        } else if (listA[i] < listB[i]) {
            int toAdd = listB[i] - listA[i];
            if (toAdd & 0x1)    //if odd, add1
                toAdd++;
            listA[i]  += toAdd;
            overshoot += (toAdd >> 1);
        }
    }
    
    for (int i = 0; i < n; i++) {
        if (listA[i] > listB[i]) {
            //fill with the overshoot
            overshoot-= (listA[i] - listB[i]);
            if (overshoot < 0) {
                cout << "No";
                return 0;
            }
        }
    }
    cout << "Yes";

    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <math.h>
#include <iomanip>
#define _USE_MATH_DEFINES

using namespace std;

int main(void)
{
	double a, b, C;
	cin >> a >> b >> C;
	double S, L, h;
	double c;
	S = 0.5 * a * b * sin(C / 360 * 2 * M_PI);
	c = sqrt( a * a + b * b - 2 * a * b * cos(C / 360 * 2 * M_PI));
	L = a + b + c;
	h = S / a * 2;

	cout << fixed << setprecision(6) << S << " " << L << " " << h << endl;
	return 0;
}


Measured memory_bytes: 3584
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)
 
int main(){
    int d,n;
    scanf("%d %d",&d,&n);
  if(n==100){
    n = 101;
  }
if(d==0){
  printf("%d",n);
  return 0;
}
  else if(d==1){
    printf("%d",n*100);
    return 0;
  }
  else{
    printf("%d",n*10000);
    return 0;
  }
 
  return 0;
}
//N=100のとき別に考える

Measured memory_bytes: 128
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    
    int H, W;
    cin >>  H >> W;
    
    char a[100][100];
    
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            cin >> a[i][j];
        }
    }
    
    for(int i = 0; i < W+2; i++){
        cout << "#";
    }
    
    cout << endl;
    
    for(int i = 0; i < H; i++){
        cout << "#";
        for(int j = 0; j < W; j++){
            cout << a[i][j];
        }
        cout << "#" << endl;
    }
    
    
    for(int i = 0; i < W+2; i++){
        cout << "#";
    }
    cout << endl;
}


Measured memory_bytes: 3036
#include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0; i<N; i++)
#define lint long long
#define square_vector(name,N,M) vector<vector<lint>>name(N,vector<lint>(M,0))
#define sort(V) sort(V.begin(),V.end())


int main() {
  lint N,u,v;
  cin >> N >> u >> v;
  u--;
  v--;
  
  vector<lint> u_depth(N,-1),v_depth(N,-1);
  u_depth[u] = 0;
  v_depth[v] = 0;
  
  vector<queue<lint>> can(N);
  vector<queue<lint>> can2(N);
  
  lint A,B;
  rep(i,N-1) {
    cin >> A >> B;
    A--;
    B--;
    can[A].push(B);
    can[B].push(A);
    can2[A].push(B);
    can2[B].push(A);
  }
  
  
  queue<lint> que;
  que.push(u);
  
  lint pla = u;
  
  while (!que.empty()) {
    pla = que.front();
    while (!can[pla].empty()) {
      if (u_depth[can[pla].front()] == -1) {
        u_depth[can[pla].front()] = u_depth[pla] + 1;
      }
      que.push(can[pla].front());
      can[pla].pop();
    }
    que.pop();
  }
    
  queue<lint> que2;
  que2.push(v);
  
  pla = v;
  
  while (!que2.empty()) {
    pla = que2.front();
    while (!can2[pla].empty()) {
      if (v_depth[can2[pla].front()] == -1) {
        v_depth[can2[pla].front()] = v_depth[pla] + 1;
      }
      que2.push(can2[pla].front());
      can2[pla].pop();
    }
    que2.pop();
  }
  
  lint ans = 0;
  
  rep (i,N) {
    if (u_depth[i] < v_depth[i]) {
      ans = max(ans,(v_depth[i] - 1));
    }
    
  }
  
  rep (i,N) {
    cerr << u_depth[i] << " " << v_depth[i] << endl;
  }
  
  cout << ans << endl;
  
}

Measured memory_bytes: 136448
#include <bits/stdc++.h>
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++)

int main()
{
    ll N, ABC[3]; cin >> N >> ABC[0] >> ABC[1] >> ABC[2];
    vector<string> S(N); for (auto& s : S) cin >> s;

    bool yes = true;
    string ans;
    for (int i = 0; i < N; i++) {
        int ind[2];
        int chosen = 0;
        for (int j = 0; j < 2; j++) ind[j] = S[i][j] - 'A';
        if (ABC[ind[0]] == 0 && ABC[ind[1]] == 0) {
            yes = false;
            break;
        } else if (ABC[ind[0]] == 0) {
            chosen = 0;
        } else if (ABC[ind[1]] == 0) {
            chosen = 1;
        } else {
            if (i != N - 1) {
                int next_ind[2];
                for (int j = 0; j < 2; j++) next_ind[j] = S[i+1][j] - 'A';
                if (ind[0] == next_ind[0] || ind[0] == next_ind[1]) {
                    chosen = 0;
                } else if (ind[1] == next_ind[0] || ind[1] == next_ind[1]) {
                    chosen = 1;
                }
            }
        }
        ans.push_back(char('A'+ind[chosen]));
        ABC[ind[chosen]]++;
        ABC[ind[1-chosen]]--;
    }

    if (yes) {
        cout << "Yes" << endl;
        for (auto ch : ans) cout << ch << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 6688
#include<iostream>
using namespace std;int main(){int a,b,t=0,c[2][1010]={{0},{0}};string s;while(getline(cin,s)){if(s==""){t++;if(t==2)break;}a=0,b=0;while(s[b]>45)a*=10,a+=s[b]-48,b++;c[t][a]++;}for(t=0;t<1010;t++){a=c[0][t],b=c[1][t];if(a&&b)cout<<t<<" "<<a+b<<endl;}return 0;}

Measured memory_bytes: 3008
#include<cstdio>
#include<cstdlib>
using namespace std;
typedef long long LL;
const int maxn=1e5+2;
const int maxm=4e5+2;
const int mod=998244353;
int n,m,ans;
LL inv[maxn<<2],fac[maxn<<2];
char lef[maxn],rig[maxn],up[maxn],down[maxn];
LL Com(LL a,LL b){return (LL)fac[a]*inv[b]%mod*inv[a-b]%mod;}
LL change(char ch){return ch-'0';}
void solve(int n,int m,char *lef,char *rig,char *up,char *down){
	LL suml=0,sumr=0;
	for (int i=1;i<=n;i++){
		suml+=change(lef[i]);
		sumr+=change(rig[i]);
	}
	LL sumu=0,sumd=0;
	for (int i=1;i<=m;i++){
		sumu+=change(up[i]);
		sumd+=change(down[i]);
	}
	if (!suml&&!sumr&&!sumu&&!sumd){
		printf("1");
		exit(0);
	}
	LL tmp=1,nowu=0,nowd=0,u=0,d=0;
	for (int i=1;i<=m;i++){
		nowu+=(u=change(up[i]));
		nowd+=(d=change(down[i]));
		if (u||d){
			if (u&&d) tmp=tmp*2%mod;
			if (sumr) ans=(ans+tmp*Com(sumr+sumu+sumd-nowu-nowd-1,sumr-1))%mod;
			else ans=(ans+tmp*(sumu+sumd==nowu+nowd))%mod;
			if (suml) tmp=(tmp+Com(suml+nowu+nowd-1,suml-1))%mod;
			else tmp=(tmp+(nowu+nowd==0))%mod;
		}
	}
}
void init(){
	fac[0]=1;
	for (int i=1;i<=maxm;i++) fac[i]=fac[i-1]*i%mod;
	inv[0]=inv[1]=1;
	for (int i=2;i<=maxm;i++) inv[i]=(mod-mod/i)*inv[mod%i]%mod;
	for (int i=2;i<=maxm;i++) inv[i]=(LL)inv[i]*inv[i-1]%mod;
}
int main(){
	init();
	scanf("%d%d",&n,&m);
	scanf("%s%s%s%s",lef+1,rig+1,up+1,down+1);
	solve(n,m,lef,rig,up,down);
	solve(m,n,up,down,lef,rig);
	printf("%d",ans);
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define range(a) a.begin(), a.end()

using namespace std;
using ll = long long;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int N; cin >> N;
  string S; cin >> S;
  vector<int> sa(N + 1); rep(i, N + 1) sa[i] = i;
  sort(range(sa), [&](int i, int j) {
    return S.substr(i) < S.substr(j);
  });
  vector<int> lcp(N + 1);
  rep(i, N) {
    int h = 0;
    while (sa[i] + h < N && sa[i + 1] + h < N && S[sa[i] + h] == S[sa[i + 1] + h]) h++;
    lcp[i] = h;
  }

  int l = 0;
  int r = N;
  while (r - l > 1) {
    int m = (l + r) / 2;
    int i = 0;
    bool any = false;
    while (i < N) {
      int mn = sa[i];
      int mx = sa[i];
      while (i < N && lcp[i] >= m) {
        i++;
        mn = min(mn, sa[i]);
        mx = max(mx, sa[i]);
      }
      any |= mx - mn >= m;
      i++;
    }
    if (any) l = m; else r = m;
  }
  cout << l << endl;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

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

    static class TaskA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int a = in.nextInt();
            out.println(n * n - a);

        }

    }
}



Measured memory_bytes: 21844
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
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; }
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;



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

	int N;
	cin >> N;
	VI C(N);
	REP(i, N)cin >> C[i];
	SORT(C);

	int ans = 0;
	int bi[200010] = { 0 };
	int b = 1;

	for (int i = 0; i <= N; i++) {
		bi[i] = b;
		b *= 2;
		b %= mod;
	}

	REP(i, N) {
		int a = C[i];
		int cnt = bi[N - i - 1];




		if(N-i-2>=0)cnt += bi[N - i - 2] * (N - i - 1);

		cnt %= mod;
		cnt *= bi[i];
		cnt %= mod;
		//cout << bi[i] << " " << bi[i] * (N - i - 1) / 2 << " " << bi[N - i-1] << endl;
		
		//if(a * cnt<0)cout << a << " " << cnt << endl;



		ans += a * cnt;
		ans %= mod;
	}

	ans *= bi[N];
	ans %= mod;
	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 3328
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <set>
#include <string.h>

using namespace std;

typedef long long ll;

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REP3(i,st,en) for(ll (i)=(st);(i)<(en);(i)++)

using P = pair<ll, ll>;
const int MOD = 1e9+7;
const ll INF = 1e+14;
const double PI = 3.14159265349;


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

  string a, b, c;
  cin >> a >> b >> c;

  cout << "A"+b.substr(0,1)+"C" << "\n";
  return 0;
}


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

bool used[200001];
int main() {
	int n, m; scanf("%d%d", &n, &m);
	deque<int>que(n); iota(que.begin(), que.end(), 1);
	rep(i, m) {
		int d; scanf("%d", &d);
		que.push_front(d);
	}
	for (int i : que) {
		if (used[i])continue;
		printf("%d\n", i);
		used[i] = true;
	}
}

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

const int INF = 1001001001;

int main(){
  int n,k;
  std::cin >> n >> k;
  std::vector<int> h(n);
  std::vector<int> c(n,INF);
  rep(i,n) std::cin >> h[i];
  c[0]=0;
  rep(i,n){
    for (int j = 1; j <= k ;j++) {
      if(j+i<n)c[j+i]=min(c[j+i],c[i]+abs(h[i]-h[j+i]));
    }
  }
  // rep(i,n)std::cout << c[i] << '\n';
  std::cout << c[n-1] << '\n';



}


Measured memory_bytes: 1024
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <cfloat>

using std::cerr;
using std::cin;
using std::cout;
using std::endl;

using namespace std;
typedef long long int64;

int main(){
  cout << std::fixed << std::setprecision(16);
  cin.tie(nullptr);
  std::ios::sync_with_stdio(false);

  int n;
  cin>>n;
  vector<int64> a(n);
  int64 sum=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
  }

  int64 cum=0;
  int64 result=INT64_MAX;
  for(int i=0;i<n;i++){
    cum+=a[i];
    if(sum%2==0&&cum==sum/2){
      cout<<0<<endl;
      return 0;
    }else{
      int64 diff=abs(sum-cum-cum);
      result=min(result,diff);
    }
  }

  cout<<result<<endl;



  return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e9;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int out=0;
	map<string,int>ma;
	int n;
	cin>>n;
	rep(i,n){
		string s;cin>>s;
		ma[s]++;
	}
	cin>>n;
	rep(i,n){
		string s;cin>>s;
		ma[s]--;
	}
	for(auto &s:ma)out=max(out,s.second);
	cout<<out<<endl;
}










Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = (n)-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = (s); i < (n); ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vd vector<double>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class S,class T> istream& operator>>(istream &is,pair<S,T> &p) { return is >> p.first >> p.second; }
template<class S,class T> ostream& operator<<(ostream &os,const pair<S,T> &p) { return os<<'{'<<p.first<<","<<p.second<<'}'; }
template<class T> istream& operator>>(istream &is,vector<T> &v) { for(T &t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) { os<<'[';rep(i,v.size())os<<v[i]<<(i==v.size()-1?']':','); return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
template<class T> bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    string s,t;
    cin >> s >> t;
    int n = s.size();
    int ans = 0;
    rep(i,n) if(s[i] != t[i]) ans++;
    cout << ans << endl;
}

Measured memory_bytes: 3820
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int inf = INT_MAX;
const ll INF = LLONG_MAX;
const ll MOD = 1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b, const ll mod=MOD) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b, const ll mod=MOD) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b, const ll mod=MOD) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b, const ll mod=MOD) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int a, b; cin >> a >> b;
    int c = a * b;

    cout << (c % 2 ? "Odd":"Even") << endl;

    return 0;
}


Measured memory_bytes: 256