akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;a++)
#define rl(a,b,c) for(int a=b;a>=c;a--)
#define niv vector<int>
#define LL long long
#define IT iterator
#define PB(a) push_back(a)
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<LL,LL> mp;
typedef pair<mp,mp> superpair;
LL val[2][100005];
LL dp[2][2][100005];
LL _max[2][2][100005];
LL res=-1;
int main(){
	ios::sync_with_stdio(false);
	int n;
	LL c;
	LL res;
	mp a[100001];
	cin>>n;
	cin>>c;
	LL finalc=c;c=0;
	rb(i,1,n) cin>>a[i].FIR>>a[i].SEC;
	val[1][0]=c;
	rb(i,1,n) val[1][i]=val[1][i-1]+a[i].SEC;
	val[0][n+1]=c;//cout<<endl;
	rl(i,n,1) val[0][i]=val[0][i+1]+a[i].SEC;
	dp[1][0][0]=c;dp[0][1][0]=c;
	rb(i,1,n){
		dp[1][1][i]=val[1][i]-2*(a[i].FIR);
		dp[1][0][i]=val[1][i]-(a[i].FIR);
//		cout<<"r"<<dp[1][1][i]<<" , "<<dp[1][0][i]<<endl;
	}
	rl(i,n,1){
		if(i==n){
		dp[0][1][i]=val[0][i]-2*(finalc-a[i].FIR);
		dp[0][0][i]=val[0][i]-(finalc-a[i].FIR);	
		}
		else{
		dp[0][1][i]=val[0][i]-2*(finalc-a[i].FIR);
		dp[0][0][i]=val[0][i]-(finalc-a[i].FIR);	
		}
//		cout<<"l"<<dp[0][1][i]<<" , "<<dp[0][0][i]<<endl;
	}
	_max[1][1][0]=0;
	_max[1][0][0]=0;
	_max[0][1][n+1]=0;
	_max[0][0][n+1]=0;
	rb(i,1,n){
		_max[1][1][i]=max(_max[1][1][i-1],dp[1][1][i]);
		_max[1][0][i]=max(_max[1][0][i-1],dp[1][0][i]);
	}
	rl(i,n,1){
		_max[0][1][i]=max(_max[0][1][i+1],dp[0][1][i]);
		_max[0][0][i]=max(_max[0][0][i+1],dp[0][0][i]);
	}
	res=0;
	rl(i,n,0){
		LL res1,res2;
		if(i==n){
			res1=_max[0][0][n];
			res2=_max[0][1][n];	
		}
		if(i==0){
			res1=_max[0][0][0]+_max[1][1][n];
			res2=_max[0][1][0]+_max[1][0][n];
//			cout<<_max[0][1][0]<<" "<<_max[1][0][n-1]<<endl;
		}
		else{
			res1=_max[0][0][i]+_max[1][1][i-1];
			res2=_max[0][1][i]+_max[1][0][i-1];
		}
//		cout<<res1<<" "<<res2<<endl;
		res=max(res,max(res1,res2));
	}
	cout<<res;
	return 0;
}


Measured memory_bytes: 9600
program main 
    integer :: a, b 
    integer :: tmp , count=1

    read(*,*) a, b 
    tmp = b
    do
        tmp=int(tmp/10)
        if(tmp==0) exit 
        count=count+1
    end do

    tmp = a*(10**count)+b 

    if ((int(sqrt(real(tmp,8))))**2.eq.tmp) then
        write(*,*) 'Yes'
    else 
        write(*,*) 'No'
    end if
end program 

Measured memory_bytes: 2928
#include<bits/stdc++.h>
#include<string.h>
 
typedef long long int ll;
#define all(x) (x).begin(), (x).end()
 
using namespace std;

int nxt() {
    int x;
    cin >> x;
    return x;
}

ll nxtl(){
    ll x;
    cin>>x;
    return x;
}
 
void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 
 
ll max(ll a,ll b)
{
    if(a>b)
        return a;
    return b;
}
 
ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n=nxtl();
    ll test=INT_MAX;
    for(ll i=1;i<=sqrt(n);i++)
        if(n%i==0)
        {
            ll a=i;
            ll b=n/i;
            //cout<<a<<" "<<b;
            a=log10(a)+1;
            b=log10(b)+1;
            //cout<<" "<<a<<" "<<b<<endl;
            test=min(test,max(a,b));

        }
    cout<<test<<endl;
    
    
    
    return 0;   
}




 
 


Measured memory_bytes: 512
#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
int main(){
  ll n,k;
  cin >>n;
  ll t[n+1],x[n+1],y[n+1];
  t[0]=0;x[0]=0;y[0]=0;
  for(ll i=1;i<=n;i++) cin >>t[i]>>x[i]>>y[i];
  for(ll i=0;i<n;i++){
    ll s=abs(x[i+1]-x[i])+abs(y[i+1]-y[i]);
    ll k=t[i+1]-t[i]-s;
    if(k<0){
      cout <<"No"<<endl;
      return 0;
    }
    else if(k%2==1){
      cout <<"No"<<endl;
      return 0;
    }
  }
  cout <<"Yes"<<endl;
}


Measured memory_bytes: 2560
import java.util.Scanner;

/**
 * Created by mizuk on 2017/07/26.
 */
public class Main {
    private static int N;
    private static int a[];

    private static int count4 = 0;
    private static int count2 = 0;

