akhauriyash/Code-Regression huggingface dataset:
'''
    Red  Green  Blue
1 <= A  <  B  <  C  <= 7
'''
a, b, c = map(int, input().split())
k = int(input())

def main():
  for x in range(k+1):
    #print("x:{}, k:{}".format(x, k))
    if (x == k) and ((a * (2 ** x)) < b) and (b < c):
      #print("x:{}".format(x))
      return('Yes')
    
    for y in range(k+1):
      if (x + y == k) and ((a * (2 ** x)) < (b * (2 ** y))) and ((b * (2 ** y)) < c):
        #print("x:{}, y:{}".format(x, y))
        return('Yes')
      
      for z in range(k+1):
        if (x + y + z == k) and ((a * (2 ** x)) < (b * (2 ** y))) and ((b * (2 ** y)) < (c * (2 ** z))):
          #print("x:{}, y:{}, z:{}".format(x, y, z))
          return('Yes')

  return('No')

print(main())


Measured memory_bytes: 9220
package main

import (
    "fmt"
    "math"
)

func main() {
    var x int
    fmt.Scan(&x)
    for !isPrime2(x) {
         x++
    }
    fmt.Print(x)
}  
func isPrime2(x int) bool {
    if x == 1 {
        return false
    }
    if x == 2 {
        return true
    }
    if x%2 == 0 {
        return false
    }

    b := true
    rootx := int(math.Sqrt(float64(x)))
    i := 3
    for i <= rootx {
        if x%i == 0 {
            b = false
            break
        }
        i += 2
    }
    return b
}

Measured memory_bytes: 512
import java.math.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        BigInteger TWO = new BigInteger("2");
        Scanner sc = new Scanner(System.in);
        BigInteger x = new BigInteger(sc.next());
        BigInteger k = new BigInteger(sc.next());
        BigInteger d = new BigInteger(sc.next());
        if (x.abs().compareTo(k.multiply(d)) >= 0) {
            System.out.println(x.abs().subtract(k.multiply(d)).abs());
        } else if (x.abs().compareTo(d) < 0) {
            if (k.remainder(TWO).equals(BigInteger.ZERO)) System.out.println(x.abs());
            else System.out.println(x.abs().subtract(d).abs());
        } else {
            BigInteger[] dr = x.abs().divideAndRemainder(d);
            if (k.remainder(TWO).equals(BigInteger.ZERO)) {
                if (dr[0].remainder(TWO).equals(BigInteger.ZERO)) System.out.println(dr[1].abs());
                else System.out.println(d.subtract(dr[1]).abs());
            } else {
                if (dr[0].remainder(TWO).equals(BigInteger.ONE)) System.out.println(dr[1].abs());
                else System.out.println(d.subtract(dr[1]).abs());
            }
        }
    }
}

Measured memory_bytes: 35996
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
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++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
typedef unsigned long long ul;
int n;
ll t1000[4];
void init() {
	t1000[0] = 1;
	rep(i, 3) {
		t1000[i + 1] = t1000[i] * 1000;
	}
}
ll calc(ll a, ll b, ll c, ll d) {
	ll res = INF;
	vector<ll> v = { a,b,c,d };
	rep(j, 4) {
		ll sum = 0;
		rep(k, 4) {
			sum += v[k] * t1000[k];
		}
		res = min(res, sum);
		v.push_back(v[0]);
		v.erase(v.begin());
	}
	return res;
}
ll c[400];
ll turn(ll x) {
	vector<ll> v;
	per(j, 4) {
		v.push_back(x / t1000[j]);
		x %= t1000[j];
	}
	reverse(v.begin(), v.end());
	v.push_back(v[0]); v.erase(v.begin());
	ll res = 0;
	rep(j, 4) {
		res += v[j] * t1000[j];
	}
	return res;
}
vector<ll> query(ll k) {
	vector<ll> res;
	per(j, 4) {
		res.push_back(k / t1000[j]);
		k %= t1000[j];
	}
	reverse(res.begin(), res.end());
	return res;
}
map<ll, int> mp,num;
int main() {
	init();
	cin >> n;
	rep(i, n) {
		ll x, y, z, w; cin >> x >> y >> z >> w;
		c[i] = calc(x, y, z, w);
		mp[c[i]]++;
		ll t = c[i];
		int cnt = 0;
		rep(j, 4) {
			t = turn(t);
			if (t == c[i])cnt++;
		}
		num[c[i]] = cnt;
		//cout << c[i] << endl;
	}
	ll ans = 0;
	rep(i, n) {
		rep(j, n) {
			if (i == j)continue;
			ll t = c[j];
			//cout << i << " " << j << endl;
			rep(k, 4) {
				t = turn(t);
				vector<ll> a1 = query(c[i]), a2 = query(t);
				ll z1 = calc(a1[3], a1[2], a2[1], a2[0]);
				ll z2 = calc(a1[2], a1[1], a2[2], a2[1]);
				ll z3 = calc(a1[1], a1[0], a2[3], a2[2]);
				ll z4 = calc(a1[0], a1[3], a2[0], a2[3]);
				//cout << z1 << endl;
				ll c1 = mp[z1];
				if (z1 == c[i])c1--;
				if (z1 == c[j])c1--;
				ll c2 = mp[z2];
				if (z2 == c[i])c2--;
				if (z2 == c[j])c2--;
				if (z2 == z1)c2--;
				ll c3 = mp[z3];
				if (z3 == c[i])c3--;
				if (z3 == c[j])c3--;
				if (z3 == z1)c3--;
				if (z3 == z2)c3--;
				ll c4 = mp[z4];
				if (z4 == c[i])c4--;
				if (z4 == c[j])c4--;
				if (z4 == z1)c4--;
				if (z4 == z2)c4--;
				if (z4 == z3)c4--;
				c1 *= num[z1];
				c2 *= num[z2];
				c3 *= num[z3];
				c4 *= num[z4];
				//cout << c1 << " " << c2 << " " << c3 << " " << c4 << endl;
				ans += c1 * c2*c3*c4;
			}
		}
	}
	//cout << ans << endl;
	cout << ans / 6 << endl;
	//stop
	return 0;
}


Measured memory_bytes: 161664
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from itertools import combinations_with_replacement, combinations
from operator import mul
from functools import reduce
from operator import mul


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n, m, q = LI()
L = LIR(q)
ans = 0
for arr in combinations_with_replacement(range(1, m + 1), n):
    ret = 0
    for a, b, c, d in L:
        if arr[b - 1] - arr[a - 1] == c:
            ret += d
    ans = max(ans, ret)

