akhauriyash/Code-Regression huggingface dataset:
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
int main()
{
    string s;
    int q;
    cin >> s >> q;
    for(int i = 0;i < q;i++)
    {
        string t;
        int a,b;
        cin >> t >> a >> b;
        if(t == "replace")
        {
            string p;
            cin >> p;
            int k = 0;
            for(int i = a;i <= b;i++)
            {
                s[i] = p[k];
                k++;
            }
        }
        else if(t == "print")
        {
            for(int i = a;i <= b;i++)
            {
                cout << s[i];
            }
            cout << "\n";
        }
        else
        {
            string sub = s.substr(a,b - a + 1);
            int k = 0;
            for(int i = a;i <= b;i++)
            {
                s[i] = sub[sub.size() - 1 - k];
                k++;
            }
        }
    }

    return 0;
}


Measured memory_bytes: 3176
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
 */
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[] dp = new int[n];
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }
            dp[0] = 0;
            dp[1] = Math.abs(a[0] - a[1]);
            for (int i = 2; i < n; i++) {
                dp[i] = Math.min(dp[i - 1] + Math.abs(a[i] - a[i - 1]), dp[i - 2] + Math.abs(a[i] - a[i - 2]));
            }

            out.println(dp[n - 1]);
        }

    }
}



Measured memory_bytes: 57924
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI = 3.141592653589793238462643383279;
ll getDigit(ll x) {
  return x == 0 ? 1 : log10(x) + 1;
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

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

signed main() {
  ll N;
  cin >> N;
  vll A(N);
  vll B(N);
  vll C(N);
  rep(i, N) {
    cin >> A[i];
    A[i]--;
  }
  rep(i, N) {
    cin >> B[i];
  }
  rep(i, N - 1) {
    cin >> C[i];
  }

  ll ans = 0;
  ll before = INF;
  rep(i, N) {
    ll index = A[i];
    ans += B[index];
    if (before - index == -1) {
      ans += C[A[i - 1]];
    }
    before = index;
  }
  COUT(ans);
  return 0;
}

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

int main() {
  int n;
  cin >> n;
  
  if(n < 10) cout << n << endl;
  else if(n < 100) cout << 9 << endl;
  else if(n < 1000) cout << n - 90 << endl;
  else if(n < 10000) cout << 909 << endl;
  else if(n < 100000) cout << n - 9090 << endl;
  else cout << 90909 << endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>  // This will work only for g++ compiler. 
#include <ext/pb_ds/assoc_container.hpp> // Used to include policy based data structure 
using namespace __gnu_pbds;  // Only for g++ compiler
using namespace std;

#define for0(i, n) for (int i = 0; i < (int)(n); ++i) // 0 based indexing
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i) // 1 based indexing
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i) // closed interver from l to r r inclusive
#define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i) // reverse 0 based.
#define forr1(i, n) for (int i = (int)(n); i >= 1; --i) // reverse 1 based
#define max(a, b)  (a > b) ?a :b  // max of 2 elements 
#define min(a, b)  (a < b) ?a :b  // min of 2 elements

//short hand for usual tokens
#define pb              push_back
#define fi              first
#define se              second
#define mp              make_pair
#define mii             map<int,int>
#define pqb             priority_queue<int>   // Max Heap
#define pqs             priority_queue<int,vi,greater<int> >   // Min Heap
#define setbits(x)      __builtin_popcountll(x)   // returns the number of set bits in the binary representation of x
#define zrobits(x)      __builtin_ctzll(x)   // returns the number of zeroes before the first set bit in the binary representation of x       
#define mod             1000000007   // 1e9 + 7   
#define inf             1e18   // pow(10, 18)  
#define mk(arr,n,type)  type *arr=new type[n];   // generates a dynamic array
#define w(x)            int x; cin>>x; while(x--)   // for taking test cases 
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());   // used with shuffle

// to be used with algorithms that processes a container Eg: find(all(c),42)
#define all(x) (x).begin(), (x).end() //Forward traversal
#define rall(x) (x).rbegin, (x).rend() //reverse traversal

// traversal function to avoid long template definition. Now with C++11 auto alleviates the pain.
#define tr(c,i) for(__typeof__((c)).begin() i = (c).begin(); i != (c).end(); i++)

// find if a given value is present in a container. Container version. Runs in log(n) for set and map
#define present(c,x) ((c).find(x) != (c).end())

//find version works for all containers. This is present in std namespace.
#define cpresent(c,x) (find(all(c),x) != (c).end())

// Avoiding wrap around of size()-1 where size is a unsigned int.
#define sz(a) int((a).size())


typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;   // Used to implement policy-based data structure

// Shorthand for commonly used types
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;
    
    int n;
    cin>>n;
    ll ans = 0LL;
    for(int i = 1; i <= n; i++){
        int temp = n/i;
        ans += (1LL*temp*(temp+1)*i)/2 ;    
    }
    
    cout<<ans;
    return 0;
}

Measured memory_bytes: 3620
using System;