    public static void input(){
        Scanner scan = new Scanner(System.in);
        N = scan.nextInt();
        a = new int[N];

        for(int i=0;i<N;i++) {
            a[i] = scan.nextInt();
            if(a[i] % 4 == 0) count4++;  //4の倍数の個数をカウント
            else if(a[i] % 2 == 0) count2++;   //2の倍数をカウント
        }
    }

    public static void main(String args[]){
        //入力
        input();

        if(count4 + count2/2 >= N/2) System.out.println("Yes");
        else System.out.println("No");
    }
}

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

class Program {
    static void Main(string[] args) {
        int H, A;
        Input(out H, out A);
        if(H % A == 0) {
            Console.WriteLine(H / A);
        } else {
            Console.WriteLine(H / A + 1);
        }
    }
    static T ChangeT<T>(string s) => (T)Convert.ChangeType(s, typeof(T));
    static void Input<A>(out A a) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
    }
    static void Input<A, B>(out A a, out B b) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
    }
    static void Input<A, B, C>(out A a, out B b, out C c) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
        c = ChangeT<C>(words[2]);
    }
    static void Input<A, B, C, D>(out A a, out B b, out C c, out D d) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
        c = ChangeT<C>(words[2]);
        d = ChangeT<D>(words[3]);
    }
    static void Input<A, B, C, D, E>(out A a, out B b, out C c, out D d, out E e) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
        c = ChangeT<C>(words[2]);
        d = ChangeT<D>(words[3]);
        e = ChangeT<E>(words[4]);
    }
    static void Input<A, B, C, D, E, F>(out A a, out B b, out C c, out D d, out E e, out F f) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
        c = ChangeT<C>(words[2]);
        d = ChangeT<D>(words[3]);
        e = ChangeT<E>(words[4]);
        f = ChangeT<F>(words[5]);
    }
    static void InputArray<T>(out T[] array) {
        array = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries).Select(s => ChangeT<T>(s)).ToArray();
    }
}

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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    int N, Y; cin >> N >> Y;
    rep(i, N+1){
        rep(j, N+1){
            int tmp = Y - i*10000 - j*5000;
            if(tmp < 0) break;
            int k = tmp/1000;
            if(i+j+k == N){
                cout << i << " " << j << " " << k << endl;
                return;
            }
        }
    }
    cout << "-1 -1 -1" << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


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

ll f(ll x) {
    if(x==1) return 1;
    else {
        return 1 + 2 * f(x/2);
    }
}

int main() {
    ios::sync_with_stdio(0);
    ll x;
    cin>>x;
    cout<<f(x)<<endl;
    return 0;
}




Measured memory_bytes: 256
#include<iostream>
using namespace std;
int fast_exp(int x,int p)
{
    int res = 1;
    while(p)
    {
        res = res*x;
        x = x*x;
        p>>=1;
    }
    return res;
}
int main()
{
    int n;
    cin>>n;
    int a[n],b[n],c[n-1];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        a[i]--;
    }
    for(int i=0;i<n;i++)
        cin>>b[i];
    for(int i=0;i<n-1;i++)
        cin>>c[i];
    int ans = 0;
    for(int i=0;i<n;i++)
    {
        if(i==0)
            ans += b[a[i]];
        else
        {
            ans += b[a[i]];
            if(a[i-1]+1 == a[i] && i-1>=0)
                ans += c[a[i-1]];
        }
    }
    cout<<ans<<"\n";
    return 0;
}


Measured memory_bytes: 256
using System;
using System.IO;
using System.Linq;

namespace D
{
	internal class Program
	{
		private static bool[] isPrime;
		private static bool[] isLike2017;
		private static int[] like2017Num; // primeNum[i] は 1--i のうち素数がいくつあるかを表す
		private const int Max = 100000;

		public static void Main(string[] args)
		{
			var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };

			initIsPrime();
			initIsLike2017();
			initLike2017Num();

			var q = int.Parse(Console.ReadLine());
			for (var i = 0; i < q; i++)
			{
				var line = Console.ReadLine().Split().Select(int.Parse).ToArray();
				var lq = line[0];
				var rq = line[1];


				sw.WriteLine(like2017Num[rq] - like2017Num[lq - 1]);
			}

			sw.Flush();
		}

		static void initIsPrime()
		{
			isPrime = new bool[Max + 1];
			for (var i = 0; i <= Max; i++) { isPrime[i] = true; }

			isPrime[0] = isPrime[1] = false;
			for (var i = 2; i <= Max; i++)
			{
				if (isPrime[i])
				{
					for (var j = 2 * i; j <= Max; j += i) { isPrime[j] = false; }
				}
			}
		}

		static void initIsLike2017()
		{
			isLike2017 = new bool[Max + 1];
			for (var i = 0; i * 2 < Max; i++)
			{
				if (!isPrime[i]) { continue; }

				if (isPrime[2 * i - 1]) { isLike2017[2 * i - 1] = true; }
			}
		}

		static void initLike2017Num()
		{
			like2017Num = new int[Max + 1];
			like2017Num[0] = 0;
			for (var i = 1; i < Max; i++) { like2017Num[i] = like2017Num[i - 1] + (isLike2017[i] ? 1 : 0); }
		}
	}
}

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

const int INF = 1e9;

struct edge {
	int from, to;
	int cost;
	edge(int f, int t, int c) : from(f), to(t), cost(c) {}
};

using edges = vector<edge>;
using graph = vector<edges>;

void add_edge(graph& G, int s, int t, int c) {
	G[s].emplace_back(s, t, c);
}