print(ans)







Measured memory_bytes: 77604
w,m[];R(char*p){*p>45?*p=0,R(p-1),R(p+1),R(p-w),R(p+w),++*m:0;}main(){for(;scanf("%d%*d",&w)*w;printf("%d\n",*m))bzero(m,999),scanf("%[^0-9]",++w+m),R(strchr(m+w,64));}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define ll long long

using namespace std;

int main() {
  string S;
  cin >> S;
  vector<int> v={0};
  for (int i = 0; i < (int)S.size(); i++) {
    if (S[i] == 'S') {
      v.push_back(0);
    } else {
      v[(int)v.size()-1]++;
    }
  }
  cout << *max_element(v.begin(), v.end()) << endl;
  return 0;
}

Measured memory_bytes: 3608
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

int main(){
    ll N,M;
    cin>>N>>M;
    ll A[M];
    rep(i,M)cin>>A[i];
    ll ans = 0;
    rep(i,M)ans+=A[i];
    if(ans > N)cout<<-1<<endl;
    else cout<<N-ans<<endl;
    return 0;


}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c,K,sum=0;
  cin >> K ;
  
  for(a=1;a<K+1;a++){
    for(b=1;b<K+1;b++){
      for(c=1;c<K+1;c++){
        if(gcd(a,gcd(b,c))==0)
          sum=sum+1;
        else
        sum=sum+gcd(a,gcd(b,c));
      }
    }
  }
    cout << sum <<endl;
}  

Measured memory_bytes: 3628
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define ENDL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
/* libraries */
int powz(int v,int k) { int r(1),t(v); while(k){ if(k&1) r*=t; t*=t; k>>=1; } return r; }

constexpr int MOD = 1e9+7;

signed main() {
	int n;
	std::cin >> n;
	std::vector<std::vector<int> > a(n,std::vector<int>(n));
	rep(i,n) rep(j,n) std::cin >> a[i][j];
	std::vector<std::vector<int> > dp(n+1, std::vector<int>(powz(2,n),0));
	dp[0][0]=1;
	rep(i,n) {
		rep(j,powz(2,n)) {
			if(dp[i][j]) {
				rep(k,n) {
					if(a[i][k] && !(j&(1<<k))) {
						dp[i+1][j|(1<<k)] += dp[i][j];
						dp[i+1][j|(1<<k)] %= MOD;
					}
				}
			}
		}
	}
	print(dp[n][(1<<n)-1]);

	return 0;
}


Measured memory_bytes: 377216
#coding: utf-8

r, c = (int(i) for i in input().split())

s = [[0 for i in range(c+1)] for j in range(r+1)]

for i in range(r):
    s[i] = input().split()
    s[i].append(0)

for i in range(r):
    for j in range(c):
        s[i][j] = int(s[i][j])

for i in range(r):
    x = 0
    for j in range(c):
        x += s[i][j]
    s[i][-1] = x

for i in range(c+1):
    x = 0
    for j in range(r):
        x += s[j][i]
    s[-1][i] = x

for i in range(r+1):
    for j in range(c+1):
        print(s[i][j], end = ' ' if j != c else '\n')


Measured memory_bytes: 6268
def resolve():
    N, H, W = map(int, input().split())
    A = []
    B = []
    for _ in range(N):
        a, b = map(int, input().split())
        A.append(a)
        B.append(b)
    ans = 0
    for i in range(N):
        if A[i] >= H and B[i] >= W:
            ans += 1
    print(ans)
resolve()

Measured memory_bytes: 9104
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  int h,w;
  cin>>h>>w;
  int n;
  cin>>n;
  int v[100][100];
  vi a(n);
  rep(i,n)cin>>a[i];
  int p=0;
  rep(i,h)
    if(i%2){
      for(j=0;j<w;j++){
	v[i][j]=p;
	a[p]--;
	if(a[p]==0)p++;
      }
    }else{
      for(j=w-1;j>=0;j--){
	v[i][j]=p;
	a[p]--;
	if(a[p]==0)p++;
      }
    }
  rep(i,h){
    rep(j,w){
      if(j)cout<<" ";
      cout<<v[i][j]+1;
    }
    cout<<endl;
  }
}


Measured memory_bytes: 384
from collections import Counter

N, X, Y = map(int, input().split())

c = Counter(min(j-i, abs(X-i)+1+abs(j-Y), abs(Y-i)+1+abs(j-X)) for i in range(1, N) for j in range(i+1, N+1))
for i in range(1, N):
    print(c[i])


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

int main() {
	int n;
	while (1) {
		int temp[40] = {};
		cin >> n;
		if (n == 0) break;

		temp[0] = 1;
		for (int i = 0; i < n; i++) {
			temp[i + 1] += temp[i];
			temp[i + 2] += temp[i];
			temp[i + 3] += temp[i];
		}

		cout << temp[n]/3650 + 1 << endl;

	}
	return 0;
}


Measured memory_bytes: 3080
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>

#define ll (long lon
#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

int main (void){
    
    double min_v;
    while(cin >> min_v)
    {
        int i = 1;
        double h = (min_v / 9.8)*(min_v/9.8)*4.9;
        while((5*i-5)<= h)
            i++;
        cout << i << endl;
    }
    
    return 0;
}

Measured memory_bytes: 1224
#[allow(unused_imports)]
use std::cmp::{min,max};
#[allow(unused_imports)]
use std::collections::{BTreeMap,BTreeSet};
#[allow(unused_imports)]
use std::ops::*;
#[allow(unused_imports)]
use std::collections::BinaryHeap;

#[allow(unused_macros)]
macro_rules! tf {
    ($c:expr, $t:expr, $f:expr) => {{
        if $c { $t } else { $f }
    }};
}

fn dfs(field: &mut Vec<Vec<Option<bool>>>, ds: &Vec<(i64,i64)>, y: usize, x: usize, c: bool) {
    let n = field.len() / 2;
    if field[y][x].is_some() {
        return;
    }
    field[y][x] = Some(c);
    for &(dy,dx) in ds {
        let ny = y as i64 + dy;
        let nx = x as i64 + dx;
        if 0 <= ny && ny < 2*n as i64 && 0 <= nx && nx < 2*n as i64 {
            let ny = ny as usize;
            let nx = nx as usize;
            dfs(field, ds, ny, nx, !c);
        }
    }
}

