akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
//#include<tr1/unordered_map>
//#include"Bignum/bignum.h"
//#define lll bignum
#define ls(x) ( x << 1 )
#define rs(x) ( x << 1 | 1 )
//#define mid ( (l + r) >> 1 )
//#define Mid ( (l + r) / 2.0 )
#define lowbit(x) ( x & -x )
#define debug(x) (cout << "#x = " << (x) << endl)
#define Set(x, i) memset (x, i, sizeof(x))
#define re register
#define For(i, j, k) for(re int i = (j); i <= (k); ++i)
#define foR(i, j, k) for(re int i = (j); i >= (k); --i)
#define Cross(i, j, k) for(re int i = (j); i; i = (k))
using namespace std;
typedef double db;
typedef long long ll;
typedef unsigned long long ull;
const db eps = 1e-8;
const ll N = 100011;
const ll inf = 0x3f3f3f3f3f3f;

namespace IO {

	inline char gc() {
        static char buf[100000], *p1 = buf, *p2 = buf;
        return (p1 == p2) && (p2 = (p1 = buf) +
            fread (buf, 1, 100000, stdin), p1 == p2)? EOF: *p1++;
    }

	#define dd ch = getchar()
	inline ll read() {
		ll x = 0; bool f = 0; char dd;
		for (; !isdigit (ch); dd) f ^= (ch == '-');
		for (; isdigit (ch); dd)  x = (x << 3) + (x << 1) + (ch ^ 48);
		return f? -x: x;
	}
	#undef dd

	inline void write( ll x ) {
		if ( x < 0 ) putchar ('-'), x = -x;
		if ( x > 9 ) write ( x / 10 ); putchar ( x % 10 | 48 );
	}

	inline void wrn ( ll x ) { write (x); putchar (' '); }

	inline void wln ( ll x ) { write (x); putchar ('\n'); }

	inline void wlnn ( ll x, ll y ) { wrn (x), wln (y); }

}

using namespace IO;

int main()
{
//	freopen(".in", "r", stdin);
//	freopen(".out", "w", stdout);
	ll A = read(), B = read();
	if ( A > B ) return wln (A + A - 1), 0;
	if ( A < B ) return wln (B + B - 1), 0;
	if ( A == B ) return wln (A + B), 0;
}

/*

*/



Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <queue>
#define ll long long int
#define inf 3e18+1
#define all(v) (v).begin(),(v).end() 
#define N 200005
#define F first
#define S second
using namespace std;
ll mod=1e9+7;
int main()
{
    // added the two lines below 
    ios_base::sync_with_stdio (false); 
    cin.tie(NULL);
    cout.tie(0);    
    ll test=1;//cin>>test;
    while(test--){
        ll n;
        cin>>n;
        vector<ll>p,q;
        for(int i=0;i<n;i++){
            ll a,b;
            cin>>a>>b;
            p.push_back(a+b);
            q.push_back(a-b);
        }
        sort(all(p));
        sort(all(q));
        ll ans=INT_MIN;
        for(int i=0;i<n;i++){
            ans=max(ans,p[n-1]-p[0]);
            ans=max(ans,q[n-1]-q[0]);
        }
        cout<<ans;
    }
    return 0;
}




Measured memory_bytes: 6692
N, Q = map(int, input().split())
S = str(input())
TD = [list(map(str, input().split())) for i in range(Q)]


def disappear(index, place):
    if index == -1:
        return (False, False)
    else:
        left = False
        right = False
        for t, d in TD:
            cur_chara = place[index]
            if t == cur_chara:
                if d == 'R':
                    index += 1
                else:
                    index -= 1
                if index < 0:
                    left = True
                    break
                elif index > N-1:
                    right = True
                    break
        return (left, right)


def binarySearch(place, direction):
    """
    :param direction; left, right
    :return: 消失する位置
    """
    start, end = -1, N
    if direction == 'left':
        while end - start > 1:
            t = start + (end - start) // 2
            if disappear(t, place)[0]:
                start = t
            else:
                end = t
        return start
    elif direction == 'right':
        while end - start > 1:
            t = start + (end - start) // 2
            if disappear(t, place)[1]:
                end = t
            else:
                start = t
        return start


left = binarySearch(S, direction='left')
right = binarySearch(S, direction='right')
print(right - left)

Measured memory_bytes: 93480
N,K = map(int, input().split())
p = list(map(int, input().split()))
c = list(map(int, input().split()))

ans = -1*10**9
for si in range(N):
  x = si
  total = 0
  l = 0
  s = list()
  while(1):
    x = p[x]-1
    s.append(c[x])
    l += 1
    total += c[x]
    if x == si:
      break
  t = 0
  for i in range(l):
    now = 0
    if (i+1) > K:
      break
    t += s[i]
    now += t
    if total > 0:
      e = (K-(i+1)) // l
      now += total * e
    ans = max(ans, now)
print(ans)

Measured memory_bytes: 77084
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define vi vector<int>
#define all(v) v.begin(), v.end()
#define ll long long int
using namespace std;
int main(){
  string s,t;
  int i,j;
  cin>>s;
  cin>>t;
  int cnt=0;
  for(i=0;i<s.length();i++){
    if(s[i]!=t[i]){
      cnt++;
    }
  }
  cout<<cnt;
}

Measured memory_bytes: 3916
#include <iostream>
#include <sstream>
#include <string>

using namespace std;