public class Hello
{
    public static void Main()
    {
        var a = new string[] { "+++", "-++", "+-+", "--+", "---", "+--", "-+-", "++-" };
        var s = Console.ReadLine().Trim();
        var c = new int[3];
        var targ = 7 - int.Parse(s[0].ToString());
        for (int i = 0; i < 3; i++)
            c[i] = int.Parse(s[i+1].ToString());
        for (int i = 0; i < 8; i++)
        {
            var csum = 0;
            for (int j = 0; j < 3; j++)
            {
                if (a[i][j] == '-') csum -= c[j];
                else csum += c[j];
            }
            if (csum == targ) { putAns(c, targ, i, a); goto end; }
        }
        end:;
    }
    public static void putAns (int[] c , int targ , int i , string[] a)
    {
        Console.Write(7 - targ);
        for (int j = 0; j < 3; j++)
        {
            Console.Write(a[i][j]);
            Console.Write(c[j]);
        }
        Console.WriteLine("=7");
    }
}

Measured memory_bytes: 13140
#include<stdio.h>
int search(int A[],int n,int key)
{
    int i=0;
    A[n]=key;
    while(A[i]!=key) i++;
    return i!=n;
}
int main()
{
    int i,n,A[10000+1],q,key,sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",&A[i]);
    scanf("%d",&q);
    for(i=0;i<q;i++)
    {
        scanf("%d",&key);
        if(search(A,n,key)) sum++;
    }
    printf("%d\n",sum);
    return 0;
}

Measured memory_bytes: 2688
import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    if(S.equals("AAA") || S.equals("BBB")){
      System.out.print("No");
    }else{
      System.out.print("Yes");
    }
  }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e9;
bool graph[nmax][nmax];
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
  public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

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

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

ll ceil(ll a, ll b)
{
    return (a + b - 1) / b;
}


void solve(long long N, long long K, std::vector<long long> h){
    ll ans = 0;
    for (int i = 0; i < N; i++)
    {
        if(K <= h[i]){
            ans++;
        }
    }
    
    cout << ans << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    std::vector<long long> h(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&h[i]);
    }
    solve(N, K, std::move(h));
    return 0;
}


Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
typedef long long LL;
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;
}
int main() {
	int N;
	cin >> N;
	LL ans = 1;
	for (int i = 0; i < N; i++) {
		LL T;
		cin >> T;
		ans = lcm(ans, T);
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        for(int i=0;i<m;i++){
            n-=sc.nextInt();
        }
        System.out.println((n>0)?"No":"Yes");
    }
}


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


int main()
{
    int n;cin>>n;
    vector<int> d(n);
    for(int i = 0; i<n;i++)cin>>d[i];
    sort(d.begin(), d.end());
    if(d[n/2-1] == d[n/2]){
        cout << 0 << endl;
        return 0;
    }else{
        cout <<  d[n/2]-d[n/2-1]<< endl;
    
    
    }
    return 0;
}

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

int main() {
  string S;
  cin>>S;
  int N = S.length();
  cout << S[0] << N-2 << S[N-1] << endl;
  return 0;
}


Measured memory_bytes: 256
import math
A,B,H,M=(int(x) for x in input().split())
theta=abs((6/360)*2*M*math.pi-(0.5/360)*2*(M+60*H)*math.pi)
if theta>math.pi:
    theta=2*math.pi-theta
ans=math.sqrt(A**2+B**2-2*A*B*math.cos(theta))
print(ans)

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

const int N = 2005;

int n, m, head[N], tot, dep[N], f[N];
struct edge { int to, nxt; } e[N << 1];

void link(int x, int y) {
	e[++tot] = (edge) { y, head[x] }, head[x] = tot;
	e[++tot] = (edge) { x, head[y] }, head[y] = tot;
}

int dfn[N], idx;

void dfs0(int x) {
	dep[x] = dep[f[x]] + 1, dfn[++idx] = x;
	for (int i = head[x]; i; i = e[i].nxt)
		if (e[i].to != f[x]) f[e[i].to] = x, dfs0(e[i].to);
}

int lca[N][N], cnt[N];

void dfs1(int x, int start, int min = 0, int f = 0) {
	if (dep[x] < dep[min]) min = x;
	lca[start][x] = min;
	for (int i = head[x]; i; i = e[i].nxt) if (e[i].to != f)
		dfs1(e[i].to, start, min, x);
}