fn main() {
    let (n, d1, d2) = {
        let xs = read_vec_i64();
        (xs[0] as usize, xs[1], xs[2])
    };
    let mut field1 = vec![vec![None; 2*n]; 2*n];
    let mut field2 = vec![vec![None; 2*n]; 2*n];
    let mut d1s = vec![];
    let mut d2s = vec![];
    for i in 0..2*n as i64 {
        for k in 0..2*n as i64 {
            if i * i + k * k == d1 {
                d1s.push((i,k));
                d1s.push((-i,k));
                d1s.push((i,-k));
                d1s.push((-i,-k));
            }
            if i * i + k * k == d2 {
                d2s.push((i,k));
                d2s.push((-i,k));
                d2s.push((i,-k));
                d2s.push((-i,-k));
            }
        }
    }
    for i in 0..2*n {
        for k in 0..2*n {
            dfs(&mut field1, &d1s, i, k, false);
            dfs(&mut field2, &d2s, i, k, false);
        }
    }
    let mut xs = vec![vec![]; 4];
    for y in 0..2*n {
        for x in 0..2*n {
            let t1 = field1[y][x].unwrap();
            let t2 = field2[y][x].unwrap();
            let i = tf!(t1, 2, 0) + tf!(t2, 1, 0);
            xs[i].push((y, x));
        }
    }
    for i in 0..4 {
        if xs[i].len() >= n * n {
            for &(y,x) in xs[i].iter().take(n*n) {
                println!("{} {}", x, y);
            }
            break;
        }
    }
}

#[allow(dead_code)]
fn read_line() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok();
    ret.pop();
    //ret.pop();
    return ret;
}

#[allow(dead_code)]
fn read_i64() -> i64 {
    let ss = read_line();
    return ss.parse::<i64>().unwrap();
}

#[allow(dead_code)]
fn read_vec_i64() -> Vec<i64> {
    let mut res = vec![];
    let ss = read_line();
    for ts in ss.split_whitespace() {
        let x = ts.parse::<i64>().unwrap();
        res.push(x);
    }
    return res;
}

use std::fmt::Display;
#[allow(dead_code)]
fn write_vec<T: Display>(xs: &Vec<T>) {
    if xs.len() == 0 {
        println!("");
        return;
    }
    print!("{}", xs[0]);
    for i in 1..xs.len() {
        print!(" {}", xs[i]);
    }
    println!("");
}


Measured memory_bytes: 44492
#pragma GCC optimize(2)
#include <bits/stdc++.h>
#include<stdio.h>
#include <string.h>
#include<algorithm>
#include <queue>
#include<vector>
typedef long long ll;
const int mod=1e9+7;
const int maxn=2e6+16;
const ll INF=100000000000005;
const double eps=1e-11;
using namespace std;
ll n,m,p;
int main()
{
    ll sum=0;
    scanf("%lld%lld",&n,&m);
    if(n==1) sum+=300000;
    else if(n==2) sum+=200000;
    else if(n==3) sum+=100000;
    if(m==1) sum+=300000;
    else if(m==2) sum+=200000;
    else if(m==3) sum+=100000;
    if(n==1&&m==1) sum+=400000;
    printf("%lld\n",sum);
    return 0;
}



Measured memory_bytes: 256
#include <cstdio>
#include <string>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;

class Node
{
public:
	vector<int> to,c;
};

class Trl
{
public:
	int p,c,pv,sec;
	Trl(int p, int c, int pv,int sec)
	:p(p),c(c),pv(pv),sec(sec)
	{}
	
	bool operator<(const Trl& t) const
	{
		if(c!=t.c) return c>t.c;
		if(sec!=t.sec) return sec>t.sec;
		return p>t.p;
	}
};

int nt[32][32],ld[32][32];
Node node[32];

void Dijkstra(int src, int dst)
{
	priority_queue<Trl> q;
	q.push(Trl(src,0,src,-1));
	
	int v[32];
	for(int i=0; i<32; i++) v[i]=-1;
	
	while(!q.empty())
	{
		Trl t=q.top(); q.pop();
		if(v[t.p]!=-1) continue;
		v[t.p]=t.pv;
		
		if(t.p==dst)
		{
			nt[src][dst]=t.sec;
			break;
		}
		for(int i=0; i<node[t.p].to.size(); i++)
		{
			int next=node[t.p].to[i];
			if(v[next]!=-1) continue;
			
			q.push(Trl(next, t.c+node[t.p].c[i], t.p, (t.sec==-1?next:t.sec)));
		}
	}
}

enum EV{BACK, GO};

class Event
{
public:
	EV ev;
	int p,dst,t,ot;
	string n;
	
	Event(int p, int dst, int t, int ot, EV ev, string n)
	:p(p),dst(dst),t(t),ot(ot),ev(ev),n(n)
	{}
	
	bool operator<(const Event& e) const
	{
		if(t!=e.t) return t>e.t;
		if(ev!=e.ev) return ev>e.ev;
		if(p==dst&&e.p==e.dst) return n>e.n;
		if(ot!=e.ot) return ot>e.ot;
		return nt[p][dst]>nt[e.p][e.dst];
	}
};

void Sim()
{
	int K;
	scanf("%d", &K);
	priority_queue<Event> q;
	while(K--)
	{
		int s,d,t;
		char n[51];
		scanf("%d%d%d%s",&s,&d,&t,n);
		s--; d--;
		q.push(Event(s,d,t,t,GO,string(n)));
	}
	
	int lv[32]={0};
	while(!q.empty())
	{
		Event e=q.top(); q.pop();
		if(e.ev==BACK)
		{
			lv[e.dst]=0;
			continue;
		}
		
		if(e.p==e.dst)
		{
			printf("%s %d\n", e.n.c_str(), e.t);
		}
		else
		{
			if(lv[e.p]!=0)
			{
				q.push(Event(e.p, e.dst, lv[e.p], e.ot, e.ev, e.n));
			}
			else
			{
				int next=nt[e.p][e.dst], cst=e.t+ld[e.p][next];
				lv[e.p]=cst+ld[e.p][next];
				q.push(Event(next, e.dst, cst, cst,e.ev, e.n));
				q.push(Event(e.p, e.p, lv[e.p],lv[e.p], BACK, ""));
				
				priority_queue<Event> tmp;
				while(!q.empty())
				{
					Event te=q.top();
					if(te.t!=e.t) break;
					if(next==nt[te.p][te.dst]&&te.p==e.p)
					{
						q.push(Event(next, te.dst, cst, cst,te.ev, te.n));
					}
					else tmp.push(te);
					q.pop();
				}
				
				while(!tmp.empty())
				{
					q.push(tmp.top()); tmp.pop();
				}
			}
		}
	}
}