namespace {

std::string Join(const int* A, int n) {
  std::stringstream ss;
  if (n > 0)
    ss << A[0];
  for (int i = 1; i < n; ++i) {
    ss << " ";
    ss << A[i];
  }
  return ss.str();
}

inline void swap(int& a, int& b) {
  const int t = a;
  a = b;
  b = t;
}

int BubbleSort(int* A, int n) {
  int nswap = 0;
  bool flag = true;
  while (flag) {
    flag = false;

    for (int j = n - 1; j > 0; --j) {
      if (A[j - 1] <= A[j])
        continue;
      swap(A[j - 1], A[j]);
      ++nswap;
      flag = true;
    }
  }
  return nswap;
}

}  // namespace

int main() {
  int n;
  int A[100];

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

  const int ret = BubbleSort(A, n);
  cout << Join(A, n) << endl;
  cout << ret << endl;

  return 0;
}

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

class StronglyConnectedComponents {
  public:
    vector <vector <int>> G, rG;
    vector <int> vs, used, cmp;

    StronglyConnectedComponents ( int v )
        : G( v ), rG( v ), used( v, 0 ), cmp( v, 0 ) {}

    void add_edge( int from, int to ) {
        G[from].push_back( to );
        rG[to].push_back( from );
    }

    void dfs( int v ) {
        used[v] = true;
        for ( const auto & i : G[v] ) {
            if ( ! used[i] ) dfs( i );
        }
        vs.push_back( v );
    }

    void rdfs( int v, int k ) {
        used[v] = true;
        cmp[v] = k;
        for ( const auto & i : rG[v] ) {
            if ( ! used[i] ) rdfs( i, k );
        }
    }

    int scc() {
        vs.clear();
        for ( int i = 0; i < (int)used.size(); i++ ) {
            if ( ! used[i] ) dfs( i );
        }
        used = vector <int> ( used.size(), false );
        int k = 0;
        reverse( vs.begin(), vs.end() );
        for ( const auto & i : vs ) {
            if ( ! used[i] ) rdfs( i, k++ );
        }
        return k;
    }
};

int main() {
    int v, e;
    cin >> v >> e;
    StronglyConnectedComponents G(v);
    rep (i, e) {
        int s, t;
        cin >> s >> t;
        G.add_edge(s, t);
    }

    int q;
    G.scc();
    cin >> q;
    rep (i, q) {
        int u, v;
        cin >> u >> v;
        cout << (G.cmp[u] == G.cmp[v]) << endl;
    }
    return 0;
}


Measured memory_bytes: 4568
#標準入力を取得
input = gets.split(" ").map(&:to_i)
from = input[0]
to = input[1]

#出力結果格納変数を定義
count = 0

#値の回文判定　fromからtoまで繰り返し
(from..to).each do |n|
  array = n.to_s.split("").map(&:to_i)
  if array[0] == array[4] && array[1] == array[3]
    count += 1
  end
end

#回答を出力
puts count


Measured memory_bytes: 14392
#include <iostream>
#include <vector>
#include <string>
#include <climits>
#include <algorithm>

using namespace std;

int main() {
	int n, m;

	while( true ){

		cin >> n >> m;

		if( !n && !m ) {
			break;
		}

		vector < int > point(n);

		for(int i = 0; i < n; i++) {
			cin >> point[i];
		}

		vector < int > total;

		for(int i = 0; i < n; i++) {
			total.push_back(point[i]);
			for(int j = 0; j < n; j++) {
				total.push_back(point[i] + point[j]);
			}
		}
		sort(total.begin(), total.end());

		int tmp, M = 0;

		/*for(int i = 0; i < total.size(); i++) {
			cout << total[i] << " ";
		}*/

		for(int i = 0; i < total.size(); i++) {
			tmp = m - total[i];
			vector<int>::iterator it = upper_bound( total.begin(), total.end(), tmp);
			if(it == total.begin()) {
				continue;
			}
			//cout << "     " << it-total.begin() << "      " << endl;
			M = max(M, total[i] + *(it - 1));
			//if(it == total.end()) {
			//	continue;
			//}
			//int sum = total[i] + (*it);
			//cout << "     " << i << "      " << endl;
			//if(sum <= m && max < m) {
			//	max = sum;
			//}
		}

		cout << M << endl;

	}
}

Measured memory_bytes: 9328
#include <bits/stdc++.h>
using namespace std;
int main(){
    long N,K,Q;
    cin >> N >> K >> Q;
    vector<long > A(Q+1);
    map<long, long> mapcnt;

    for(long i=1; i<Q+1; i++){
        cin >> A[i];
        mapcnt[A[i]]++;
    }
    
    
    /*
    for(long i=1; i<N+1; i++){
        cout << i << ":" << mapcnt[i] << endl;
    }
    */

    for(long i=1; i<N+1; i++){
        long res = K-Q+mapcnt[i];
        // cout << res << endl;
        if(res > 0){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }

    
    return 0;
}

Measured memory_bytes: 7680
using System;
using System.Linq;

public class Program
{
    private int N;
    private A[] Arms;

    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        Arms = new A[N];
        for (int i = 0; i < N; i++)
        {
            Arms[i] = new A(sc.NextInt(), sc.NextInt());
        }

        var T = Arms.ToArray();
        var S = Arms.ToArray();
        Array.Sort(T, (a, b) => (a.X - a.L).CompareTo(b.X - b.L));
        Array.Sort(S, (a, b) => (a.X + a.L).CompareTo(b.X + b.L));

        // ロボットS[i] を使う 最大値
        int r = int.MinValue;
        int cnt = 0;
        for (int i = 0; i < N; i++)
        {
            if (S[i].X - S[i].L >= r)
            {
                cnt++;
                r = S[i].X + S[i].L;
            }
        }
        Console.WriteLine(cnt);
    }

    public static void Main(string[] args)
    {
        new Program().Solve();
    }
}

struct A
{
    public int X, L;

    public A(int x, int l)
    {
        X = x;
        L = l;
    }
}