std::vector<bool> solve(int dep, std::vector<std::pair<int, int>> paths) {
	if (dep > n) return {};
	int x = dfn[n - dep + 1], m = paths.size();
	std::vector<bool> rev(m, 0);
	std::vector<int> depend(m, -1);
	std::vector<std::pair<int, int>> nxt;
	int A = -1, B = -1;
	for (int i = 0; i < m; ++i) {
		if ((paths[i].first == x) ^ (paths[i].second == x))	(~A ? B : A) = i;
		if (B != -1) {
			if (paths[A].first == x)
				rev[A] = !rev[A], std::swap(paths[A].first, paths[A].second);
			if (paths[B].second == x)
				rev[B] = !rev[B], std::swap(paths[B].first, paths[B].second);
			int y = paths[A].first, z = paths[B].second, l = lca[y][z], L = lca[l][x];
			for (int i = x; i != L; i = f[i]) cnt[i] -= 2;
			for (int i = l; i != L; i = f[i]) cnt[i] -= 2;
			depend[A] = depend[B] = nxt.size();
			nxt.emplace_back(y, z);
			A = B = -1;
		}
	}
	for (int i = 0; i < m; ++i) {
		if (depend[i] == -1 && paths[i].first != paths[i].second) {
			auto p = paths[i];
			if (p.first == x) p.first = f[x];
			if (p.second == x) p.second = f[x];
			depend[i] = nxt.size();
			nxt.emplace_back(p);
		}
	}
	auto ret = solve(dep + 1, nxt);
	std::vector<bool> ans(m, 0);
	for (int i = 0; i < m; ++i) {
		if (depend[i] != -1) ans[i] = ret[depend[i]];
		if (rev[i]) ans[i] = !ans[i];
	}
	return ans;
}

int main() {
	std::ios::sync_with_stdio(0), std::cin.tie(0);
	std::cin >> n >> m;
	for (int i = 1, x, y; i < n; ++i)
		std::cin >> x >> y, link(x, y);
	dfs0(1), dep[0] = 0x3f3f3f3f;
	for (int i = 1; i <= n; ++i) dfs1(i, i);
	std::vector<std::pair<int, int>> paths;
	for (int i = 0; i < m; ++i) {
		int x, y, l;
		std::cin >> x >> y, l = lca[x][y];
		for (int i = x; i != l; i = f[i]) ++cnt[i];
		for (int i = y; i != l; i = f[i]) ++cnt[i];
		paths.emplace_back(x, y);
	}
	int ans = 0;
	for (int i = 2; i <= n; ++i)
		ans += std::min(2, cnt[i]);
	auto ret = solve(1, paths);
	for (int i = 0; i < m; ++i) if (ret[i]) std::swap(paths[i].first, paths[i].second);
	std::cout << ans << '\n';
	for (auto i : paths) std::cout << i.first << ' ' << i.second << '\n';
	return 0;
}

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

int main() {
  int N;
  cin >> N;
  int copy = N;
  int f_N = 0;
  for (int i = 0; i < 9; i++) {
    f_N = f_N + copy % 10;
    copy = copy / 10;
  }
  if (N % f_N == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


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

int main()
{
    int a = 1, b = 1, c = 0, n;
    cin >> n;
    if ( n == 0 || n == 1 ) { cout << a << endl; return 0;}
    else while( n > 1 ) {
        c = a + b;
        a = b;
        b = c;
        n--;
    }
    cout << c << endl;

    return 0;
}



Measured memory_bytes: 3116
#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>

//for
#define REP(i,n) for(int i=0,i##_len=(int)(n);i<i##_len;i++)
#define REPS(i,n) for(int i=1,i##_len=(int)(n);i<=i##_len;i++)
#define RREP(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define RREPS(i,n) for(int i=(int)(n);i>0;i--)
#define FOR(i,s,n) for(int i=(int)(s),i##_len=(int)(n);i<i##_len;i++)

//printf
#define PRINTD(d) printf("%d\n",(d))
#define PRINTL(d) printf("%lld\n",(d))

//memset
#define m0(s) memset(s,0,sizeof(s))
#define ml(s) memset(s,63,sizeof(s))
#define fill(s,c) memset(s,c,sizeof(s))

#define INF 1e9

typedef long long ll;
int diff[4][2] = {
	{ 0, -1 },
	{ -1, 0 },
	{ 1, 0 },
	{ 0, 1 },
};

int Min(int a, int b) {
	return (a)<(b) ? (a) : (b);
}
int Max(int a, int b) {
	return (a) > (b) ? (a) : (b);
}
void Swap(int *a, int *b) {
	int tmp = *a;
	*a = *b;
	*b = tmp;
}

int sol(int b, int p) {

}

int main() {
	int x;
	scanf("%d", &x);
	int max = 0;
	REP(b, 34) {
		FOR(p, 2, 11) {
			int tmp = b;
			REP(i, p-1) {
				tmp *= b;
			}
			if (max < tmp&&tmp <= x)max = tmp;
		}
	}
	PRINTD(max);

}

Measured memory_bytes: 128
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class Main {

	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskX {
		public void solve(int testNumber, InputReader in, PrintWriter out) {

			int n = in.nextInt();
			int a = in.nextInt();

			String str = ((n % 500) - a <= 0) ? "Yes" : "No";
			out.println(str);

		}

	}

	static class ArrayUtils {
		public static Map<Integer, Integer> getCountMap(int[] array) {
			Map<Integer, Integer> map = new TreeMap<>();
			for (int x : array)
				map.merge(x, 1, Integer::sum);
			return map;
		}

	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}

	}

}


Measured memory_bytes: 21332
package main

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

func main() {
	var sc = bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	n := nextInt(sc)

	var a []int
	for i := 0; i < n; i++ {
		a = append(a, nextInt(sc))
	}
	var minusCount int
	for _, ai := range a {
		if ai < 0 {
			minusCount++
		}
	}
	var answer int64
	if minusCount%2 == 0 {
		for _, ai := range a {
			answer += int64(abs(ai))
		}
	} else {
		s := make([]int, 0, len(a))
		for _, ai := range a {
			s = append(s, abs(ai))
		}
		sort.Ints(s)
		answer = int64(s[0] * -1)
		for _, si := range s[1:] {
			answer += int64(abs(si))
		}
	}
	fmt.Println(answer)
}

func abs(n int) int {
	if n > 0 {
		return n
	} else {
		return n * -1
	}
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}


Measured memory_bytes: 6016
/********************************
*** ******** ********** *********
*** * ****** ********* * ********
*** ** ***** ******** *** *******
*** *** **** ******* ***** ******
*** **** *** ****** ******* *****
*** ***** ** ***** +++++++++ ****
*** ****** * **** *********** ***
*** *******  *** ************* **
*** ******** ** *************** *
**********_**********************
* |   /  / \  \     /    /\     *
* |  /  |   |  \   /    /  \    *
* | /   |   |   \ /    /    \   *
* |+\   |   |    |    /______\  *
* |  \  |   |    |   |        | *
* |   \  \_/     |   |        | *
********************************/
#include<bits/stdc++.h>
#define lli long long int
#define MOD 1000000007
#define KING 1000000002
#define queen 1000002
#define fi first
#define se second
#define se second
#define lsb(i) (i & -i)
#define Pi 3.141592653589793238
#define nl cout<<'\n'
#define TEST cout<<"TEST",nl
#define all(a) a.begin(), a.end()
#define remax(a, b) (a = ((a<b) ? b : a))
#define remin(a, b) (a = ((a<b) ? a : b))
#define pr pair<lli,lli>
#define pb push_back
#define eb emplace_back
#define precise(a) cout<<fixed<<setprecision(a)
#define mp make_pair
#define vi vector<lli>
#define vpi vector<pr> 
#define P pair<lli,pr>
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL)
#define NA(i,s,n) for(lli i=s;i<n;i++)
using namespace std;

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