int main()
{
	int N,M;
	bool fr=true;
	while(scanf("%d%d", &N, &M), (N||M))
	{
		for(int i=0; i<32; i++)
		{
			node[i].to.clear();
			node[i].c.clear();
		}
		
		while(M--)
		{
			int s,d,c;
			scanf("%d%d%d", &s,&d,&c);
			s--; d--;
			
			node[s].to.push_back(d);
			node[d].to.push_back(s);
			node[s].c.push_back(c);
			node[d].c.push_back(c);
			ld[s][d]=c;
			ld[d][s]=c;
		}
		
		for(int i=0; i<N; i++)
		for(int j=0; j<N; j++)
			Dijkstra(i,j);
			
		if(!fr) puts("");
		fr=false;
		
		Sim();
	}
}

Measured memory_bytes: 984
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<pi, pi> pp;
typedef pair<ll, ll> pl;
double PI = 3.1415926535897932;
const double EPS = 1e-9;
const ll MOD = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;

int n;
double d1;
double x;
double ans = 0.0;

int main() {
    cin >> n >> d1 >> x;
    for (int i = n; i >= 1; i--) {
        ans += d1 - 1.5*x + x*(i+1);
        d1 = (i+1)*d1/(double)i + 5*x/(double)(2*i);
        x = x + 2*x/(double)i;
    }
    printf("%.9f\n", ans);
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
using namespace std;
int H[200005];
int main(void)
{
	double N;
	long long sum=0;
	cin >> N;
	while(N!=1)
	{
		N=floor(N/2);
		sum++;
	}
	sum=pow(2.0, sum+1);
	cout << --sum;
}


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

unsigned long long popcount(unsigned long long x) {
  x = ((x & 0xaaaaaaaaaaaaaaaaUL) >> 1) + (x & 0x5555555555555555UL);
  x = ((x & 0xccccccccccccccccUL) >> 2) + (x & 0x3333333333333333UL);
  x = ((x & 0xf0f0f0f0f0f0f0f0UL) >> 4) + (x & 0x0f0f0f0f0f0f0f0fUL);
  x = ((x & 0xff00ff00ff00ff00UL) >> 8) + (x & 0x00ff00ff00ff00ffUL);
  x = ((x & 0xffff0000ffff0000UL) >> 16) + (x & 0x0000ffff0000ffffUL);
  x = ((x & 0xffffffff00000000UL) >> 32) + (x & 0x00000000ffffffffUL);
  return x;
}

struct node {
  int ok;
  array<int, 26> to;
  node() {
    ok = 0;
    for (int i = 0; i < 26; ++i) to[i] = -1;
  }
};

int n;
vector<string> s;
vector<node> trie;

long long solve();

int main() {
  cin >> n;
  s.resize(n);
  for (auto &p : s) {
    cin >> p;
    reverse(p.begin(), p.end());
  }
  sort(s.begin(), s.end(),
       [](string &l, string &r) { return l.size() < r.size(); });
  cout << solve() << endl;
  return 0;
}

long long solve() {
  long long res = 0;
  node uni;
  trie.push_back(uni);
  for (int i = 0; i < n; ++i) {
    int len = s[i].size(), id = 0;
    vector<int> memo(len + 1, 0);
    for (int j = len - 1; j >= 0; --j)
      memo[j] = memo[j + 1] | (1LL << (s[i][j] - 'a'));
    for (int j = 0; j < len; ++j) {
      int c = s[i][j] - 'a';
      res += popcount(memo[j] & trie[id].ok);
      if (trie[id].to[c] < 0) {
        trie[id].to[c] = trie.size();
        trie.push_back(uni);
      }
      if (j == len - 1) trie[id].ok |= 1 << c;
      id = trie[id].to[c];
    }
  }
  return res;
}


Measured memory_bytes: 119812
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
constexpr ll INF = 9e18;
constexpr int inf = 1e9;
const double INFD = 1e100;
const ll mod = 1000000007;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
};
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
};

// intやllをstringに変換
template<typename T> inline string toString(const T &a){
  ostringstream oss;
  oss << a;
  return oss.str();
};
// ----------------------------------------------------------------------------

// http://drken1215.hatenablog.com/entry/2019/05/28/124300
// けんちょんさんのUnion Find
struct UnionFind {
    vector<int> par, w;

    UnionFind(int n) : par(n, -1), w(n, 0) { }
    void init(int n) { par.assign(n, -1); w.assign(n, 0); }

    int root(int x) {
        if (par[x] < 0) 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) {
            ++w[x];
            return false;
        }
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        w[x] += w[y];
        ++w[x];
        return true;
    }

    int size(int x) {
        return -par[root(x)];
    }

    int wei(int x) {
        return w[root(x)];
    }
};


int main(){
  int N,M,K;
  cin >> N >> M >> K;
  UnionFind uf(N);
  vector<int> cnt(N,0);
  for(int i=0; i<M; i++){
    int a,b;
    cin >> a >> b;
    a--;
    b--;
    cnt[a]++;
    cnt[b]++;
    uf.merge(a,b);
  }
  vector<vector<int>> B(N);
  for(int i=0; i<K; i++){
    int c,d;
    cin >> c >> d;
    c--;
    d--;
    B[c].push_back(d);
    B[d].push_back(c);
  }
  for(int i=0; i<N; i++){
    if(i){
      cout << " ";
    }
    int sum = uf.size(i);
    sum--;
    sum -= cnt[i];
    for(auto v: B[i]){
      if(uf.issame(v,i)){
        sum--;
      }
    }
    cout << sum;
  }
  cout << endl;
  return 0;
}


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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        
        int K = sc.nextInt();
        
        if(A>=B && A>=C){
        	int A_mult = A;
        	for(int k=0;k<K;k++) A_mult *= 2;
        	System.out.println(A_mult+B+C);
        }else if(B>=C){
        	int B_mult = B;
        	for(int k=0;k<K;k++) B_mult *= 2;
        	System.out.println(A+B_mult+C);
        }else{
        	int C_mult = C;
        	for(int k=0;k<K;k++) C_mult *= 2;
        	System.out.println(A+B+C_mult);
        }
    }
}

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

int main() {
    int A, B, C;
    cin >> A >> B >> C;

    if (A == B) {
        cout << C << endl;
    } else if (B == C) {
        cout << A << endl;
    } else {
        cout << B << endl;
    }
}

Measured memory_bytes: 256
'use strict';