class Scanner
{
    public Scanner()
    {
        _pos = 0;
        _line = new string[0];
    }

    const char Separator = ' ';
    private int _pos;
    private string[] _line;

    #region スペース区切りで取得

    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = Console.ReadLine().Split(Separator);
            _pos = 0;
        }

        return _line[_pos++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }

    #endregion

    #region 型変換

    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }

    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }

    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }

    #endregion

    #region 配列取得

    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = Console.ReadLine().Split(Separator);

        _pos = _line.Length;
        return _line;
    }

    public int[] IntArray()
    {
        return ToIntArray(Array());
    }

    public long[] LongArray()
    {
        return ToLongArray(Array());
    }

    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }

    #endregion
}

Measured memory_bytes: 17608
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MM = 1000000000;
const int MOD = MM + 7;
const int MAX = 510000;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
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;}
const ll INF = 1LL << 60;
const double pi = acos(-1.0);

int main() {
	int n, m; cin >> n >> m;
	int l = 1, r = n;
	rep(i, m) {
		int mi, ma; cin >> mi >> ma;
		chmax(l, mi);
		chmin(r, ma);
	}
	cout << max(0, r - l + 1) << endl;
}


Measured memory_bytes: 3612
import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int a = sc.nextInt();
		int b = sc.nextInt();
		int d = a/b;
		int r = a%b;
		double aa = a;
		double bb = b;
		double f = aa/bb;
		String s = String.format("%.5f",f);
		System.out.println(d+" "+r+" "+s);
	}
}



Measured memory_bytes: 26420
s = input()
n = len(s) + 1 # 箱の数

dat = [0] * n
c = 0
for i in range(len(s)):
    if s[i] == "<":
        c += 1
        dat[i + 1] = c
    else:
        c = 0

dat2 = [0] * n
for i in range(len(s)-1, -1, -1):
    if s[i] == ">":
        c += 1
        dat2[i] = c
    else:
        c = 0


#print("")
#print(" ".join(list(map(str, dat))))
#print("")
#print(" ".join(list(map(str, dat2))))


res = []
for i in range(len(dat)):
    res.append(int(max(dat[i], dat2[i])))
#print()
#print(" " + " ".join(s))
#print(" ".join(list(map(str, res))))

print(sum(res))


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

long long int n,a[200010],x[200010],y[200010],c[200010],t[200010],m,i,l,r,k,ans,w;

signed main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	cin>>n;ans=0;
	for (i=1;i<n+1;i++) cin>>a[i];
	for (i=1;i<n+1;i++) y[i]=i+a[i];
	for (i=1;i<n+1;i++) t[i]=i-a[i];
	sort(t+1,t+n+1);
	x[1]=t[1];c[1]=1;m=1;
	for (i=2;i<n+1;i++)
	if (t[i]==t[i-1]) c[m]++;else
	{
		m++;x[m]=t[i];c[m]=1;
	}
	for (i=1;i<n+1;i++)
	{
		l=1;r=m;k=0;
		while (l<=r)
		{
			w=(l+r)/2;
			if (x[w]<y[i]) l=w+1;
			else if (x[w]>y[i]) r=w-1;
			else
			{
				k=w;l=2;r=1;
			}
		}
		if (k!=0) ans=ans+c[w];
	}
	cout<<ans;
}


Measured memory_bytes: 11100
#include <iostream>
using namespace std;
  
int main()
{
    double a, b;
    cin >> a >> b;
  
    if(-1000 <= a && b <= 1000)
    {
        if(a < b)
            cout << "a < b" << endl;
  
        else if(a > b)
                cout << "a > b" << endl;
  
             else if(a = b)
                    cout << "a == b" << endl;
    }
      
    return 0;
}

Measured memory_bytes: 3148
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a=scan.nextInt(),b=scan.nextInt(),c=scan.nextInt(),d=scan.nextInt();
		if(a+b<c+d) {
			System.out.println("Right");
		}
		else if(a+b>c+d) {
			System.out.println("Left");
		}
		else if(a+b==c+d) {
			System.out.println("Balanced");
		}

	}

}

Measured memory_bytes: 35488
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
int n;
ll m, v, p;
const int maxN = 1e5 + 10;
ll a[maxN];
bool can(int ind) {
    int cut = n + 1;
    int cnt = 0;
    for (int i = n; i >= 1; i--) {
        if (i == ind) continue;
        cnt++;
        if (cnt == p - 1) {
            cut = i;
            break;
        }
    }
    ll lft = max(0LL, v - p);
    ll score = a[ind] + m;
    vector < ll > add;
    for (int i = cut - 1; i >= 1; i--) {
        if (i == ind) continue;
        if (score < a[i]) return false;
        add.push_back(min(m, score - a[i]));
    }
    sort(add.begin(), add.end());
    ll tot_sum = 0;
    for (ll v : add) tot_sum += v;
    reverse(add.begin(), add.end());
    for (int i = 0; i < lft; i++) {
        if (tot_sum < (lft - i) * m) return false;
        tot_sum -= add[i];
    }
    return true;

}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
//    freopen("input.txt", "r", stdin);
    cin >> n >> m >> v >> p;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + n + 1);

    if (can(1)) {
        cout << n;
        return 0;
    }
    int l = 1;
    int r = n;
    while (r - l > 1) {
        int mid = (l + r) / 2;
        if (can(mid)) r = mid;
        else l = mid;
    }
    cout << n - r + 1 << '\n';
    return 0;
}

Measured memory_bytes: 2916
# -*- coding: utf-8 -*-
import math
    
def abs(num):
    if num < 0:
        return -num
    else:
        return num

###
# main
if(__name__ == '__main__'):
    # input
    s, w = map(int, input().split(" "))

    if s <= w:
        print("unsafe")
    else:
        print("safe")
    