template <typename C, const C inf>
vector<C> bellman_ford(const graph& G, int s) {
	int n = G.size();
	vector<C> d(n, inf);
	d[s] = C();
	bool update;
	for (int i = 0; i < n; i++) {
		update = false;
		for (auto& es : G) {
			for (auto e : es) {
				if (d[e.from] == inf || d[e.to] <= d[e.from] + e.cost) continue;
				d[e.to] = d[e.from] + e.cost;
				update = true;
			}
		}
	}
	return update ? vector<C>() : d;
}

int main()
{
	ios::sync_with_stdio(false), cin.tie(0);
	int V, E, r;
	cin >> V >> E >> r;
	graph G(V);
	for (int i = 0; i < E; i++) {
		int s, t, d;
		cin >> s >> t >> d;
		add_edge(G, s, t, d);
	}
	auto d = bellman_ford<int, INF>(G, r);
	if (d.empty()) {
		puts("NEGATIVE CYCLE");
	}
	else {
		for (int i = 0; i < V; i++) {
			if (d[i] == INF)
				puts("INF");
			else
				printf("%d\n", d[i]);
		}
	}
	return 0;
}

Measured memory_bytes: 3320
#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
  int n=0,i=0,j=0,count1=0,count2=0,s=0;
  char a[100100]={};
  char maru='o',batu='x';
  cin>>n;
  scanf("%s",a);
  for(i=0;i<n;i++){
    if(a[i]==maru){
      count1++;
      count2=0;
      s++;
    }
    if(a[i]==batu){
      count2++;
      count1=0;
      if(count2==2)break;
      s++;
    }
  }
  cout<<s<<endl;
  return 0;
}

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

int main()
{
	long A, B, m, x, t;
	cin >> A >> B;
	x = A * B;
	if (A < B) {
		t = A;
		A = B;
		B = t;
	}

	m = A % B;
	while (m!= 0) {
		A = B;
		B = m;
		m = A % B;
	}
	cout << (x / B);
	return 0;
}

Measured memory_bytes: 256
n = int(input())
pn = list(map(int,input().split()))

count = 0
for i in range(1,n-1):
    if (pn[i] > pn[i-1] and pn[i] < pn[i+1]) or (pn[i] < pn[i-1] and pn[i] > pn[i+1]):
        count += 1
print(count)

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

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

  vector<int> d(n);
  for (int i = 0; i < n; i++) {
    cin >> d.at(i);
  }

  // 累積和
  //
  //   s[0] = 0
  // i=0
  //   s[1] = s[0] + d[0]
  // i=1
  //   s[2] = s[1] + d[1]
  //
  vector<int> s(n+1, 0);
  for (int i = 0; i < n; i++) {
    s.at(i+1) = s.at(i) + d.at(i);
  }

  // i=0
  //   d[0] * (d[1] + d[2] + ... + d[n-1])
  // i=1
  //   d[1] * (d[2] + d[3] + ... + d[n-1])
  // i=n-2
  //   d[n-2] * (d[n-1])
  int ans = 0;
  for (int i = 0; i < n-1; i++) {
    // 累積和から区間の合計を取る
    int dif = s.at(n) - s.at(i+1);
    ans += (d.at(i) * dif);
  }

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

Measured memory_bytes: 3568
N,M=map(int,input().split())
arr = [[0 for i in range(2)] for j in range(N)]
goukei=0
count=0
for i in range(N):
    arr[i][0],arr[i][1]=map(int,input().split())
    
    
k=0    
arr.sort()
while M-count>0:
    goukei+=arr[k][0]
    arr[k][1]-=1
    
    if arr[k][1]==0:
        k+=1
    
    count+=1

print(goukei)


Measured memory_bytes: 21548
#include <iostream>
#include <cstdio>
using namespace std;
#define ll long long

int weight_value[105][2];
ll dp[105][100005];

int main() {
	int N, W;
	scanf("%d%d", &N, &W);
	for (int i = 1; i <= N; ++i) {
		scanf("%d%d", &weight_value[i][0], &weight_value[i][1]);
	}
	for (int i = 1; i <= N; ++i) {
		for (int j = W; j >= 1; --j) {
			if (j >= weight_value[i][0]) {
				dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - weight_value[i][0]] + weight_value[i][1]);
			} else {
				dp[i][j] = dp[i - 1][j];
			}
		}
	}
	printf("%lld", dp[N][W]);
	return 0;
}


Measured memory_bytes: 81896
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, -1, mod)


def main():
    n =int(input())
    a = list(map(int, input().split()))
    x = a[0]
    ans = 0
    for y in a[1:]:
        if x > y:
            ans += x - y
        x = max(x, y)
    print(ans)

main()


Measured memory_bytes: 33692
// #include "frog_1.h"
#include <cmath>
#include <limits>
#include <vector>

#include <iostream>

int min_jump_cost(const std::vector<int>& stones)
{
    std::vector<int> dp(stones.size(), std::numeric_limits<int>::max());
    dp.front() = 0;

    for (size_t i = 0; i < stones.size(); ++i) {
        for (auto dist : {i + 1, i + 2})
            dp[dist] =
                std::min(dp[dist], std::abs(stones[dist] - stones[i]) + dp[i]);
    }
    return dp.back();
}

int main(int argc, char* argv[])
{
    size_t n;
    std::cin >> n;
    std::vector<int> stones(n);
    for (size_t i = 0; i < n; ++i) {
        int height;
        std::cin >> height;
        stones[i] = height;
    }
    std::cout << min_jump_cost(stones) << std::endl;
    return 0;
}


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