function Main(INPUT) {
    const input = INPUT.split("\n");
    const T = Number(input[0].split(" ")[1]);
    input.shift();
    let min = 9999;
    for (let i = 0; i < input.length; i++) {
        let tmp = input[i].split(" ").map(n => Number(n));
        if (tmp[1] <= T && tmp[0] < min) {
            min = tmp[0];
        }
    }
    console.log(min == 9999 ? "TLE" : min);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 11596
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
  int N;
  cin >> N;
  vector<ll> A(N);
  for(int i = 0; i < N; i++) {
    ll B;
    cin >> B;
    A[i] = B * 1000000 + i;
  }
  sort(A.begin(), A.end());
  ll x = A[N - 1] % 1000000;
  ll ans = (A[N - 1] - x) / 1000000;
  for(int i = 0; i < N; i++) {
    if(i != x) {
      cout << ans << endl;
    }
    else {
      ll y = A[N - 2] % 1000000;
      cout << (A[N - 2] - y) / 1000000 << endl;
    }
  }
}

Measured memory_bytes: 4828
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n, m; cin >> n >> m;
    vector<pair<int, int>> rng(m);
    for (auto &p: rng) cin >> p.first >> p.second, p.first--, p.second--;
    rng.emplace_back(0, 0); rng.emplace_back(n, n);
    sort(rng.begin(), rng.end());
    int left = 0, right = 0;
    int ans = 0;
    for (auto p: rng) {
        if (right <= p.first) {
            ans += (right - left) * 3;
            ans += p.first - right;
            left = p.first, right = p.second;
        } else {
            right = max(right, p.second);
        }
    }
    cout << ans + 1 << endl;
    return 0;
}


Measured memory_bytes: 3124
#include<bits/stdc++.h>
#include<iostream>
#include<math.h>
#include<algorithm>
#include<string>
using namespace std;
int main(){
	int N,M;
	int h[100],m[100],k[100],g[100];
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>h[i]>>m[i];
	}
	cin>>M;
	for(int i=0;i<M;i++){
		cin>>k[i]>>g[i];
	}
	int n[200];
	for(int i=0;i<N+M;i++){
		if(i<N){
			n[i]=h[i]*60+m[i];
		}
		else{
			n[i]=k[i-N]*60+g[i-N];
		}
	}
	sort(n,n+N+M);
	if(n[0]%60>=10){
		cout<<n[0]/60<<':'<<n[0]%60;
	}
	else{
		cout<<n[0]/60<<':'<<0<<n[0]%60;
	}
	for(int i=1;i<N+M+1;i++){
		if(n[i]!=n[i-1] && i!=N+M){
		if(n[i]%60>=10){
			if(i<N+M-1){
				cout<<' '<<n[i]/60<<':'<<n[i]%60;
			}
			else{
				cout<<' '<<n[i]/60<<':'<<n[i]%60;
			}
		}
      else{
			if(i<N+M-1){
				cout<<' '<<n[i]/60<<':'<<0<<n[i]%60;
			}
			else{
				cout<<' '<<n[i]/60<<':'<<0<<n[i]%60;
			}
		}
	}
	else if(i==N+M){
		cout<<endl;
	}
}
	/*int N;
	cin>>N;
	int K[100],P[100];
	for(int i=0;i<N;i++){
		cin>>K[i]>>P[i];
	}
	for(int i=0;i<N;i++){
		if(K[i]%P[i]==0){
			cout<<P[i]<<endl;
		}
		else{
			cout<<K[i]%P[i]<<endl;
		}
*/
	/*int c1,c5,c10,c50,c100,c500;
	cin>>c1>>c5>>c10>>c50>>c100>>c500;
	if(c1+c5*5+c10*10+c50*50+c100*100+c500*500>=1000){
		cout<<1<<endl;
	}
	else{
		cout<<0<<endl;
	}*/
	/*int d,c;
	cin>>d>>c;
	cout<<d*c<<endl;*/
	//cout << "Hello world!!" << endl;
	return 0;
}



Measured memory_bytes: 3172
#include<stdio.h>
int main(){
int a[15][15],i,j,x,y,s,e=0,max=0;
for(i=2;i<12;i++){
for(j=2;j<12;j++){
a[i][j]=0;
}
}
while(scanf("%d,%d,%d\n",&x,&y,&s)!=EOF){
x=x+2,y=y+2;
if(s==1){
a[y][x]++;
a[y+1][x]++;
a[y-1][x]++;
a[y][x+1]++;
a[y][x-1]++;
}
else if(s==2){
for(i=y-1;i<y+2;i++){
for(j=x-1;j<x+2;j++){
a[i][j]++;
}
}
}
else{
for(i=y-1;i<y+2;i++){
for(j=x-1;j<x+2;j++){
a[i][j]++;
}
}
a[y+2][x]++;
a[y-2][x]++;
a[y][x+2]++;
a[y][x-2]++;
}
}
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(a[i][j]==0){
e++;
}
if(a[i][j]>max){
max=a[i][j];
}
}
}
printf("%d\n%d\n",e,max);
return 0;
}


Measured memory_bytes: 2060
// if文による条件分岐　比較演算子
#include <stdio.h>
#include <stdlib.h>
int main(void){
    char buf[100];
    int a,b,c,d;
    fgets(buf,sizeof(buf),stdin);
    sscanf(buf, "%d %d %d %d",&a, &b, &c, &d);
    int l1,l2,l3;
    l1=abs(b-a);
    l2=abs(c-b);
    l3=abs(c-a);
    if (l3<=d || (l1<=d && l2<=d)) {
        printf("Yes");
    } else {
        printf("No");
    }
}

Measured memory_bytes: 128
A, B = map(int, input().split())

if A < B:
    if A == 1:
        ans = 'Alice'
    else:
        ans = 'Bob'
elif B < A:
    if B == 1:
        ans = 'Bob'
    else:
        ans = 'Alice'
else:
    ans = 'Draw'

print(ans)

Measured memory_bytes: 9040
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
using namespace std;

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

typedef pair<int, int>P;
#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()



string s[3];

//i番目の後ろx文字とj番目の後ろy文字が矛盾しない
bool b[3][3][2001][2001];