# else:
    # do nothing

Measured memory_bytes: 9172
# Coding is about expressing your feeling and there is always a better way to express your feeling _feelme
import sys,math,numpy as np
#sys.stdin,sys.stdout=open('input.txt','r'),open('output.txt','w')
from sys import stdin,stdout;mod=int(1e9 + 7);from statistics import mode
from collections import *;from math import ceil,floor,inf,factorial,gcd,log2,sqrt
ii1=lambda:int(stdin.readline().strip())
is1=lambda:stdin.readline().strip()
iia=lambda:list(map(int,stdin.readline().strip().split()))
isa=lambda:stdin.readline().strip().split()
# print('{:.3f}'.format(1),round(1.123456789,4))
# np.set_printoptions(sign=' ',legacy='1.13') # legacy add space at sign position
# sys.setrecursionlimit(500000)
def lcm(a,b): return (a*b)//gcd(a,b)
def setbits(n):return bin(n).count('1')
def resetbits(n):return bin(n).count('0')
def modinv(n,p):return pow(n,p-2,p)
def ncr(n,r):
    num,den=1,1;r=min(n,n-r)
    for i in range(r):num*=(n-i);den*=(i+1)
    return num//den
def ncr_p(n, r, p):
    num,den=1,1;r=min(r,n-r)
    for i in range(r):num = (num * (n - i)) % p ;den = (den * (i + 1)) % p
    return (num * modinv(den,p)) % p
def isPrime(num) :
    if num<=1:return False
    if num==2 or n==3:return True
    if (num % 2 == 0 or num % 3 == 0) :return False
    m = int(num**0.5)+1
    for i in range(5,m,6):
        if (num % i == 0 or num % (i + 2) == 0) :return False
    return True
def bin_search(arr, low, high, val):
    while low <= high:
        mid = low + (high - low) // 2;
        if arr[mid] == val:return mid
        elif arr[mid] < val:low = mid + 1
        else:high = mid - 1
    return -1
def sumofdigit(num):
    count=0;
    while num : count+=num % 10;num //= 10;
    return count;
def inputmatrix():
    r,c=iia();mat=[0]*r;
    for i in range(r):mat[i]=iia();
    return r,c,mat;
def prefix_sum(n,arr):
    for i in range(1,n):arr[i]+=arr[i-1]
    return arr;
def binomial(n, k):
    if 0 <= k <= n:
        ntok = 1;ktok = 1
        for t in range(1, min(k, n - k) + 1):ntok *= n;ktok *= t;n -= 1
        return ntok // ktok
    else:return 0
def divisors(n):
    res = [];
    for i in range(1,ceil(sqrt(n))+1):
        if n%i == 0:
            if i==n//i:res.append(i)
            else:res.append(i);res.append(n//i)
    return res;


n= ii1()
if n>=30:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 27348
N=int(input())
A=list(map(int,input().split()))
B=[0]*N
C=[0]*N

for i in range(N):
    B[i]=A[i]+i
    C[i]=i-A[i]

B.sort()
B.insert(0,-2000000000)
B.append(2000000000)
C.sort()
ans=0
for a in C:
    l1=0
    r1=N
    while r1-l1>1:
        m1=(l1+r1)//2
        if B[m1] < a:
            l1=m1
        else:
            r1=m1
    l2=0
    r2=N
    while r2-l2>1:
        m2=(l2+r2)//2
        if B[m2] <= a:
            l2=m2
        else:
            r2=m2
    if l2==0 and l1 == -1:
        pass
    else:
        ans += l2-l1

print(ans)

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

int main(){
    int n; cin >> n;
    int fn = 0;
    int N = n;
    while(n > 0){
        fn += n%10; n = n/10;
    }

    if(N%fn == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}



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

using namespace std;

int main () {
  int n;
  int a[3];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a + 3);
    if ((a[2] * a[2]) == (a[1] * a[1]) + (a[0] * a[0]))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include <stdio.h>
 
int main() {
int S,h,m,s;
scanf("%d",&S);
if(S<=86400){
h=S/3600;
m=S/60-h*60;
s=S%60;
 
printf("%d:%d:%d\n",h,m,s);
}
 
 
return 0;
}

Measured memory_bytes: 592
n = int(input())
A = []
for _ in range(n):
    tmp = int(input())
    A.append(tmp)

m = max(A)
L = sorted(A)
L.sort(reverse = True)

if L[1] == m:
    for _ in range(n):
        print(m)
else:
    for i in range(n):
        if A[i] == m:
            A.pop(i)
            print(max(A))
            A.append(0)
        else:
            print(m)


Measured memory_bytes: 14640
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(a) a.begin(), a.end()
#define P pair<int, int>
#define F first
#define S second
#define mod 1000000007
#define INF 900000000000000004
signed main(void){
    string s,t;cin>>s;
    t=s;reverse(all(t));
    int ans=0;
    rep(i,(s.size()+1)/2){
        if(s[i]!=t[i])ans++;
    }
    cout<<ans<<endl;
}
        


Measured memory_bytes: 256
/* AtCoder Beginner Contest abc132
 * Problem E
 * Au: SJoshua
 */
#include <cstdio>
#include <vector>
#include <string>
#include <iostream>
#include <queue>

using namespace std;

const int f = 100001;

struct node {
	int v, d;
};

int main(void) {
	int n, m, S, T;
	cin >> n >> m;
	vector <vector <int>> graph(n + 1 + 2 * f);
	for (int i = 0; i < m; i++) {
		int u, v;
		cin >> u >> v;
		graph[u].push_back(v + f);
		graph[u + f].push_back(v + 2 * f);
		graph[u + 2 * f].push_back(v);
	}
	cin >> S >> T;
	vector <bool> vis(n + 1 + 2 * f);
	queue <node> q;
	q.push({S, 0});
	int dis = -1;
	while (!q.empty()) {
		auto t = q.front();
		q.pop();
		if (vis[t.v]) {
			continue;
		}
		if (t.v == T) {
			dis = t.d;
			break;
		}
		vis[t.v] = true;
		for (auto i: graph[t.v]) {
			if (!vis[i]) {
				q.push({i, t.d + (i < t.v)});
			}
		}
	}
	cout << dis << endl;
	return 0;
}


Measured memory_bytes: 16640
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
using ll=long long;
constexpr ll mod=1000000007;
constexpr int inf=1000000000;
constexpr ll linf=1000000000000000000;

struct UnionFind{
private:
    vector<int> par;
    vector<int> rank;
    vector<int> sz;
public:
    UnionFind(int n){
        par.resize(n);
        rank.resize(n);
        sz.resize(n);
        for (int i=0;i<n;i++){
            par[i]=i;
            rank[i]=0;
            sz[i]=1;
        }
    }
    int root(int x){
        if(par[x]==x)return x;
        else return par[x]=root(par[x]);
    }
    bool issame(int x,int y){
        return root(x)==root(y);
    }
    bool merge(int x,int y){
        x=root(x);
        y=root(y);
        if(x==y)return false;
        if(rank[x]<rank[y])swap(x,y);
        if(rank[x]==rank[y])++rank[x];
        par[y]=x;
        sz[x]+=sz[y];
        return true;
    }
    int getsz(int x){
        x=root(x);
        return sz[x];
    }
};

int main(){
    int n,m,k;
    cin>>n>>m>>k;
    int cnt[n]={};
    UnionFind uf(n);
    rep(i,m){
        int a,b;
        cin>>a>>b;
        --a,--b;
        uf.merge(a,b);
        --cnt[a],--cnt[b];
    }
    rep(i,k){
        int c,d;
        cin>>c>>d;
        --c,--d;
        if(uf.issame(c,d)){
            --cnt[c],--cnt[d];
        }
    }
    rep(i,n){
        cout<<uf.getsz(i)+cnt[i]-1<<" ";
    }
    cout<<endl;
}


Measured memory_bytes: 2432
#include <iostream>
#include <vector>
#include <array>
#include <deque>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <iomanip>

using namespace std;
using ll=long long int;

template<typename M, typename N>
constexpr common_type_t<M, N> gcd(M a, N b) {
    return b ? gcd(b, a%b) : abs(a);
}

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

    ll ans = b-a+1;
    ans -= (b/c)-((a-1)/c);
    ans -= (b/d)-((a-1)/d);
    ll lcm = c*d/gcd(c, d);
    ans += (b/lcm)-((a-1)/lcm);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) Rep(i, 0, n)
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;
//const int mod = 998244353;

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

    int n, k;
    cin >> n >> k;
    int ans = n;
    n %= k;
    ans = min(ans, n);
    ans = min(ans, max(n - k, k - n));
    cout << ans << endl;
}


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