const lli N = 1e5 + 1;
lli a[N][3], dp[N][3], n;

lli fun(lli pos, lli prev){
    if(pos>=n) return 0;
    if(prev!=-1 && dp[pos][prev]!=-1) return dp[pos][prev];
    lli res = 0;
    NA(i,0,3) if(prev!=i) remax(res, a[pos][i] + fun(pos+1, i));
    if(prev!=-1) return dp[pos][prev] = res;
    return res;
}
void solve(){
    cin >> n;
    memset(dp, -1, sizeof dp);
    NA(i,0,n) NA(j,0,3) cin >> a[i][j];
    cout << fun(0,-1);
    return;
}
int main(){
    fastIO;
    lli t = 1;
    // cin>>t;
    NA(i,0,t){
        solve();
    }
    return 0;

}


Measured memory_bytes: 12800
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        Queue<Long> q = new PriorityQueue<>(Collections.reverseOrder());
        for (int i = 0; i < n; i++) {
            long num = Long.parseLong(sc.next());
            q.add(num);
        }
        for (int i = 0; i < m; i++) {
            q.add(q.poll() / 2);
        }
        long ans = 0;
        for (long l : q) {
            ans += l;
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 49880
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
#define  st first
#define  nd second
#define int long long

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef cc_hash_table<int, int, hash<int > > ht;
#define TIMES_PER_SEC (CLOCKS_PER_SEC)


double get_absolute_time()
{
	return (double)clock()/TIMES_PER_SEC;
}
double starttime_acrush;
void starttime()
{
	starttime_acrush=get_absolute_time();
}
double gettime()
{
	return get_absolute_time()-starttime_acrush;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define M   1000000007
const int N = 10001;  // limit for array size
const int MAX = 1000001;


bool v[MAX];
int len, sp[MAX];
void pre() {



	for (int i = 2; i < MAX; i += 2)	sp[i] = 2;//even numbers have smallest prime factor 2
	for (int i = 3; i < MAX; i += 2){
		if (!v[i]){
			sp[i] = i;
			for (int j = i; (j*i) < MAX; j += 2){
				if (!v[j*i])	v[j*i] = true, sp[j*i] = i;
			}
		}
	}

}
ht ma ;
void factorize(int k) {
	ht ans;
	while(k>1) {
		ans[sp[k]]+=1;
		if(ans[sp[k]]>ma[sp[k]])
            ma[sp[k]] = ans[sp[k]] ;
		k/=sp[k];
	}

}
int modular_pow(int  base, int exponent, int modulus=M)
{
    int result = 1;
    while (exponent > 0)
    {
        if (exponent % 2 == 1)
            result = (result * base) % modulus;
        exponent = exponent >> 1;
        base = (base * base) % modulus;
    }
    return result;
}
int32_t main(){

  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  int n ;
  pre();
  cin >> n ;
  int a[n];
  for ( int i = 0 ; i < n ; i++ ) {
    cin >> a[i] ;
  }
  vector < ht > v(n);
  for ( int i = 0 ; i< n ; i++){
    factorize(a[i]);
  }
  int lcm = 1 ;
  for( auto j : ma ) {
    lcm = ( lcm * modular_pow(j.st,j.nd) )%M;
  }
  //dbg(lcm);
  int ans = 0 ;
  for ( int i = 0 ; i < n ; i++){
    int x = lcm * modular_pow(a[i],M-2);
    x%=M;
    ans = ans + x ;
    ans%=M;
  }
  cout << ans;
}



Measured memory_bytes: 11520
#include <iostream>
#include <set>
#include <stdio.h>

using namespace std;

int main()
{
    int queryNum;
    scanf("%d", &queryNum);

    set<int> S;

    int query, num;
    for (int i = 0; i < queryNum; i++)
    {
        scanf("%d", &query);
        switch (query) {
        case 0:
            scanf("%d", &num);
            S.insert(num);
            printf("%d\n", S.size());
            break;
        case 1:
            scanf("%d", &num);
            printf("%d\n",S.count(num) );
        default:
            break;
        }
    }
    return 0;
}



Measured memory_bytes: 12488
program gluttony
    implicit none
    integer(8):: n,i
    integer(8), allocatable:: a(:), f(:)
    integer(8):: k, ans

    read*, n, k
    allocate(a(n), f(n))
    read*, a(:)
    read*, f(:)
    call merge_sort(a(:), 1_8, n)
    call merge_sort(f(:), 1_8, n)
    f(:) = [(f(i), i=n,1_8,-1_8)]

    block
        integer(8):: l=-1, r=1000000000000_8, c
        do while(l+1_8 < r)
            ans = 0_8
            c = (l+r)/2
            do i=1_8, n
                ans = ans + max(0_8, a(i) - c/f(i))
            end do
            if (ans <= k) then
                r = c
            else
                l = c
            end if
        end do
        print*, r
    end block

    contains
    recursive subroutine merge_sort(ar,start,end)
        integer(8):: ar(:), start, end

        if (end-start < 2_8) then
            if (ar(start) > ar(end)) then
            block; integer(8):: tmp
                tmp = ar(start)
                ar(start) = ar(end)
                ar(end) = tmp
            end block; end if
            return
        end if

        block
            integer(8):: c
            c = (start+end)/2_8
            call merge_sort(ar(:), start, c)
            call merge_sort(ar(:), c+1_8, end)
            call merge(ar(:), start, c, end)
        end block
    end subroutine

    subroutine merge(ar, start, c, end)
        integer(8):: ar(:), start, c, end
        integer(8),pointer:: tmp(:)
        allocate(tmp(end-start+1))

        block
            integer(8):: l,r,ti
            l=start
            r=c+1_8
            ti=1_8
            do while(l <= c .and. r <= end)
                if (ar(l) <= ar(r)) then
                    tmp(ti) = ar(l)
                    l=l+1_8
                else
                    tmp(ti) = ar(r)
                    r=r+1_8
                end if
                ti=ti+1_8
            end do

            if (r > end) then
                tmp(ti:) = ar(l:c)
            else
                tmp(ti:) = ar(r:end)
            end if
        end block

        ar(start:end) = tmp(:)
        deallocate(tmp)
    end subroutine
end program gluttony

Measured memory_bytes: 6180
#include<bits/stdc++.h>
#define int long long
using namespace std;
void solve() {
    string s;
    cin>>s;
    int sum=0;
    for(auto i:s)
    {
        sum+=i-'0';
    }
    if(sum%9==0) cout<<"Yes";
    else cout<<"No";
}
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int t=1;
    //cin>>t;
    while(t--){
        solve();
    }
}

Measured memory_bytes: 3776
#include <bits/stdc++.h>
#define lli long long int
using namespace std;
#define MOD 1000000007
#define mod 1000000037
#define mod1 998244353
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
#define INF 2*1e9

int main()
{
    int r;
    cin >> r;
    cout <<fixed << setprecision(5) << 6.283*r  << endl;
}

Measured memory_bytes: 3788
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using static System.Console;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;
//using System.Numerics;
//using static System.Math;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 };
    readonly int mod = 1000000007;
    readonly string alfa = "abcdefghijklmnopqrstuvwxyz";
    readonly string ALFA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

    int N, M;
    void solve()
    {
        N = cin.nextint;
        var D = cin.scanint;
        Array.Sort(D);
        M = cin.nextint;
        var T = cin.scanint;
        Array.Sort(T);

        int now = 0;
        for (int i = 0; i < M; i++)
        {
            while (true)
            {
                if (now == N || D[now] > T[i])
                {
                    WriteLine("NO");
                    return;
                }
                if (D[now] == T[i])
                {
                    now++;
                    break;
                }
                else
                {
                    now++;
                }
            }
        }
        WriteLine("YES");
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}


Measured memory_bytes: 36416
#include <iostream>
#include <string>
#include <algorithm>    
#include <cmath>
#include <map>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <set>
#include <functional>
#define int long long
#define mod(int)(1000000007)
using namespace std;
const int INF = 1000000000000;
int cnt[345678];
signed main() {
	int n, a, b, c, q, k, x, y, ans = 0; cin >> n;
	vector<vector<int> > G(213456), D(213456);
	for (int h = 1; h < n; h++) {
		cin >> a >> b >> c;
		G[a].push_back(b); G[b].push_back(a);
		D[a].push_back(c); D[b].push_back(c);
	}
	cin >> q >> k;
	queue<int> que, mae, cont;
	for (int i = 0; i < G[k].size(); i++) {
		que.push(G[k][i]); mae.push(k); cont.push(D[k][i]);
		cnt[G[k][i]] = D[k][i];
	}
	while (que.size()) {
		for (int i = 0; i < G[que.front()].size(); i++) {
			if (G[que.front()][i] != mae.front()) {
				que.push(G[que.front()][i]); mae.push(que.front());
				cont.push(cont.front() + D[que.front()][i]);
				cnt[G[que.front()][i]] = cont.front() + D[que.front()][i];
			}
		}
		que.pop(); mae.pop(); cont.pop();
	}
	for (int h = 0; h < q; h++) {
		cin >> x >> y;
		cout << cnt[x] + cnt[y] << endl;
	}
}

Measured memory_bytes: 22376
//Author ::  ABHINAV3010 ::

#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define fast ios_base::sync_with_stdio(false)
typedef long long ll;
typedef pair<ll,ll> p;
ll mod=1000000007;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
ll power(ll x, ll y, ll p=mod)
{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;}
void primefact(ll n,map<ll,ll>&m)
{
    ll cnt=0;
    while(n%2==0)
    {
        n=n/2;
        cnt++;
    }
    if(cnt>0)
    {
        m[2]=max(m[2],cnt);
    }
    for(ll i=3;i*i<=n;i+=2)
    {
        cnt=0;
        while(n%i==0)
        {
            n=n/i;
            cnt++;
        }
        if(cnt>0)
        {
            m[i]=max(m[i],cnt);
        }
    }
    if(n>2)
    {
        m[n]=max(m[n],1ll);
    }
}
ll LCM(ll n, vector<ll>&v)
{
    map<ll,ll>m;
    for(ll i=0;i<n;i++)
    {
        primefact(v[i],m);
    }
    ll lcm=1;
    for(auto it:m)
    {
        ll x=it.fi;
        ll y=it.se;
        lcm=(lcm*power(x,y))%mod;

    }
    return lcm;
}
int main()
{
fast;
ll n;
cin>>n;
vector<ll>v;
for(ll i=0;i<n;i++)
{
    ll a;
    cin>>a;
    v.pb(a);
}


ll lcm3=LCM(n,v);

ll ans=0;


for(ll i=0;i<n;i++)
{
    ll x=power(v[i],mod-2);

    ll z=(lcm3*x)%mod;

    ans=(ans+z)%mod;
    //ans2=(ans2+zz)%mod;
}
cout<<ans<<endl;

return 0;
}


Measured memory_bytes: 1024
#include <iostream>
using namespace std;
int main() {
    int n, i, a[100000];
    cin >> n;
    for ( i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    int max=a[0], min=a[0];
    long long int suma=0;
    for ( i = 0; i < n; i++)
    {
        if (a[i]>max)
        {
            max=a[i];
        }
        if (a[i]<min)
        {
            min=a[i];
        }
        suma+=a[i];
        
    }
    


    cout << min << " " << max << " " << suma << endl;
    

    
	return 0;
}


Measured memory_bytes: 3136
#include<bits/stdc++.h>
using namespace std;
int main(){
int N,Q;
cin>>N>>Q;
string S;
cin>>S;
int count=0;
vector<int> q,ans;
q.push_back(count);

for(int i=0;i<N-1;i++){
	if(S[i]=='A'&&S[i+1]=='C'){
		count++;
	}
	q.push_back(count);
}
for(int i=0;i<Q;i++){
	int l,r;
	cin>>l>>r;
	ans.push_back(q[r-1]-q[l-1]);
}
for(int i=0;i<Q;i++){
	printf("%d\n",ans[i]);
}
return 0;
}

Measured memory_bytes: 1976
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n;cin>>n;
  vector<int>d(n);
  int ans=0;
  for(int i=0;i<n;i++)cin>>d[i];
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      ans+=d[i]*d[j];
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ls rt<<1
#define rs rt<<1|1
#define lson rt<<1,l,M
#define rson rt<<1|1,M+1,r
#define PI acos(-1)
#define MM int M=(l+r)>>1;
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define fh(i,be,e) for(int i=head[be];~i;i=e[i].next)
#define fa(i,V) for(auto i:V)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'
#define lcm(a,b) (a*b)/__gcd(a,b)
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout<<setprecision(i)<<fixed<<ans<<endl;
#define ppb pop_back
#define ppf pop_front
#define pb push_back
#define pf push_front
#define pq priority_queue
#define lowbit(x) (x)&(-x)
#define all(V) V.begin(),V.end()
#define ms multiset
#define mod(x) ((x+mo_num)%mo_num)
#define vc vector
#define vct vector<int>
#define out(i) cout<<(i)<<endl;
#define fi first
#define se second
#define fun(i) fu(i,1,n)
#define fut(i) fu(i,1,t)
#define fum(i) fu(i,1,m)
#define ld long double
#define umap unordered_map
#define P pair<int,int>
#define SET set<int>
#define mp map<int,int>
#define mk make_tuple
#define got(container,num) get<num-1>(container)
#define low lower_bound
#define upp upper_bound
#define yn(key) out(key?"Yes":"No")
#define in(i) i+1,i+1+n
#define im(i) i+1,i+1+m
using namespace std;
const int INF=LLONG_MAX-1e10;
const int maxn=1e6+1e5;
const int mo_num=1e9+7;
int n,m,a[maxn],b[maxn],ans;
main()
{
    IOS
    int k;
    cin>>n>>m>>k;
    if(k-n-m<=0)out("No")
    else{
        int nn=k-n-m;
        yn(nn*nn>n*m*4)
    }
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
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;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

int main() {
    int n;
    cin >> n;
    vl a(n);
    map<ll, set<int>> cnt;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        cnt[a[i]].insert(i);
    }
    vl ret(n, 0);
    ll size = cnt.rbegin()->second.size();
    while (true) {
        auto p = cnt.rbegin();
        auto pm = next(p);
        if (pm == cnt.rend())
            break;
        ret[*(p->second.begin())] += (p->first - pm->first) * size;
        size += pm->second.size();
        pm->second.insert(*(p->second.begin()));
        cnt.erase(p->first);
    }
    auto p = cnt.rbegin();
    ret[*(p->second.begin())] += (p->first - 0) * size;

    for (auto &r : ret) {
        cout << r << "\n";
    }
    return 0;
}

Measured memory_bytes: 16640
def lcs(x, y)
  c = Array.new(y.length + 1, 0)
  x.each_char do |xi|
    tmp = c.dup
    y.each_char.with_index do |y, ji|
      j = ji + 1
      if xi == y
        c[j] = tmp[j - 1] + 1
      elsif c[j] < c[j - 1]
        c[j] = c[j - 1]
      end
    end
  end
  c[-1] - 1
end


n = gets.chomp.to_i

n.times.each do |i|
  x = gets
  y = gets
  puts lcs(x, y)
end

Measured memory_bytes: 9260
#include<iostream>
#include<algorithm>
#include<vector>
#include<string.h>
#include<cstdlib>
#include<map>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<random>
#include<set>
#include<queue>

using namespace std;

long long dp[3][100100] = {};
const long long INF = 1LL << 60;
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define dump(a) cout << a << endl; 

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

/**
* @fn
* 最大値を取ります.Vector<int>を渡すこと.
*/
long long int imax(vector<int> a) {
	int MAX = -10000000;
	for (int i = 0; i < a.size(); i++) {
		if (MAX < a.at(i)) MAX = a.at(i);
	}
	return MAX;
}

/**
* @fn
* 最小値を取ります.Vector<int>を渡すこと.
*/
long long int imin(vector<int> a) {
	int MIN = 1000000000;
	for (int i = 0; i < a.size(); i++) {
		if (MIN > a.at(i)) MIN = a.at(i);
	}
	return MIN;
}

/**
* @fn
* 自然数について、桁数を求める
*/
Int getDigit(Int num) {
	return (Int)(log10(num)) + 1;
}


int get2Digit(Int num) {
	int cnt = 0;
	while (num > 0) {
		if (num % 2 != 0) {
			return cnt;
		}
		cnt++;
		num /= 2;
	}
}

long long int absmin(vector<int> a, long long int b) {
	int mini = 100000000;
	int d = 0;
	for (int i = 0; i < a.size(); i++) {
		if (mini > abs(a.at(i) - b)) {
			mini = abs(a.at(i) - b);
			d = i;
		}
	}
	return d;
}


long long int absmax(vector<int> a, long long int b) {
	int max = -100000000;
	int d = 0;
	for (int i = 0; i < a.size(); i++) {
		if (max < abs(a.at(i) - b)) {
			max = abs(a.at(i) - b);
			d = i;
		}
	}
	return d;
}

int gcd(int a, int b)
{
	if (a < b) swap(a, b);
	if (b < 1) return -1;
	if (a % b == 0) return b;
	return gcd(b, a % b);
}

void haerobatya(int start, int end, char level) {
	if (start > end) swap(start, end);
	for (int i = start; i <= end; i++) {
		if (i < 100) {
			cout << "https://atcoder.jp/contests/abc0" << i << "/tasks/abc0" << i << "_" << level << endl;
		}
		else {
			cout << "https://atcoder.jp/contests/abc" << i << "/tasks/abc" << i << "_" << level << endl;
		}
	}
}

long long int cntmod(long long int warareru, long long int mod) {
	long long int i = 0;
	for (i = 0; true; i++) {
		if (warareru % mod == 0 && warareru >= mod) {
			warareru /= mod;
		}
		else {
			return i;
		}
	}
}

void ansYes(bool a) {
	if (a == true) cout << "Yes" << endl;
	else cout << "No" << endl;
}

void ansYES(bool a) {
	if (a == true) cout << "YES" << endl;
	else cout << "NO" << endl;
}


Int euclidean_gcd(Int a, Int b) {
	while (true) {
		if (a < b) swap(a, b);
		if (!b) break;
		a %= b;
	}
	return a;
}

typedef pair<int, int> pai;


//ここまでライブラリ
//ここから本文

int main() {
	int a, b;
	cin >> a >> b;
	if (8 < a || 8 < b) dump(":(") else dump("Yay!");
}


Measured memory_bytes: 256
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(z) = it.next() {
            Some(it.fold(z, |x, y| min!(x, y)))
        } else {
            None
        }
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(z) = it.next() {
            Some(it.fold(z, |x, y| max!(x, y)))
        } else {
            None
        }
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}


macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let n: usize = sc.cin();
    let xs: Vec<i32> = (0..n).map(|_| sc.cin()).collect();
    put!((-100..101).map(|a|xs.iter().map(|&x|(x+a)*(x+a)).sum::<i32>()).min().unwrap())
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const long long INF = 1e10;
const long long MOD = 1e9+7;
using Graph = vector<vector<ll>>;
using pll = pair<ll, ll>;
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;}
ll ceilll(ll a, ll b) {return (a + b-1) / b;} // if(a%b == 0) (a/b) + 1
ll get_digit(ll a) {ll digit = 0; while(a != 0){a /= 10; digit++;} return digit;} // a != 0
template<typename T> void vecdbg(vector<T>& v){ rep(i, v.size()){cout << v[i] << " ";} br;}
template<typename T> void vecvecdbg(vector<vector<T>>& v){ rep(i, v.size()){rep(j, v[i].size()){cout << v[i][j] << " ";} br;}}