int main()
{
    int n;
    string s;
    cin >> n >> s;
    int ans = n;
    for(int i = 0; i < n - 1; i++) if(s[i] == s[i + 1]) ans--;
    cout << ans << endl;
}

Measured memory_bytes: 512
import java.util.*;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		String[] tokens = in.readLine().split(" ");
		double a = Double.parseDouble(tokens[0]);
		double b = Double.parseDouble(tokens[1]);
		double x = Double.parseDouble(tokens[2]);
		double deg = 0.0;
		if (a * a * b / 2 <= x) {
			double remain = (a * a * b - x) / a;
			double rad = Math.atan(2 * remain / (a * a));
			deg = rad / Math.PI * 180.0;
		} else {
			double rad = Math.atan(a * b * b / (2 * x));
			deg = rad / Math.PI * 180.0;
		}
		System.out.println(String.format("%.10f", deg));
	}
}


Measured memory_bytes: 21716
#include <iostream>
#include <cmath>
#include <algorithm>
#include <stdio.h>

using namespace std;

double abs(int x[],int y[],int n){
    int sum=0;
    for(int i=0;i!=n;++i){
        sum+=(x[i]-y[i])>=0?(x[i]-y[i]):(y[i]-x[i]);
    }
    return sum;
}

double manha_2(int x[],int y[],int n){
    int sum=0;
    for(int i=0;i!=n;++i){
        sum+=(x[i]-y[i])*(x[i]-y[i]);
    }
    return std::sqrt(sum);
}

double manha_3(int x[],int y[],int n){
    long long sum=0;
    
    for(int i=0;i!=n;++i){
        int num=(x[i]-y[i])>=0?(x[i]-y[i]):(y[i]-x[i]);
        sum+=num*num*num;
    }
    return std::cbrt(sum);
}

double chebi(int x[],int y[],int n){
    int max=0;
    int num=0;
    for(int i=0;i!=n;++i){
        num=(x[i]-y[i])>=0?(x[i]-y[i]):(y[i]-x[i]);
        if(num>max){
            max=num;
        }
    }
    return max;
}

int main(){
    
    int num;
    
    cin>>num;
    
    int x[num];
    int y[num];
    
    for(int i=0;i!=num;++i){
        cin>>x[i];
    }
    for(int i=0;i!=num;++i){
        cin>>y[i];
    }
    
    printf("%lf\n",abs(x,y,num));
    printf("%lf\n",manha_2(x,y,num));
    printf("%lf\n",manha_3(x,y,num));
    printf("%lf\n",chebi(x,y,num));
    
    
    
    
 
}



Measured memory_bytes: 3344
#include<bits/stdc++.h>
#define MOD 1000000007
#define line "\n"
#define loop(i,a,n) for(ll i=a;i<n;i++)
#define ll long long int
#define lb long double
#define ull unsigned long long int
#define pb push_back
#define vi vector < int >
# define vs vector < string >
# define vb vector < bool >
#define vll vector<ll>
# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >
#define vpii vector<pair<int,int>>
#define vpsi vector<pair<string,int>>
#define mii map<int ,int>
#define mis map<int,string>
#define all(v) v.begin(),v.end()


# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);
using namespace std;

void solve()
{ 
ll n;
cin>>n;
vll v(n);
ll count=0;
ll front=0;
loop(i,0,n)
{
    cin>>v[i];
    if(i==0){front=v[i];continue;}
    if(v[i]>front)front=v[i];
   else {count+=front-v[i];}

}
cout<<count<<line;

}



int main()
{fast
// #ifndef ONLINE_JUDGE
//  freopen("input.txt","r",stdin);
//  freopen("output.txt","w",stdout);
//  #endif
// ll t;
// cin>>t;
// while(t--)

{
solve();
}

}



Measured memory_bytes: 4688
#def main(S, b):

if __name__ == '__main__':
    s = input()
    flag = 1
    while (len(s) > 0):
        if (s[:2] == "hi"):
            s = s[2:]
        else:
            flag = 0
            s = ""
    if (flag):
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 2940
<?php

fscanf(STDIN, '%d', $n);
$t = trim(fgets(STDIN));
$t_array = explode(' ', $t);
fscanf(STDIN, '%d', $m);
for ($i = 1; $i <= $m; $i++) {
    fscanf(STDIN, '%d%d', $p_array[], $x_array[]);
}

for ($i = 0; $i < $m; $i++) {
    $sum = 0;
    for ($j = 0; $j < $n; $j++) {
        if ($j == $p_array[$i] - 1) {
            $sum += $x_array[$i];
        } else {
            $sum += $t_array[$j];
        }
    }
    echo $sum ."\n";
}


Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	string s;
	cin>>s;
	int d=0;
	if(n%2==1)cout<<"No"<<endl;
	else{
		for(int i=0;i<n/2;i++){
			if(s[i]!=s[i+(n/2)])d=1;
		}
		if(d==0)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string>
  
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)
typedef long long ll;

const ll MOD=1000000007ll;
const int MAX=5100000;

using namespace std;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

ll fact[MAX], fact_inv[MAX];