const double eps=1e-10;

int main(){
	while(1){
		double x[4], y[4];
		bool flag=false;
		
		for(int i=0; i<4; ++i){
			if(scanf(" %lf %lf", &x[i], &y[i]) == EOF){
				flag=true;
				break;
			}
		}
		if(flag) break;
		
		if( fabs((x[1]-x[0])*(x[3]-x[2]) + (y[1]-y[0])*(y[3]-y[2])) <= eps) printf("YES\n");
		else printf("NO\n");
	}

	return 0;
}

Measured memory_bytes: 1196
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T> ostream& operator<<(ostream& s,const multiset<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1'000'000'007;
const ll inf=1'000'000'000'000'000'00;
const int INF=1'000'000'000;
const double EPS=1e-10;
const double PI=acos(-1);

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    ll k;
    cin>>k;
    ll n=1;
    k--; 
    cout<<n<<endl;
    n++;
    while(k--){
        ll tmp=n;
        ll sum=0;
        string s=to_string(tmp);
        rep(i,s.size()) sum+=s[i]-'0';
        ll pow=1;
        rep(d,s.size()){
            pow*=10;
            ll x=pow*(tmp/pow+1)-1;
            ll nsum=0;
            string ns=to_string(x);
            rep(i,s.size()) nsum+=ns[i]-'0';
            if(x*sum<n*nsum){
                n=x,sum=nsum;
            }
        }
        cout<<n<<endl;
        n++;
    }
}

Measured memory_bytes: 3680
#include<cstdio>
#include<iostream>
#include<queue>
#include<string>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<set>
#include<cstdlib>
#include<stack>
#include<ctime>
#include<map>
#include<list>
#include<cctype>
using namespace std;

string s;

int main()
{
	int ans=0;
	cin>>s;
	int len=s.length();
	for(int i=0; i<len; i++) ans+=s[i]-'0';
	if(ans%9==0) puts("Yes");
	else puts("No");
	return 0;
}


Measured memory_bytes: 3740
#include <bits/stdc++.h>
#define ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;

using namespace std;

ll a;
string b;
int main(){
  cin>>a>>b;
  assert(b[1]=='.');
  cout<<a*((b[0]-'0')*100+(b[2]-'0')*10+(b[3]-'0'))/100<<endl;
  
  return 0;
}

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

int main(){
    int n;
    string s,t;
    cin>>n>>s>>t;
    for(int i=0;i<=n;i++){
        bool ok=true;
        for(int j=0;j+i<n;j++){
            if(s[j+i]!=t[j]) ok=false;
        }
        if(ok){
            cout<<n+i;
            return 0;
        }
    }

}