// 0 false, 1 true 
// string number to int : -48
// a to A : -32
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp
// global vector -> 0 initialization

int main() {
    std::cout << std::fixed << std::setprecision(15);
    ll n; cin >> n;
    vector<long long> vec(n);
    for(long long i = 0; i < n; i ++){
        cin >> vec[i];
    }
    sort(all(vec));
    ll ans = INF;
    for(ll i = vec[0]; i <= vec[n-1]; i++){
        ll tmp = 0;
        for(ll j = 0; j < n; j++){
            tmp += ((i - vec[j]) * (i - vec[j]));
        }
        ans = min(ans, tmp);
    }
    cout << ans << endl;
}

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

//C++14 (GCC 5.4.1)

#define LLINF (1LL<<60)
typedef long long ll;
#define mod 1000000007

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define rrepd(i,a,b) for(int i=(a);i>=(b);i--)

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

template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); }

#define dbg_v1(i,V) do{cout<<"-v1----\n";rep(i,V.size())cout<<" "<<i<<"\t:"<<V[i]<<endl;cout<<endl;}while(0)
#define dbg_v2(i,k,V) do{cout<<"-v2----\n";rep(i,V.size()){rep(k,V[0].size())cout<<" "<<V[i][k];cout<<endl;}}while(0)
#define lower_bound_idx(V,c) distance(V.begin(),lower_bound(V.begin(),V.end(),c))