bool match(char c1, char c2) {
	if (c1 == '?' || c2 == '?')return true;
	return c1 == c2;
}
void solve() {
	rep(i, 3)cin >> s[i];
	rep(i, 3)rep(j, 3) {
		if (i == j)continue;
		int l1 = s[i].size();
		int l2 = s[j].size();
		for (int k = 0; k <= l1; k++) {
			b[i][j][k][0] = true;
			for (int l = 1; l + k <= l1 && l <= l2; l++) {
				if (!match(s[i][l1 - l - k], s[j][l2 - l]))break;
				b[i][j][k + l][l] = true;
			}
		}
		for (int k = 0; k <= l2; k++) {
			b[i][j][0][k] = true;
			for (int l = 1; l + k <= l2 && l <= l1; l++) {
				if (!match(s[i][l1 - l], s[j][l2 - l - k]))break;
				b[i][j][l][l + k] = true;
			}
		}
	}
	int ans = 0;
	rep(i, 3)ans += s[i].size();
	vector<int> v(3); rep(i, 3)v[i] = i;
	while (true) {
		int l1 = s[v[0]].size();
		int l2 = s[v[1]].size();
		int l3 = s[v[2]].size();
		for (int x = 0; x <= 4000; x++) {
			for (int y = 0; y <= 4000; y++) {
				//2 and 3
				int c = l2 - x; if (c < 0)c = 0;
				if (!b[v[1]][v[2]][c][l3])continue;
				//1 and 2
				c = l1 - y; if (c < 0)c = 0;
				if (!b[v[0]][v[1]][c][l2])continue;
				//1 and 3
				c = l1 - (x + y); if (c < 0)c = 0;
				if (!b[v[0]][v[2]][c][l3])continue;
				int las = max({ l1,l2 + y,l3 + x + y });
				ans = min(ans, las);
			}
		}
		if (!next_permutation(all(v)))break;
	}
	cout << ans << endl;
}


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


Measured memory_bytes: 28928
import math

A,B,H,M = map(int, open(0).read().split())

h=(H%12)+(M%60)/60.0
x0=A*math.sin(math.pi*2*h/12.0)
y0=A*math.cos(math.pi*2*h/12.0)
x1=B*math.sin(math.pi*2*(M%60)/60.0)
y1=B*math.cos(math.pi*2*(M%60)/60.0)

#print(x0,y0,x1,y1)
print(((x0-x1)**2+(y0-y1)**2)**.5)


Measured memory_bytes: 9464
#include <iostream>
#include <cstdio>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());


map<string,ll> ma;

int main(){
	vector<string> v;
	ll n;
	cin>>n;
	rep(i,n){
		string s;
		ll a;
		cin>>s>>a;
		v.PB(s);
		ma[s]+=a;
	}
	sort(ALL(v));
	v.erase(unique(ALL(v)),v.end());
	vector<pair<int,string> > vv;
	rep(i,v.size()){
		vv.PB(mkp(v[i].size(),v[i]));
	}
	sort(ALL(vv));
	rep(i,vv.size()){
		cout<<vv[i].S<<" "<<ma[vv[i].S]<<endl;
	}
}

Measured memory_bytes: 1700
#include <bits/stdc++.h>
#define rep(begin, end) for (i=begin;i<end;i++)
#define repj(begin, end) for (j=begin;j<end;j++)
#define init(arr, end, val) for (i=0;i<end;i++) arr[i] = val;
#define printint(i0, i1) printf("%d %d\n", i0, i1)

using namespace std;
typedef long long int ll;
const int inf = 1000000000;
const int mod = 1000000007;
const int nil = -1;
int i, n, m, a, b, ans;
ll h[100000];
int terrace[100000];

int main() {
    scanf(" %d %d", &n, &m);
    rep(0,n) {
        scanf(" %lld", &h[i]);
        terrace[i] = 1;
    }
    rep(0,m) {
        scanf( "%d %d", &a, &b);
        if (h[a-1] >= h[b-1])  terrace[b-1] = 0;
        if (h[a-1] <= h[b-1])  terrace[a-1] = 0;
    }
    ans = 0;
    rep(0,n) ans += terrace[i];

    printf("%d\n", ans);
}

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

#define repeat(i, n) for (int i = 0; (i) < (n); ++(i))

const int INF = 1001001001;

int main()
{
    int N, M, L;
    cin >> N >> M >> L;

    // 全点間最短路を求めるための2次元配列を定義
    // 各町を頂点、各道を辺、各辺の距離は道の距離
    vector<vector<int>> dist(N, vector<int>(N, INF)); // a,b間の辺が存在しないときはINF扱い(INT_MAXだと値がオーバーフローする可能性があった)
    repeat(i, N) dist[i][i] = 0; // a=bのときは0
    repeat(i, M){
        int a, b, c;
        cin >> a >> b >> c;
        a--; // 1から始まるので0にしとく
        b--;
        dist[a][b] = dist[b][a] = c; // a,b間のコストを入れる（a,bのペアが重複する場合はminを取る必要がある）
    }

    // ワーシャルフロイドで全点間最短路を求める=各町間の最短距離
    repeat(k, N) repeat(i, N) repeat(j, N) {
        dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
    }

    // グラフその2を作る
    // 各町を頂点、最短距離がL以下である町の組の間に距離1の辺を張る
    vector<vector<int>> dist2(N, vector<int>(N, INF));
    repeat(i, N) repeat(j, N){
        if (dist[i][j] <= L) dist2[i][j] = 1;
    }
    // ワーシャルフロイドをグラフ2に対してもやる
    // = 各町間を移動する際に必要な燃料補給回数の最小値が求められる
    repeat(k, N) repeat(i, N) repeat(j, N) {
        dist2[i][j] = min(dist2[i][j], dist2[i][k] + dist2[k][j]);
    }

    int Q;
    cin >> Q;
    repeat(i, Q){
        int s, t;
        cin >> s >> t;
        s--;
        t--;
        int ans = dist2[s][t] - 1; // 最初は燃料MAXなので1回分の補給は無視する
        if (dist2[s][t] == INF) ans = -1; // 道がない経路は-1
        cout << ans << endl;
    }
}

Measured memory_bytes: 1280
# a[i] + 1 < a[i+1] -> not exist
# a[i] + 1 == a[i+1] -> x[i] (only), x[i+1] (nonly) or reverse
# a[i] (nonly) == a[i+1] -> x[i+1] (nonly)
# a[i] (only) == a[i+1] -> x[i+1] (only)

n = gets.to_i
a = gets.split.map(&:to_i).sort
Y = "Yes"
N = "No"

if a[0] + 1 < a[-1]
    puts N
elsif a[0] + 1 == a[-1]
    x = a.index(a[-1])
    y = n - x

    s = a[0] - x + 1
    t = a[-1] - y + 1
    puts (s > 0 && s <= y / 2) || (t > 0 && t <= x / 2) ? Y : N
else
    puts a[0] == n - 1 || a[0] <= n / 2 ? Y : N
end