Measured memory_bytes: 256
n = int(input())
T, A = map(int, input().split())
H = [int(j) for j in input().split()]
tmp = [[0] for j in range(n)]
for j in range(n):
    tmp[j] = abs(A - (T - H[j] * 0.006))
print(tmp.index(min(tmp)) +1)

Measured memory_bytes: 3060
#include <iostream>

using namespace std;

int main() {
	int n;
	while (cin >> n) {
		if (n == 0) {
			break;
		}
		int sum = 0;
		if (n != 1) {
			sum++;
		}
		for (int i = 2; i*i <= n; i++) {
			if (n % i == 0) {
				sum += i;
				sum += n/i;
				if (i*i == n) {
					sum -= i;
				}
			}
		}
		if (sum == n && n != 1) {
			cout << "perfect number" << endl;
		} else if (n < sum) {
			cout << "abundant number" << endl;
		} else {
			cout << "deficient number" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1156
#include <iostream>
#include <algorithm>
using namespace std;
static const int MAX = 200000;
int main()
{
    int n;
    cin>>n;
    int nums[MAX];
    for(int i=0;i<n;i++){
        cin>>nums[i];
    }
    int maxv = nums[1]-nums[0];
    int minv = nums[0];
    for(int i=1;i<n;i++){
        maxv = max(maxv,nums[i]-minv);
        minv = min(minv,nums[i]);
    }
    cout<<maxv<<endl;
    return 0;
}



Measured memory_bytes: 3884
#include <iostream>
using namespace std;
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iomanip>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
typedef const void cv;
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define per(i,n) for((i)=(n)-1;(i)>=0;(i)--)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max((a),(b))-min((a),(b)))
#define setpre(n) fixed << setprecision(n)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
#define sankaku(x) (((x)*((x)+1))/2)
int dx[8]={1,0,-1,0,1,-1,-1,1},dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(cv *a, cv *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(cv *a, cv *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(cv *left, cv *right) {return strcmp((char *)left,(char *)right);}
int downchar(cv *left, cv *right) {return strcmp((char *)right,(char *)left);}
ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1){
      res *= a; if(mod>=1) res %= mod;
    }
    a *= a; if(mod>=1) a %= mod;
    n >>= 1;
  }
  return res;
}
const int MAX = 2010000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
void initialize(){
  COMinit();
}
int main(void){
  initialize();
  ll n,m,i,j,k,result=0;
  int a[LIMIT2]={0};
  string s;
  
  cin >> k;
  cin >> s;
  n = s.size();
  rep(i,k+1){//i: sの最後の文字の後ろに挿入できる文字数
    ll tmp = COM(n+k-i-1,n-1);
    tmp *= modpow(26,i,MOD1);
    tmp %= MOD1;
    tmp *= modpow(25,k-i,MOD1);
    tmp %= MOD1;
    if(tmp<0) tmp+=MOD1;
    result += tmp;
    result %= MOD1;
  }
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 52352
using System;

namespace AOJ
{
    class Program
    {
        static void Main(string[] args)
        {
            //C#???????????°????????????????????§?????°???????????????????£???°???
            var read = Console.ReadLine();
            //????????????????????¨??????
            read = Console.ReadLine();
            var temp_string = read.Split(' ');

            //?????????????????¨??¨??????????????¨?????°?????£??¨???
            int count = 0;

            //???????????¢
            Array.Reverse(temp_string);

            foreach (string i in temp_string)
            {

                Console.Write(i);
                if (count < temp_string.Length - 1)
                {
                    Console.Write(" ");
                }
                count++;
            }
            Console.WriteLine();
        }
    }
}

Measured memory_bytes: 8760
import java.util.Scanner;

public class Main{
    static Scanner scan = new Scanner(System.in);
    public static void main(String[]args){
         int hours_int,minutes_int,second_int;
        float hours_float,minutes_float,exchange,exchange2,theSecond;
        
		float seconds = scan.nextFloat();
                                     hours_float = seconds / 3600;
                                     hours_int = (int) hours_float;
                                     exchange= hours_float-(float) hours_int ;
                                     minutes_float = exchange * 60;
                                     minutes_int = (int) minutes_float;
                                     exchange2 = minutes_float - (float) minutes_int;
                                     theSecond =exchange2 * 60;
                                     second_int = (int) Math.round(theSecond);
                                     System.out.printf("%d:%d:%d\n",hours_int,minutes_int,second_int);
        	 
    }
}


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

int A,B;

int main() {
  cin>>A>>B;
  int tap = 1;
  int ans = 0;
  while(tap < B) {
    ans++;
    tap--;
    tap += A;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
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; }
const long long INF = 1LL << 60;
const int INT_INF = 1LL << 30;

int main(){
  ll N, M;
  cin >> N >> M;
  vll A(N);
  priority_queue<ll> AA;
  for(int i = 0; i < N; i++){
    cin >> A.at(i);
    AA.push(A.at(i));
  }
  for(int i = 0; i < M; i++){
    ll x = AA.top(); AA.pop();
    x /= 2LL;
    AA.push(x);
  }
  ll sum = 0LL;
  while(!AA.empty()){
    sum += AA.top();
    AA.pop();
  }
  cout << sum << endl;
}

Measured memory_bytes: 2168
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define REP(i,n) for(ll i=0; i<(n); i++)
#define REP2(i,x,n) for(ll i=x; i<(n); i++)
#define REP3(i,x,n) for(ll i=x; i>(n); i--)
#define zero_pad(num) setfill('0') << std::right << setw(num)
#define space_pad(num) setfill(' ') << std::right << setw(num)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main(){
    ll N;
    cin >> N;
    ll mini = INF;
    ll ans = 0;
    vector<ll> P(N);
    REP(i,N){
        cin >> P[i];
    }
    REP(i,N){
        if(P[i]<=mini){
            ans++;
        }
        mini = min(mini,P[i]);
    }
    cout << ans << endl;
    return 0;
}


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

public class Main {
    static StringTokenizer st;
    static BufferedReader br;  
    static PrintWriter out;
 
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));

        String S = next();

        if(S.equals("ABC")){
            System.out.println("ARC");
        }
        else{
            System.out.println("ABC");
        }


    }
    
      
    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }
}