ll power(ll a, ll b){
	ll res=1;
	while(b>0){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}

// nCr
ll comb(ll n, ll r){
	ll t=1000000;
	fact[0]=1;
	REP(i, t) fact[i+1]=fact[i]*(i+1)%MOD;
	fact_inv[t]=power(fact[t], MOD-2);
	FORR(i, 0, t) fact_inv[i]=fact_inv[i+1]*(i+1)%MOD;
	return (fact[n]*fact_inv[r])%MOD*fact_inv[n-r]%MOD;
}
  
int main()
{
    int i,tmp,b,c;
  ll N; cin >> N;
  ll ans = 0;
  map <int,int>A;
  rep(i,N){cin >> tmp; A[tmp]++; ans += tmp;}
  int Q; cin >> Q;
  rep(i,Q){
      cin >> b >> c;
      auto itr = A.find(b);
      if(itr != A.end()){
          ans += (int)(itr -> second) * (c - b);
          A[c] += A[b];
          A[b] = 0;
          cout << ans << endl;
      }
      else{
          cout << ans << endl;
      }
  }

  return 0;
}


Measured memory_bytes: 7440
#include <iostream>
using namespace std;
int main()
{
    string s,t;cin>>s>>t;
    if(s==t) cout<<"Yes";
    else{
            char tmp,change;
            int l=0;
            for(int j=0;j<s.size();j++){
            tmp=s[s.size()-1];
            for(int i=s.size()-1;i>0;i--){
                    change=s[i];
                    s[i]=s[i-1];
                    s[i-1]=change;
            }
            s[0]=tmp;
            if(s==t){cout<<"Yes";break;l=1;}
            }
            if(s!=t){
                cout<<"No";
            }
    }
    return 0;
}


Measured memory_bytes: 256
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout

	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
		if len(os.Args) > 2 {
			wfp, _ = os.Create(os.Args[2])
		}
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)

	n := getNextInt64(scanner)

	var ans int64
	ans = math.MaxInt64
	for i := int64(1); i*i <= n; i++ {
		if n%i != 0 {
			continue
		}
		if ans > i+n/i {
			ans = i + n/i
		}
	}
	fmt.Fprintln(writer, ans-2)
	writer.Flush()
}


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

using namespace std;
using ll =long long;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int,int> PII;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << 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; }
//Write From this Line

int main()
{
	int n;
	cin >> n;
	string ans;
	n %= 10;
	if(n == 0) ans = "pon";
	if(n == 1) ans = "pon";
	if(n == 6) ans = "pon";
	if(n == 8) ans = "pon";
	if(n == 3) ans = "bon";
	if(n == 2) ans = "hon";
	if(n == 4) ans = "hon";
	if(n == 5) ans = "hon";
	if(n == 7) ans = "hon";
	if(n == 9) ans = "hon";
	cout << ans << endl;
}


Measured memory_bytes: 3616
N, S = map(int, input().split())
mod = 998244353
A = list(map(int, input().split()))
L = [0 for _ in range(S+1)]
p = 0
F = {0}
for i in range(N):
    L[0] += 1
    X = [[j, L[j]] for j in F]
    for j in X:
        if j[0] + A[i] <= S:
            L[j[0]+A[i]] += j[1]
            L[j[0]+A[i]] %= mod
            F.add(j[0]+A[i])
    p += L[S]
    p %= mod

print(p)

Measured memory_bytes: 114196
fun main(args: Array<String>) {
    var tmpLine = readLine()
    var tmps = tmpLine!!.split("\\s+".toRegex())
    var x = tmps[0].toInt() 
    var y = tmps[1].toInt() 

    println(tsurukame(x, y))
}

fun tsurukame(x: Int, y: Int) : String {
    var result = "No"

    for (i in 0..x) {
        var kame = i 
        var tsuru = x - kame

        var legs = tsuru * 2 + kame * 4
        if (legs > y ) return "No"
        if (legs == y) return "Yes"
    }

    return result
}

Measured memory_bytes: 35300
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)

// functions
int ceil(int a, int b) {
    return (a + b - 1) / b;
}
int round(int a, int b) {
    return (a + b / 2) / b;
}
int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
template <class T> bool amax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

// main
int main() {
    const int MAX_N = 100;
    int N, a[MAX_N] = {};
    cin >> N;
    REP(i, N) {
        cin >> a[i];
    }
    sort(a, a + MAX_N);
    reverse(a, a + MAX_N);
    int s1 = 0, s2 = 0;
    REP(i, N) {
        if (i % 2 == 0) {
            s1 += a[i];
        } else {
            s2 += a[i];
        }
    }
    cout << s1 - s2 << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define repm(i,a,b) for(ll i=(ll)(a);i>(ll)(b);i--)
#define all(v) v.begin(), v.end()
#define rall(x) (x).rbegin(),(x).rend()
#define pll pair<long long,long long>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define vc vector<char>
#define vvc vector<vc>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<long long>;
using vvll = vector<vll>;
using vb =vector<bool>;
using vvb=vector<vb>;
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; }
//snippets:tmp,cl,cvl,cs,co,coy,con,cov,setp

int main(){
    ll n;
    cin >> n;
    ll ans=0;
    vll a(100001,0);
    rep(i,n){
        ll A;
        cin >> A;
        a[A]++;
        ans+=A;
    }
    ll q;
    cin >> q;
    rep(i,q){
        ll b,c;
        cin>>b>>c;
        ans+=a[b]*(c-b);
        a[c]+=a[b];
        a[b]=0;
        cout<<ans<<endl;
    }
}

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

ll A[1010];

void solve() {
    int N;
    cin >> N;
    REP(i, N) cin >> A[i];

    map<ll, ll> cnt;

    REP(i, N) {
        ll a = A[i];
        for (ll j = 2; j * j <= A[i]; ++j) {
            if (a % j == 0) {
                cnt[j] += A[i];
                while (a % j == 0) a /= j;
            }
        }
        if (a > 1) {
            cnt[a] += A[i];
        }
    }

    ll ans = 0;
    for (auto p: cnt) {
        if (p.first == 1) continue;
        ans = max(ans, p.second);
    }
    cout << ans << endl;
}

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



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