int main() {
    ios::sync_with_stdio(false);//stdoutとcoutの同期解除
    cin.tie(nullptr);//cinとcoutの同期解除
    
    int X[2];
    cin >>X[0]>>X[1];
    ll ans=0;
    rep(i,2){
        if(X[i]==3)ans+=100000;
        else if(X[i]==2)ans+=200000;
        else if(X[i]==1)ans+=300000;
    }
    if(X[0]==1&&X[1]==1)ans+=400000;
   cout << ans <<endl;
    return (0);
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stack>
#include<stdlib.h>
using namespace std;
int MAX = 7;

int main() {
  char input[MAX];
  stack<int> operand;

  while ( scanf("%s", input) != EOF ) {
    int a,b;
    if (input[0] == '*') {
      a = operand.top();
      operand.pop();
      b = operand.top();
      operand.pop();
      operand.push(b*a);
    } else if (input[0] == '+') {
      a = operand.top();
      operand.pop();
      b = operand.top();
      operand.pop();
      operand.push(b+a);
    } else if (input[0] == '-') {
      a = operand.top();
      operand.pop();
      b = operand.top();
      operand.pop();
      operand.push(b-a);
    } else {
      operand.push(atoi(input));
    }
    if (getchar() == '\n') break;
  }

  printf("%d\n", operand.top());

  return 0;
}



Measured memory_bytes: 2720