Measured memory_bytes: 32600
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	h := nextInt()
	_ = nextInt()
	orig := ""
	for i := 0; i < h; i++ {
		orig = nextStr()
		fmt.Println(orig)
		fmt.Println(orig)
	}

}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // Default=64
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 1800
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstdio>
#include <stack>

using namespace std;
typedef long long ll;

#define _SI(arr) (sizeof(arr)/sizeof(arr[0])

int main() {
	ll X, A, B;
	cin >> X >> A >> B;
	X -= A;
	while (X - B >= 0)
		X -= B;

	cout << X << endl;
}

Measured memory_bytes: 256
import sys
n=int(input())
a=input()
a0=a.split()
l=list()
b=1
q= "0" in a0
if q==True:
    print(0)
    sys.exit()
for i in range (n):
    a1=int(a0[i])
    b=b*a1
    if b>10**18:
        print(-1)
        sys.exit()
print(b)

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

#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
 
#define rep(i, a, n) for(int i=a; i<n; i++)
#define ll long long
#define all(x) begin(x), end(x)
#define toInt(x) (x - '0')
#define pll pair<ll, ll>
#define pli pair<ll, int>
#define int long long
#define INF 1e+9
#define MAX_V 100008
const int MOD = 1e9 + 7;
const int inf = 1 << 30;



signed main(){
  IOS
  long long X, K, D;
  cin >> X >> K >> D;

  long long cnt = min(K, abs(X) / abs(D));
  long long curr = abs(X) - abs(cnt) * abs(D);
  long long amari = K - cnt;
  // cout << amari << endl;
  if(amari % 2 == 0){
    cout << curr << endl;
  }else{
    cout << abs(curr - D) << endl;
  }
  // cout << curr << endl;
  // if(K % cnt != 0){
  //   cout << curr << endl;
  // }else{
  //   cout << "k" << endl;
  // }

}


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

int count[101]={0};

int main() {
	int n;
	while(scanf("%d",&n) != EOF){
		count[n] = count[n] + 1;
	}
	int max=count[1];
	for(int i=2;i<=100;i=i+1){
		if(count[i] > max){
			max = count[i];
		}
	}
	for(int i=1;i<=100;i=i+1){
		if(count[i] == max){
			cout << i << endl;
		}
	}
	
	return 0;
}

Measured memory_bytes: 3160
using System;


public class hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = double.Parse(line[0]);
        var b = double.Parse(line[1]);
        var dosu = double.Parse(line[2]);
        var c = Math.PI * dosu / 180;
        var s = 0.5 * a * b * Math.Sin(c);
        Console.WriteLine(s);
        var buf = Math.Pow(a, 2d) + Math.Pow(b, 2d) - 2d * a * b * Math.Cos(c);
        Console.WriteLine(a + b + Math.Sqrt(buf));
        Console.WriteLine(b * Math.Sin(c));
    }
}

Measured memory_bytes: 9392
#include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,1,a)
using namespace std;
int main(){
  rep(i,10)
    rep(j,10)
	  cout<<i<<"x"<<j<<"="<<i*j<<endl;
}

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


int main()
{
    int n,x;
    cin >> n>>x;
    vector<int> m(n);
    int d = 1001;
    int sum = 0;
    for(int i = 0; i<n; i++) {
        cin>> m[i];
        sum += m[i];
        d = min(d, m[i]);
    }
        
    cout << (x - sum)/d + n << endl;
    
    return 0;
}

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

int gcd(int x, int y){
    if(x>y){
        swap(x, y);
    }
    if(x==0){
        return y;
    }
    int amari = y%x;
    return gcd(amari, x);
}

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

    // TIPS: i番目の左側と右側で分けて求めていく
    // L[i]はi番目までの最大公約数 i=0~n 1~n
    // R[i]はi番目からの最大公約数 i=0~n 0~n-1
    // i番目を抜いたものの最大公約数はgcd(L[i], R[i+1])となる
    vector<int> L(n+1);
    vector<int> R(n+1); 
    L[0] = 0;
    R[n] = 0;
    for(int i=1; i<n+1; i++){
        L[i] = gcd(L[i-1], a[i-1]);
    }
    for(int i=n-1; i>=0; i--){
        R[i] = gcd(R[i+1], a[i]);
    }
    for(int i=0; i<n; i++){
        gcd_l[i] = gcd(L[i], R[i+1]);
    }
    cout << *max_element(gcd_l.begin(), gcd_l.end()) << endl;

    return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
  double x[1000];
  double y[1000];
  int n;
  cin >>n;
  for (int i = 0; i < n ; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < n ; i++) {
    cin >> y[i];
  }
  double p1 = 0;
  for (int i = 0; i < n ; i++) {
    p1 += abs(x[i] - y[i]);
  }
  
  double p2 = 0;
  for (int i = 0; i < n ; i++) {
    p2 += pow(abs(x[i] - y[i]), 2);
  }
  p2 = sqrt(p2);

  double p3 = 0;
  for (int i = 0; i < n ; i++) {
    p3 += pow(abs(x[i] - y[i]), 3);
  }
  p3 = pow(p3, 1.0 / 3.0);

  double pinf = 0;
  double xy[1000];
  for(int i = 0; i < n ; i++) {
    double now = abs(x[i] - y[i]);
    if (pinf < now) {
        pinf = now;
    }
  }

  printf("%.5f\n", p1);
  printf("%.5f\n", p2);
  printf("%.5f\n", p3);
  printf("%.5f\n", pinf);
}