int main() {

  int x;
  
  cin >> x;
  
  int happy = 0;
  
  int happy_1000 = x / 500;
  
  x-=happy_1000*500;
  
  int happy_5 = x / 5;
  
  cout << happy_1000*1000+happy_5*5 << endl;
}



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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())

// {{{
template<typename T>
void printmatrix(vector<vector<T> > ar){
    for (int i = 0; i < (int)ar.size(); i++) {
        for (int j = 0; j < (int)ar[0].size(); j++) {
            cout << ar[i][j];
        }
        cout << endl;
    }
}

template<typename T>
void printvector(vector<T> vec){
    for (int i = 0; i < (int)vec.size(); i++) {
        cout << vec[i] << endl;
    }
}

template<typename T>
void unique(vector<T>& vec){
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
}

template<typename T>
vector<T> cumsum(vector<T> vec){
    vector<T> newvec((T)vec.size());
    int tmp = 0;
    for (int i = 0; i < (int)vec.size(); i++) {
        tmp += vec[i];
        newvec[i] = tmp;
    }

    return newvec;
}

template<typename T>
T digitsum(T x){
    T y=0;
    while(x){
        y += x % 10;
        x /= 10;
    }

    return y;
}

template<typename T>
T gcd(T x, T y){
    if (x == 0 || y == 0) {
        return 0;
    }

    while (x != y){
        if (x > y) {
            x -= y;
        }else{
            y -= x;
        }
    }
    return x;
}

// }}}
/* vim:set foldmethod=marker: */

void solve(){
    int n, i;
    cin >> n >> i;

    cout << n -i+1 << endl;
    return;
}

int main(int argc, char const* argv[])
{
    solve();
    return 0;
}

// sortの仕方
// int a[N];
// array<int,N> ar;
// vector<int> v;
//
// sort(a, a+N); // 配列
// sort(ar.begin(), ar.end()); // array
// sort(v.begin(), v.end()); // vector 昇順
// sort(v.begin(), v.end(), greater<int>()); // 降順

// Template
// template <class T>
// T foomax(T x, T y){
//   if (x > y){
//     return x;
//   }else{
//     return y;
//   }
// }

// string を int に変換 stoi("1010")
// int を string に変換 to_string(1010)


// map の key, value を全て抜き出す。
// for (auto itr = mp.begin(); itr != mp.end(); itr++) {
//     cout << "key" << itr->first << " value" << itr->second << endl;
// }

// 文字列の検索
// string s="abc";
// if (s.find('d') == string::npos){
//     cout << "find" << endl;
// }else{
//     cout << "not find" << endl;
// }


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

int n;

int main(){
	while (cin >> n&&n){
		int sum = 0, num;
		REP(i, n / 4){
			cin >> num;
			sum += num;
		}
		cout << sum << endl;
	}
}

Measured memory_bytes: 1160
import java.util.*;
import java.io.*;

public class Main{
  public static void main(String[] args){
     Scanner scanner = new Scanner(System.in);
     int w = scanner.nextInt();
     int h = scanner.nextInt();
     int x = scanner.nextInt();
     int y = scanner.nextInt();
     int r = scanner.nextInt();
     if((x+r)>w){
       System.out.println("No");
     }else if((x-r)<0){
       System.out.println("No");
     }else if((y+r)>h){
       System.out.println("No");
     }else if((y-r)<0){
       System.out.println("No");
     }else{
       System.out.println("Yes");
     }

  }
}


Measured memory_bytes: 26348
#include<bits/stdc++.h>
using namespace std;
const long long kkk=1000000007;
map<long long,long long> dp;
long long cd(long long x)
{
	if(dp[x])return dp[x];
	else dp[x]=(cd(x/2)+cd((x-1)/2)+cd((x-2)/2))%kkk;
	return dp[x];
}
int main(){
	long long n;
	dp[0]=1;dp[1]=2;dp[2]=4;
	scanf("%lld",&n);
	long long k=cd(n);
	printf("%lld",k);
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
using ll = long long;
constexpr int MOD = 998244353;
struct data { int l, r; } rg[300005];
int arr[300005];
int main()
try
{
	// freopen("TK1-F.in", "r", stdin);
	int n, lst = 0;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		rg[i].l = rg[i].r = -1;
	for (int i = 0; i < n; i++)
	{
		scanf("%d", arr + i);
		if (i && arr[i] != arr[i - 1])
		{
			auto &it = rg[arr[i - 1]];
			if (~it.r)
				throw false;
			it = {lst, i - 1};
			lst = i;
		}
	}
	if (!lst)
	{
		if (arr[0] != 1)
			throw false;
		ll ans = 1;
		for (int i = 1; i <= n; i++)
			ans = ans * i % MOD;
		printf("%lld\n", ans);
		return 0;
	}
	arr[n] = arr[0];
	if (arr[n - 1] == arr[n])
		rg[arr[n]].l = lst;
	else
	{
		auto &it = rg[arr[n - 1]];
		if (~it.r)
			throw false;
		it = {lst, n - 1};
	}
	if (-1 == rg[1].r)
		throw false;
	auto calc_len = [&] (data & a) { return a.r - a.l + 1 + (a.l <= a.r ? 0 : n); };
	int k = calc_len(rg[1]), rem = 0;
	ll ans = 1;
	for (int i = 1; i <= n; i++)
	{
		if (-1 == rg[i].r)
		{
			ans = ans * rem-- % MOD;
			continue;
		}
		int l = rg[i].l, r = rg[i].r, len = calc_len(rg[i]);
		bool x = (arr[r + 1 - (r + 1 == n ? n : 0)] < i);
		bool y = (arr[l - 1 + (!l ? n : 0)] < i);
		if (len > k || (!x && !y && len != k))
			throw false;
		if (x && y)
		{
			rem += k + len - 2;
			ans = ans * (k - len + 1) % MOD;
		}
		else if (x || y)
			rem += len - 1;
	}
	printf("%lld\n", ans);
	return 0;
}
catch (bool)
{
	puts("0");
	return 0;
}


Measured memory_bytes: 3712
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }     //最小公倍数
using Graph = vector<vector<ll>>;
ll inf=300000000000000000;
const double PI = 3.14159265358979323846;
int main(){
  int n,m;
  cin >> n >> m;
  int s[n];
  int t[m];
  rep(i,n)cin >> s[i];
  rep(i,m)cin >> t[i];
  ll p=1000000007;
  ll dp[n+1][m+1];
  rep(i,n+1)rep(j,m+1)dp[i][j]=0;
  rep(i,n+1)dp[i][0]=1;
  rep(i,m+1)dp[0][i]=1;
  rep(i,n){
    rep(j,m){
      if(s[i]==t[j])dp[i+1][j+1]=(dp[i+1][j]+dp[i][j+1])%p;
      else dp[i+1][j+1]=(dp[i][j+1]+dp[i+1][j]+p-dp[i][j])%p;
    }
  }
  cout << dp[n][m] << endl;
}