Measured memory_bytes: 22020
#include <iostream>
#include <bits/stdc++.h>
#define ll long long

using namespace std;
int n,m,a[1010],dp[1010][(1 << 12) + 10];
vector < int > v[1010];
const int Inf = 1e9;

int Rec(int i , int Mask){

    if(i == m)  return (Mask == ((1 << n) - 1) ? 0 : Inf);

    if(dp[i][Mask] != -1)  return dp[i][Mask];

    int Res = Inf , temp = 0;
    for(auto j : v[i])  temp|=(1 << j);
    Res = min(Res , a[i] + Rec(i + 1 , Mask | temp));
    Res = min(Res , Rec(i + 1 , Mask));

    return dp[i][Mask] = Res;
}

int main()
{
    memset(dp , -1 , sizeof(dp));
    cin >> n >> m;
    for(int i = 0;i<m;i++){
        int b;
        cin >> a[i] >> b;
        for(int j = 0;j<b;j++){
            int c;  cin >> c;
            v[i].push_back(c - 1);
        }
    }
    cout << (Rec(0 , 0) == Inf ? -1 : Rec(0 , 0));
    return 0;
}


Measured memory_bytes: 16640
#include<bits/stdc++.h>
#define MIN -1000000
using namespace std;
typedef long long ll;
typedef pair <int,int> pii;
bool visited[100005];
const int max_N=1e5+10;
int H,W,h,w;
int board[105][105];
int mxindex,mxchain=0;
int main(void)
{
  cin >> H >> W;
 cin >> h >> w;
 cout << (H-h)*(W-w) << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
	int num[10],i,x[100000],j=0;
	double ans,spd[2],sum;
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%lf,%lf",&num[0],&num[1],&num[2],&num[3],&num[4],&num[5],&num[6],&num[7],&num[8],&num[9],&spd[0],&spd[1])!=EOF){
		sum=0;
		for(i=0;i<10;i++)sum+=num[i];
		ans=(spd[0] * spd[1]) / (spd[0] + spd[1]) * sum / spd[1];
	
		i=0;
		while(ans!=0 && ans>=0){
			ans-=num[i];
			++i;
		}
		x[0]=i;
		printf("%d\n",x[0]);
	}
	
return 0;
}

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

using namespace std;
// #define int long long
mt19937 rnd(time(0));
typedef long long ll;
typedef long double ld;

// #define _GLIBCXX_DEBUG
#define f first
#define s second
#define pb push_back
#define pii pair<int, int> 
#define vi vector<int>

void solve(){
    string s;
    cin >> s;
    int ans =0 ;
    for (int i = 0; i < s.size() / 2; ++i) {
        ans += (s[i] != s[s.size() - 1 - i]);
    }
    cout << ans << endl;
}

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int t = 1;
    while(t--){
        solve();
    }
    
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}

#define rep(i,n) for(ll i=0;i<(ll)n;i++)
#define rep2(i, begin_i, end_i) for (ll i = (ll)begin_i; i < (ll)end_i; i++)

long long INF = 1LL<<60;
int n;
int main(){
    string s,t;
    cin>>s>>t;
    cout<<t<<s<<endl;
    return 0;
}




Measured memory_bytes: 256
T = int(input())
 