Measured memory_bytes: 3400
#include <bits/stdc++.h>
#define FOR(i, n) for(ll i = 0; i < n; i++)
#define FORR(i, n) for(ll i = n; i >= 0; i--)
#define FORS(i, m, n) for(int i = m;i < n;i++)
#define ALL(v) accumulate(v.begin(),v.end(),0)
#define SORT(v) sort(v.begin(),v.end())
#define OUT(n) (cout << n << endl)
#define IN1(a) (cin >> a)
#define IN2(a,b) (cin >> a >> b)
#define IN3(a,b,c) (cin >> a >> b >> c)
#define IN4(a,b,c,d) (cin >> a >> b >> c >> d)
#define REVS(v) reverse(v.begin(),v.end())
#define PI 3.14159265359
using namespace std;
typedef long long ll;
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main(){
  string s;
  IN1(s);
  SORT(s);
  if ((s[0] == s[1]) && (s[1] != s[2]) && (s[2] == s[3])){
    OUT("Yes");
  }
  else
  {
    OUT("No");
  }
  
}

Measured memory_bytes: 256
import sys
[print("{0:.3f} {1:.3f}".format((k[2] - k[1] * ((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3]))) / k[0], ((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3])))) for i in sys.stdin for k in [[int(float(j)) for j in i.split()]]]

Measured memory_bytes: 7356
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;
// << fixed << setprecision(0) <<
// sort(ALL(),greater<int>());

int main() {
int n;
cin >> n;
vector<int> v(n);
REP(i,n) {
  cin >> v[i];
}
sort(ALL(v));
double ans=v[0];
REP(i,n-1) {
  ans=(ans+v[i+1])/2;
}
cout << fixed << setprecision(10) << ans << endl;
return 0;
}


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

int main(){
    int N;
    string S;
    cin >> N >> S;
    int ans = 200000;
    vector<int> Black(N+1,0);
    vector<int> White(N+1,0);
    for(int i = 0; i < N; i++)
    {
        if(S[i]=='#'){
            Black[i+1] = Black[i] + 1;
            White[i+1] = White[i];
        }
        else{
            Black[i+1] = Black[i];
            White[i+1] = White[i] + 1;
        }
    }
    
    for(int i = 0; i < N+1; i++)
    {
        ans = min(Black[i]+White[N]-White[i],ans);
    }
    cout << ans << endl;
}

Measured memory_bytes: 2180
#include <bits/stdc++.h>
#define ll long long
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
// rep(i, 1, 4) --> {1,2,3,4}
// rep(i, 4, 1) --> {4,3,2,1}
// rep(it, end(v), begin(v)) --> *it

using namespace std;

int main()
{
    char x, y;
    cin >> x >> y;
    cout << (x>y?">":x<y?"<":"=");
    return 0;
}

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

using namespace std;

static const int INF = 1e9 + 7;

template<typename T>
using Vec = vector<T>;

template<typename T, typename T2>
using P = pair<T, T2>;

template<typename... Args>
using Tup = tuple<Args...>;

template<typename T>
using qp = priority_queue<T, Vec<T>, greater<T> >;

template<typename T>
using pq = priority_queue<T>;

using llong = long long;
using ullong = unsigned long long;
using uint = unsigned int;

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


void hawawa()
{
	int a, b;
	cin >> a >> b;
	cout << a + b / 2 << "\n";
}

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define REP(i,st,ed) for(register int i=st,i##end=ed;i<=i##end;++i)
#define DREP(i,st,ed) for(register int i=st,i##end=ed;i>=i##end;--i)
typedef long long ll;
template<typename T>inline bool chkmin(T &x,T y){return (y<x)?(x=y,1):0;}
template<typename T>inline bool chkmax(T &x,T y){return (y>x)?(x=y,1):0;}
inline int read(){
	int x;
	char c;
	int f=1;
	while((c=getchar())!='-' && (c>'9' || c<'0'));
	if(c=='-') f=-1,c=getchar();
	x=c^'0';
	while((c=getchar())>='0' && c<='9') x=(x<<1)+(x<<3)+(c^'0');
	return x*f;
}
inline ll readll(){
	ll x;
	char c;
	int f=1;
	while((c=getchar())!='-' && (c>'9' || c<'0'));
	if(c=='-') f=-1,c=getchar();
	x=c^'0';
	while((c=getchar())>='0' && c<='9') x=(x<<1ll)+(x<<3ll)+(c^'0');
	return x*f;
}
const int maxn=2e5+10;
ll sum[maxn];
int find(int L,int R){
	if(L==R) return L;
	int l=L,r=R;
	while(L<=R){
		int Mid=(L+R)>>1;
		if(abs(sum[r]-sum[Mid]-sum[Mid]+sum[l-1])<abs(sum[r]-sum[Mid+1]-sum[Mid+1]+sum[l-1])) R=Mid-1;
		else L=Mid+1;
	}
	return R+1;
}
int main(){
	int n=read();
	REP(i,1,n) sum[i]=sum[i-1]+read();
	ll ans=1e18;
	REP(i,0,n){
		int l=find(0,i),r=find(i+1,n);
		ll Max=max(sum[i]-sum[l],sum[l]);
		chkmax(Max,max(sum[n]-sum[r],sum[r]-sum[i]));
		ll Min=min(sum[i]-sum[l],sum[l]);
		chkmin(Min,min(sum[n]-sum[r],sum[r]-sum[i]));
		chkmin(ans,Max-Min);
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 1792