Measured memory_bytes: 34876
#include <bits/stdc++.h>
 
using namespace std;
#define int long long
const int MAX = 2001;
const int MOD = 1000000007;
 
 


int u=0;
 
signed main(){
   string s;
   cin>>s;
   int k[13][s.size()];
   int t;
   if(s[0]=='?'){
       for(int i=0;i<=9;i++)k[i][0]=1;
       for(int i=10;i<13;i++)k[i][0]=0;
   }
   else{
       for(int i=0;i<13;i++)k[i][0]=0;
       k[s[0]-'0'][0]=1;
   }
    for(int i=1;i<s.size();i++){
        if(s[i]!='?'){
            t=s[i]-'0';
            for(int j=0;j<13;j++)k[j][i]=0;
            for(int j=0;j<13;j++){
                k[(j*10+t)%13][i]=(k[(j*10+t)%13][i]+k[j][i-1])%MOD;
            }
        }else{
            for(int j=0;j<13;j++)k[j][i]=0;
            for(int j=0;j<13;j++){
                for(int y=0;y<=9;y++){
                    k[(j*10+y)%13][i]=(k[(j*10+y)%13][i]+k[j][i-1])%MOD;
                }
                
            }
        }

    }
    cout<<k[5][s.size()-1];
   

    return 0;
}

Measured memory_bytes: 10624
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main() {

	char x, y;
	cin >> x >> y;

	if (x < y) {
		cout << "<" << endl;
	}else if (x == y) {
		cout << "=" << endl;
	}
	else if(x > y) {
		cout << ">" << endl;
	}
	
}

Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNINGS
#pragma comment (linker, "/STACK:526000000")

#include "bits/stdc++.h"

using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define seg_size 262144 * 4LL
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

void init() {
    iostream::sync_with_stdio(false);
    cout << fixed << setprecision(20);
}


#define int ll

unsigned long xor128() {
    static unsigned long x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned long t = (x ^ (x << 11));
    x = y; y = z; z = w;
    return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

void solve(){
    int n, a, b;
    cin >> n >> a >> b;
    int geko = n / (a + b);
    int rem = n - geko * (a + b);
    cout << geko * a + min(rem, a) << endl;
}

#undef int
int main() {
    init();
        solve();
}

Measured memory_bytes: 768
#!/usr/bin/env python3
import sys


def solve(H: int, W: int, h: int, w: int):
    print((H-h)*(W-w))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    h = int(next(tokens))  # type: int
    w = int(next(tokens))  # type: int
    solve(H, W, h, w)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include <stdio.h>

int main(void)
{
  int W, H, x, y, r;

  scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);

  if (((x+r)>W) || ((x-r)<0) || ((y+r)>H) || ((y-r)<0))
    printf ("No\n");
  else
    printf ("Yes\n");

  return 0;
}

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

using namespace std;
using ll =long long;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << 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; }
void coY() {cout <<"Yes"<<endl;}
void coN(){cout <<"No"<<endl;}
const ll INF = 1LL << 60;
const int mod = 1e9+7;
//Write From this Line