for t in range(T):
    N, A, B, C, D = map(int, input().split())
    memo = {}
 
    def dist(n):
        if n == 0:
            return 0
        if n == 1:
            return D
        if n in memo:
            return memo[n]
        
        ret = min(
            D * n,
            D * abs(n - n//5*5) + C + dist(n//5),
            D * abs(n - (n+4)//5*5) + C + dist((n+4)//5),
            D * abs(n - n//3*3) + B + dist(n//3),
            D * abs(n - (n+2)//3*3) + B + dist((n+2)//3),
            D * abs(n - n//2*2) + A + dist(n//2),
            D * abs(n - (n+1)//2*2) + A + dist((n+1)//2)
        )
 
        memo[n] = ret
        return ret
    print(dist(N))

Measured memory_bytes: 82448
package main

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

var scanner *bufio.Scanner

func printIt() {
	n := nextInt()
	aScore := 0
	bScore := 0
	for i := 0; i < n; i++ {
		a := nextString()
		b := nextString()
		if a < b {
			bScore += 3
		} else if a > b {
			aScore += 3
		} else {
			aScore++
			bScore++
		}
	}
	fmt.Println(aScore, bScore)
}

func nextInt() int {
	scanner.Scan()
	num, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(1)
	}
	return num
}

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

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



Measured memory_bytes: 1084
input_line = input().split()
N = int(input_line[0])
M = int(input_line[1])

import math

def combination(n, r):
    if(n == 1 or n == 0):
        return 0
    else:
        return math.factorial(n) // math.factorial(n-r) // math.factorial(r)

print(combination(N,2) + combination(M,2))


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

typedef struct point
{
  double x, y;
}point;

// @param d : 深さ
void koch(int d, point p1, point p2)
{
  if(d == 0) return ;

  point s, t, u;
  double th = M_PI * 60.0 / 180.0;
  s.x = (2.0 * p1.x + 1.0 * p2.x) / 3.0;
  s.y = (2.0 * p1.y + 1.0 * p2.y) / 3.0;
  t.x = (1.0 * p1.x + 2.0 * p2.x) / 3.0;
  t.y = (1.0 * p1.y + 2.0 * p2.y) / 3.0;
  u.x = (t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
  u.y = (t.x - s.x) * sin(th) + (t.y - s.y) * cos(th) + s.y;

  koch(d - 1, p1, s);
  printf("%.8f %.8f\n", s.x, s.y);
  koch(d - 1, s, u);
  printf("%.8f %.8f\n", u.x, u.y); // NG
  koch(d - 1, u, t);
  printf("%.8f %.8f\n", t.x, t.y);
  koch(d - 1, t, p2);
}

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

  point p1, p2;
  p1.x = 0, p1.y = 0;
  p2.x = 100, p2.y = 0;

  printf("%.8f %.8f\n", p1.x, p1.y);
  koch(n, p1, p2);
  printf("%.8f %.8f\n", p2.x, p2.y);

  return 0;
}


Measured memory_bytes: 3228
#include <iostream>
#include <map>
#include <algorithm>
#include <string>
#include <vector> 
#include <numeric>
#include <cmath>
#include <queue>
#include <iomanip>
#include <functional>


#define CHMAX(a,b) a = std::max(a,b)
#define CHMIN(a,b) a = std::min(a,b)
#define CHABS(a) a = std::abs(a) 
#define COUT(a) std::cout << a << std::endl
#define CERR(a) std::cerr << a << std::endl
#define FOR(n) for(lli i = 0; i < n; i++)

using namespace std;
using lli = long long int;
using pll = pair<lli, lli>;
using tlll = tuple<lli, lli, lli>;
using vll = vector<lli>;

lli mod197 = 1000000007LL;
lli INF = 10000000000000;

// ax + by = gcd(a,b) 最大公約数
template< typename T >
T extgcd(T a, T b, T& x, T& y) {
	T d = a;
	if (b != 0) {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
	else {
		x = 1;
		y = 0;
	}
	return d;
}

int main(void) {

	lli N, M;
	cin >> N >> M;

	priority_queue<lli> q;

	//M回/2できるつまり、最大を/2して続けばいい

	for (int i = 0; i < N; i++) {
		lli A;
		cin >> A;
		q.push(A);
	}

	for (int i = 0; i < M; i++) {
		lli t = q.top();
		q.pop();
		t /= 2;
		q.push(t);
	}

	lli ans = 0;

	for (int i = 0; i < N; i++) {
		ans += q.top();
		q.pop();
	}

	COUT(ans);

	return 0;
}

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

#define ft first
#define sd second

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> tri;

const int MAXN = 100 * 1000 + 123;



unordered_map<int, int> d[MAXN];
unordered_map<int, vector<int>> g[MAXN];
int n, m;

inline void inp();
inline void bfs();
inline bool upd(int&, const int);

int main() {/*only 1 tof left??*/
	inp();
	bfs();
	printf("-1");
	return 0;
}
inline void inp() {
	scanf("%d%d", &n, &m);
	int p, q, c;
	for (int i = 0; i < m; i++) {
		scanf("%d%d%d", &p, &q, &c);
		g[--p][c].push_back(--q), g[q][c].push_back(p);
	}
}
inline bool upd(int &x, const int y) { return ((x == 0 || y < x)? x = y, true: false); }
inline void bfs() {
	deque<tri> deq;
	d[0][0] = 0;
	deq.push_back({{0, 0}, 0});
	while (!deq.empty()) {
		tri v = deq.front();
		deq.pop_front();
		if (v.sd != d[v.ft.ft][abs(v.ft.sd)])
			continue;
		if (v.ft.ft == n - 1) {
			printf("%d", v.sd);
			exit(0);
		}
		if (v.ft.sd) {
			if (upd(d[v.ft.ft][0], v.sd))
				deq.push_front({{v.ft.ft, 0}, v.sd});
			for (auto &u : g[v.ft.ft][v.ft.sd]) {
				auto &tif = d[u][v.ft.sd];
				if (upd(tif, v.sd))
						deq.push_front({{u, v.ft.sd}, tif});
			}
		}
		else {
			for (auto &i : g[v.ft.ft])
				if (upd(d[v.ft.ft][i.ft], v.sd + 1))
					deq.push_back({{v.ft.ft, i.ft}, v.sd + 1});
		}
	}
}

Measured memory_bytes: 69376
#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    int q;
    cin>>q;
    while(q--)
    {
        int k;
        cin>>k;
        cout<<lower_bound(a,a+n,k)-a<<endl;
    }
    return 0;
}



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

int main(void)
{
    int k,n,amx=0,ans=0,a0;
    cin >> k >> n;

    vector<int> a(n);

    rep(i, n){
        cin >> a.at(i);
        if(i>0){
            ans += a.at(i)-a.at(i-1);
            amx=max(amx,a.at(i)-a.at(i-1));
        }
    }
    a0 = k-a.at(n-1) + a.at(0);
    if(amx>a0){
        ans += a0-amx;
    }

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


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()
#define CERR if(false) cerr
#define INT_MAX_HALF (INT_MAX / 2)
#define EPS (1e-10)

typedef long long ll;

using namespace std;


int main(){

    int n;
    cin >> n;

    map<int,int> m;

    rep(i,n){
        int tmp;
        cin >> tmp;

        m[tmp]++;
    }

    if(m.size() == n){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    return 0;
}


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

int main() {
  int n;ll k;
  cin >> n >> k;
  vector<P>data(n);
  rep(i,n) cin >> data[i].first >> data[i].second;
  sort(data.begin(),data.end());
  ll cnt = 0;
  rep(i,n){
    cnt += data[i].second;
    if(cnt >= k){
      cout << data[i].first;
      return 0;
    }
  }
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main () {
    int N, T;
    int t, X = 0, e = 0;
    scanf("%d%d", &N, &T);
    for (int i = 0; i < N; i++) {
        scanf("%d", &t);
        if (e <= t) {
            X += T;
        }
        else {
            X += t + T - e;
        }
        e = t + T;
    }
    printf("%d\n", X);
}

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

typedef long long int ll;
typedef pair<ll, ll> p_ll;
typedef vector<pair<ll, ll>> vec_p; //vector<pair<ll, ll>> pairs(n) ,pairs.at(i) = make_pair(i*i, i)

#define ture ture
#define flase false
#define falg flag

#define REP(i, x) for (ll i = 0; i < (ll)(x); i++)
#define REPS(i, x) for (ll i = 1; i <= (ll)(x); i++)
#define RREP(i, x) for (ll i = ((ll)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (ll i = ((ll)(x)); i > 0; i--)
#define all(x) (x).begin(), (x).end()

const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;//llの最大9*10^18
const int INF = pow(2, 30) - 1;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

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

    ll N=0;
    string S,T;
    cin >> S>>T;

    REP(i,S.size()){
        if(!(S.at(i)==T.at(i))){
            N = 1;
        }
    }
    if(N==0){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}


Measured memory_bytes: 3616
import java.io.*;
public class Main{
    public static void main(String[] args) throws IOException{
        Reader r = new Reader();
        int[] a = r.ii();
        int ans = 0;
        for(int i = a[0]; i <= a[1]; i++){
            String s = String.valueOf(i);
            if(s.charAt(0) != s.charAt(4) || s.charAt(1) != s.charAt(3))
                continue;
            ans++;
        }
        print(ans);
    }

    static void print(Object o){
        System.out.println(o.toString());
    }
    static class Reader extends BufferedReader{
        Reader(){
            super(new InputStreamReader(System.in));
        }

        String s() throws IOException{
            return readLine();
        }

        String[] ss() throws IOException{
            return s().split(" ");
        }

        int Int(String s){
            return Integer.parseInt(s);
        }

        int i() throws IOException{
            return Int(s());
        }

        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }
    }
}


Measured memory_bytes: 24404