int main()
{
	int n ;
	cin >> n ;
	vector<int> a(n+1);
	rep(i,n+1) cin >> a[i];
	vector<int> b(n);
	rep(i,n) cin >> b[i];
	ll ans = 0 ;
	rep(i,n){
		int power = b[i] ;
		int enemy = a[i] ;
		if(power >= enemy && enemy >= 0){
			ans += enemy ;
			power -= enemy ;
			if(power >= 0 ){
				int add = min(power,a[i+1]);
				ans += add;
				a[i+1] -= add;
			}
		} else {
			int add = power ;
			ans += add; 
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <valarray>
#include <utility>
#include <set>
#include <map>

using namespace std;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,n) for(int i=1;i<=(int)(n);i++)
#define rep3(i,n) for(int i=0;i<=(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define REP2(i,m,n) for(int i=m+1;i<=(int)(n);i++)
#define REP3(i,m,n) for(int i=m;i<=(int)(n);i++)
#define INF 500000000  //
#define INFLL 1000000000000000000  //
#define MOD (1e9)+7

typedef long long int ll;

struct edge {
    int to, cost;
};

// a 0x61  z 0x7a  0 0x30

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

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

    int divide_max = 0;
    int num_max;

    rep2(i, n) {
        int a = i;
        int cnt = 0;
        while (a % 2 == 0) {
            a /= 2;
            cnt++;
        }

        if (cnt >= divide_max) {
            divide_max = cnt;
            num_max = i;
        }
    }

    cout << num_max << endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int binarysearch(int);
int s[100000000],n;


int main(){
  int t;
  int i,j,q,ct=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&s[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&t);
    ct+=binarysearch(t);
  }
  printf("%d\n",ct);
}

int binarysearch(int t){
  int left,mid,right,i,j;
  left=0;
  right=n;
  while(left<right){
    mid=(left+right)/2;
    if(s[mid]==t)return 1;
    else if(s[mid]<t)left=mid+1;
    else right=mid;
  }
  return 0;
}



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

using namespace std;

int main()
{
	int k,s;
	int count = 0;

	cin >> k >> s;
	for(int x = 0; x < k+1; x++)
	{
		for (int y = 0; y < k+1; y++)
		{
			if(k >=(s-(x+y)) && (s-(x+y)) >= 0)
			{
				count++;
			}
		}
	}
	printf("%d\n", count);
	return 0;
}

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

int main(){
    int n;
    string A;
    string B;
    int a=0;
    int b=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>A>>B;
        if(A>B)a+=3;
        if(B>A)b+=3;
        if(B==A){
            a+=1;
            b+=1;
        }
    }
cout<<a<<" "<<b<<endl;
    return 0;
    
}


Measured memory_bytes: 3140
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<sstream>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<cmath>
#include<stack>
#include<set>
#include<map>
#define rep(i,x,n) for(int i=x;i<=n;i++)
#define per(i,n,x) for(int i=n;i>=x;i--)
#define sz(a) int(a.size())
#define rson mid+1,r,p<<1|1
#define pii pair<int,int>
#define lson l,mid,p<<1
#define ll long long
#define pb push_back
#define mp make_pair
#define se second
#define fi first
using namespace std;
const double eps=1e-8;
const int mod=1e9+7;
const int N=2e5+10;
const int inf=1e9;
int n;
int a[N];
int cnt[N],d[N];
int main(){
	//ios::sync_with_stdio(false);
	//freopen("in","r",stdin);
	cin>>n;
	rep(i,1,n) cin>>a[i];
	ll ans=0;
	rep(i,1,n){
		d[i]=cnt[a[i]];
		ans+=cnt[a[i]];
		cnt[a[i]]++;
	}
	memset(cnt,0,sizeof(cnt));
	per(i,n,1){
		d[i]+=cnt[a[i]];
		cnt[a[i]]++;
	}
	rep(i,1,n){
		printf("%lld\n",ans-d[i]);
	}
	return 0;
}

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

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

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

int main() {
    ll a,b,c,d;
    cin >> a >> b >> c >> d;
    a--;
    ll r = b/c + b/d - b/lcm(c,d);
    ll l = a/c + a/d - a/lcm(c,d);
    ll baisu = r - l;

    ll ans = b - a  - baisu;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3576
"""
Y+Z=S−X  が成り立つことは分かるものの1通りには決まりません。
満たすべき条件は 0≤Y,Z≤K と Y+Z=S−X なので、変数 Z を消去すると以下の不等式が得られます。

0≤Y≤K
0≤Z=S−Y−X≤K
変形して、Y≤S−X かつ S−X−K≤Y

つまり Y の下限は Ymin=max(0,S−X−K) 、
上限は Ymax=min(K,S−X) となります。

"""

K, S = map(int, input().split())
ans = 0
for x in range(K+1):
  mn = max(0, S-x-K)
  mx = min(K, S-x)
  ans += max(0, mx-mn+1)
print(ans)  
   

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;

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

    int l=0,r=N-1;
    ll ans = 0;
    while(l<r){
        if(c[l]=='W' && c[r]=='R'){
            ++ans;
            ++l,--r;
        } else if(c[l] == 'R'){
            ++l;
        } else if(c[r]=='W'){
            --r;
        }
    }
    cout << ans << endl;
}


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

using namespace std;

#define int long long
#define MOD 1000000007


#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (b) - 1; i >= (a); i--)
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define all(i) (i).begin(),(i).end()å
#define rall(i) (i).begin(),(i).end(),greater<int>()


#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
template <typename T> void print(T x) { std::cout << x << '\n'; }
 
//typedef long long ll;
#define TENNINE 1000000005
#define TENFIVE 100005
//#define int long long

 
signed main(){
 
   int N,Q;
   string S;

   cin >>N>>Q;
   cin >>S;

   int l[Q],r[Q];

   rep(i,Q){
       cin >> l[i] >> r[i];
   }

    int sum = 0;
    int cnt[N];

    for(int i=0;i<N-1;i++){
        cnt[i]=sum;
        if(S[i]=='A'){
            if(S[i+1]=='C'){
                sum++;
            }
        }
        //cout <<sum<<endl;
    }
    cnt[N-1]=sum;

    rep(i,Q){
        cout << cnt[r[i]-1]-cnt[l[i]-1] <<endl;

    }


    return 0;
 
}


Measured memory_bytes: 3456