akhauriyash/Code-Regression huggingface dataset:
package main

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

var sc *bufio.Scanner

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

const INF = 1000000000

type node struct {
	depth int
	adj   []*node
}

func main() {
	sc = bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	h, w := nextInt(), nextInt()

	root := node{depth: -1}
	board := make([][]*node, h)
	for i := range board {
		sc.Scan()
		s := sc.Text()
		line := make([]*node, w)
		for j, r := range s {
			line[j] = &node{depth: INF}
			if r == '#' {
				root.adj = append(root.adj, line[j])
				line[j].depth = 0
			}
		}
		board[i] = line
	}

	for i, line := range board {
		for j := range line {
			if i > 0 && board[i-1][j].depth > 0 {
				board[i][j].adj = append(board[i][j].adj, board[i-1][j])
			}
			if i < h-1 && board[i+1][j].depth > 0 {
				board[i][j].adj = append(board[i][j].adj, board[i+1][j])
			}
			if j > 0 && board[i][j-1].depth > 0 {
				board[i][j].adj = append(board[i][j].adj, board[i][j-1])
			}
			if j < w-1 && board[i][j+1].depth > 0 {
				board[i][j].adj = append(board[i][j].adj, board[i][j+1])
			}
		}
	}

	ans := -1
	queue := make([]*node, len(root.adj))
	copy(queue, root.adj)
	for len(queue) > 0 {
		grid := queue[0]
		ans = grid.depth
		queue = queue[1:]
		for _, other := range grid.adj {
			if other.depth > grid.depth+1 {
				other.depth = grid.depth + 1
				queue = append(queue, other)
				ans = other.depth
			}
		}
	}

	fmt.Println(ans)
}


Measured memory_bytes: 125900
import java.util.*

// https://atcoder.jp/contests/abc170/tasks/abc170_d

fun main() {
    abc170d()
}

fun abc170d() {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toInt() }
    val sorted = a.sorted()
    val max = a.max()!!
    val primes = BooleanArray(max + 1) { false }
    for (i in sorted) {
        if (primes[i]) continue
        var j = 2
        while (i * j <= max) {
            primes[i * j] = true
            j++
        }
    }
    val orig = mutableSetOf<Int>()
    val dup = mutableSetOf<Int>()
    for (i in sorted) {
        if (i in orig) dup.add(i)
        if (!primes[i]) orig.add(i)
    }
    println(orig.count() - dup.count())
}


Measured memory_bytes: 74868
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N,p=0;
  cin >> N;
  map<string, int> x;
  for(int i=0; i<N; i++){
    string S;
    cin >> S;
    sort(S.begin(),S.end());
    p += x[S];
    x[S]++;
  }
  cout << p << endl;
}


Measured memory_bytes: 11380
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class ABC
{




    public static void Main()
    {
        int[] ab = Console.ReadLine().Split().Select(int.Parse).ToArray();
        if (ab[1] % ab[0] == 0) Console.WriteLine(ab.Sum());
        else
        {
            Console.WriteLine(ab[1] - ab[0]);
        }

    }
}



Measured memory_bytes: 13396
from collections import Counter

def main():
    N = int(input())
    an = sorted(map(int, input().split(' ')))
    
    # N = 6
    # an = [1, 10, 100]
    # an = [2, 7, 1, 8, 2, 8]
    # an = [1, 2, 3, 4]
    # an = [1, 4, 1]
    # an = [846579189, 56223110]
    
    out = []
    
    for a in an:
        if a % 2 != 0:
            out.append('A')
        elif a % 4 != 0:
            out.append('B')
        else:
            out.append('C') 
    # print(out)
    counter = Counter(out)
    # print(counter)
    num_A = counter['A']
    num_B = counter['B']
    num_C = counter['C']
    # print(num_A, num_B, num_C)
    
    if num_A == 1 and num_B == 1 and num_C ==0:
        print('No')
        return
    
    if not ('B' in out):
        if (num_C + 1) >= num_A:
            print('Yes')
            # return
        else:
            print('No')
            # return
    else:
        if num_B >= num_A:
            print('Yes')
        else:
            print('No')
        
        
        
        
    
main()

Measured memory_bytes: 63828
#include <stdio.h>

int main(void)
{
	int n, m, a[128][128] = { 0 }, b[128] = { 0 }, c[128] = { 0 }, i, j;

	scanf("%d %d", &n, &m);

	for (i = 0; i < n; i++)
	{
		for (j = 0; j < m; j++)
		{
			scanf("%d", &a[i][j]);
		}
	}

	for (i = 0; i < m; i++)
	{
		scanf("%d", &b[i]);
	}

	for (i = 0; i < n; i++)
	{
		for (j = 0; j < m; j++)
		{
			c[i] = c[i] + a[i][j] * b[j];
		}
	}

	for (i = 0; i < n; i++)
	{
		printf("%d\n", c[i]);
	}
	return 0;
}


Measured memory_bytes: 2116
#include <cstdio>
#include <utility>
#include <vector>
#define rep(i,a) for(int i=0;i<(a);++i)

int n;
std::vector<std::vector<int> > G;
std::vector<bool> used;
std::vector<std::pair<int, int> > res;
int tim = 1;

void dfs( int v )
{
  used[v] = true;
  res[v].first = tim++;

  for( int u : G[v] ) if( !used[u] )
    dfs( u );

  res[v].second = tim++;

  return;
}

int main()
{
  scanf( "%d", &n );
  G.resize( n );
  used.resize( n );
  res.resize( n );

  rep( i, n )
  {
    int u, k;
    scanf( "%d%d", &u, &k );

    rep( j, k )
    {
      int v;
      scanf( "%d", &v );
      G[i].push_back( v-1 );
    }
  }

  rep( i, n ) if( !used[i] )
    dfs( i );

  rep( i, n )
    printf( "%d %d %d\n", i+1, res[i].first, res[i].second );

  return 0;
}

Measured memory_bytes: 2772
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    char c;
    cin >> c;
    if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'){
        cout << "vowel" << endl;
    }
    else {
        cout << "consonant" << endl;
    }
}

Measured memory_bytes: 256
#include <stdio.h>
 
int main(void) {
 
  int i;
  int a[4];
  int b[4];
  int suma = 0;
  int sumb = 0;
 
  for (i = 0; i < 4; i++){
    scanf("%d", &a[i]);
    suma += a[i];
  }
  for (i = 0; i < 4; i++){
    scanf("%d", &b[i]);
    sumb += b[i];
  }
 
  if(suma > sumb){
    printf("%d\n", suma);
  }else{
    printf("%d\n", sumb);
  }
 
 
	return 0;
}
 

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

int main() {
   
    int x[10000];
    int count = 0;
    for (int i = 0;; i++) {
        cin >> x[i];
        if (x[i] == 0) {
            break;
        }
        count++;
    }
    for (int j = 0; j < count; j++) {
        cout << "Case " << j + 1 << ": " << x[j] << endl;
    }
}


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

using namespace std;

int main() {
  long long a, b, c, d;
  scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
  long long ans = a*c;
  ans = max(ans, a*d);
  ans = max(ans, b*c);
  ans = max(ans, b*d);
  printf("%lld\n", ans);

  return 0;
}

Measured memory_bytes: 3836
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n, m;
    cin >> n >> m;
    puts(n == m ? "Yes" : "No");
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <numeric>
#include <stack>
#include <cmath>
#include <utility>

using ll = long long;

int main()
{
    using namespace std;

    constexpr ll inf = 1000000000000ll;

    int n;
    cin >> n;
    vector<int> a(n);
    for (auto& e : a)
        cin >> e;
    
    ll ans = inf;
    for (int i = -100; i <= 100; ++i)
    {
        auto cost = accumulate(a.cbegin(), a.cend(), 0ll, 
        [i](ll init, int x)
        {
            init += (i - x) * (i - x);
            return init;
        });
        ans = min(ans, cost);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
using namespace std;
typedef long long int ll;
const ll MOD = 1000000007;

int N, C, A[410], B[410];
ll sum[410][410], dp[410][410];

ll mod_pow(ll n, ll k) {
    ll ret = 1, pw = n%MOD;
    while(k) {
        if(k & 1) (ret *= pw) %= MOD;
        (pw *= pw) %= MOD;
        k >>= 1;
    }
    return ret;
}

int main() {
    scanf("%d%d", &N, &C);
    for(int i=0; i<N; i++) scanf("%d", &A[i]);
    for(int i=0; i<N; i++) scanf("%d", &B[i]);

    for(int i=0; i<=C; i++) {
        for(int j=1; j<=400; j++) {
            sum[i][j] = (sum[i][j-1] + mod_pow(j, i)) % MOD;
        }
    }

    dp[0][0] = 1;
    for(int i=0; i<N; i++) {
        for(int j=0; j<=C; j++) {
            for(int k=0; k<=j; k++) {
                // dp[i+1][j] += dp[i][j-k] * (A^k + (A+1)^k + ... + B^k)
                ll mul = (sum[k][B[i]] - sum[k][A[i] - 1] + MOD) % MOD;
                (dp[i+1][j] += (dp[i][j-k] * mul) % MOD) %= MOD;
            }
        }
    }
    printf("%lld\n", dp[N][C]);
    return 0;
}

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

using namespace std;

long long gcd(long long a, long long b) {
	while (b) {
		long long c = a % b;
		a = b;
		b = c;
	}
	return a;
}

int main() {
	int T;
	ignore = scanf("%d", &T);
	while (T--) {
		long long a, b, c, d;
		ignore = scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
		
		bool ok = (a >= b) && (d >= b);
		
		long long g = gcd(b, d);
		
		a %= b;
		long long x = a + (b - 1 - a) / g * g;
		
		printf("%s\n", ok && x <= c ? "Yes" : "No");
	}
	
	return 0;
}


Measured memory_bytes: 256
# 5,10とする
# 片方は7位以下
# (7,7) (6,8) (5,-) (4,9) (3,11) (2,12) (1,13)
# (8,6) (9,5) (10,4) (11,3) (12,2) (13,1)
# 5,12とする
# (7,8) - (1,14) except 5
# (8,7) - (14,1)

Q = int(input())
AB = [[int(x) for x in input().split()] for _ in range(Q)]

for a,b in AB:
  if a > b:
    a,b = b,a
  answer = 0
  x = int((a*b)**0.5)-2
  while (x+1)*(x+1) < a*b:
    x += 1
  y = x
  answer = 2*x-1
  if a <= x:
    answer -= 1
  if x*(x+1) < a*b:
    answer += 1
  print(answer)


Measured memory_bytes: 3188
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <functional>
using namespace std;
using namespace __gnu_pbds;

#define ll long long
#define mk make_pair

template <class key, class cmp = std::less<key>>
using ordered_set = tree<key, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;

/*
if you have any question about any part of my code,
please don't shy to ask anytime :)
*/

bool isprime(ll n)
{
    if (n == 2)
        return true;

    if (n % 2 == 0 || n < 2)
        return false;

    for (int i = 3; i * i <= n; i++)
    {
        if (n % i == 0)
            return false;
    }

    return true;
}

void solve()
{
    ll n;
    cin>>n;
    ll ans=0;
    
    unordered_set<ll>s;
    unordered_map<ll,ll>h;
    for(ll i=2;i*i<=n;i++)
    {
        while(n%i==0)
        {
            s.insert(i);
            n/=i;
            h[i]++;
        }    
    }

    if(n>1)
    {
        s.insert(n);
        h[n]++;
    }

    for(auto it:s)
    {
        for(int i=1;;i++)
        {
            if(h[it]>=i)
            {
                ans++;
                h[it]-=i;
            }
            else
            {
                break;
            }
        }
    }


    cout<<ans<<endl;
}

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

    // ll t;
    // cin >> t;

    // while (t--)
    // {
    //     solve();
    // }
    solve();
    return 0;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(0);cin.tie();cout.tie();
#define ff first
#define ss second
#define pb push_back
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll inf = 9223372036854775807;
const ll mininf = -9223372036854775807;
const ll nax = 0;
ll n, a, b;

int main(){
	IOS
	cin >> n >> a >> b;
	ll A=n/(a+b);
	ll B=n%(a+b);
	cout << a*A+min(a, B) << '\n';
}

Measured memory_bytes: 3640
fun main(args: Array<String>) {
    val (n, m, l) = readLine()!!.split(" ").map(String::toInt)
    val a = (0 until n).map { readLine()!!.split(" ").map(String::toLong) }
    val b = (0 until m).map { readLine()!!.split(" ").map(String::toLong) }
    val ans = (0 until n).map { i -> (0 until l).map { j -> (0 until m).map { k -> a[i][k] * b[k][j] }.sum() } }
    ans.map { it.joinToString(" ") }.forEach(::println)
}



Measured memory_bytes: 70388
#include <bits/stdc++.h>
typedef long long ll; 

using namespace std;

ll f(ll n) {
	ll res = 0;
	while (n > 0) {
		res += n % 10;
		n /= 10;
	}

	return res;
}

double g(ll n) {
	return (double) n / (double) f(n);
}

int main() {
	vector<ll> res;
	ll base = 1;

	for (int i = 0; i < 15; i++) {
		for (int j = 1; j < 150; j++) {
			res.push_back(base * (j + 1) - 1);
		}

		base *= 10;
	}

	sort(res.begin(), res.end());
	res.erase(unique(res.begin(), res.end()), res.end());

	for (ll i = 0; i < res.size(); i++) {
		for (ll j = i + 1; j < res.size(); j++) {
			if (g(res[i]) > g(res[j])) {
				res.erase(res.begin() + i);
				i--;
				break;
			}
		}
	}

	ll K;
	cin >> K;
	for (ll i = 0; i < K; i++) {
		cout << res[i] << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin>>N;
  int a[N];
  for (int i = 0; i < N; i++) {
    cin>>a[i];
  }
  sort(a,a+N);
  cout << a[N-1]-a[0];
}

Measured memory_bytes: 3604
#include <iostream>

using namespace std;

typedef pair<int,string> P;

int main(){
  int n,q;
  P p[50];

  cin >> n >> q;
  for(int i = 0 ; i < n ; i++){
    cin >> p[i].first >> p[i].second;
  }

  string ans = "kogakubu10gokan";
  int t = 0;
  for(int i = 0 ; i < n ; i++){
    if(q < p[i].first){
      t++;
      cout << ans << endl;
      break;
    }
    ans = p[i].second;
  }
  if(!t) cout << ans << endl;

  return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const ll INF = 1023456789;

#define REP(i,n)	for(int i=0;i<n;++i)
#define REPR(i,n)	for(int i=n-1;i>=0;--i)
#define FOR(i,s,n)	for(int i=s;i<n;++i)
#define FORR(i,s,n)	for(int i=n-1;i>=s;--i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define F			first
#define S			second

ll n, m;
P ab[100000];

int main(int argc, char **argv) {
	cin >> n >> m;
	REP(i, n) cin >> ab[i].F >> ab[i].S;
	sort(ab, ab+n);
	ll res = 0;
	REP(i, n) {
		ll c = min(m, ab[i].S);
		res += c * ab[i].F;
		m -= c;
		if (m <= 0) break;
	}
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 5152
N=int(input())
S=input()

res=0
R=[]
G=[]
B=[]
r,g,b=0,0,0
for i in range(N):
    if S[i]=='R':
        r+=1
    elif S[i]=='G':
        g+=1
    else:
        b+=1
    R.append(r)
    G.append(g)
    B.append(b)
    
for i in range(N):
    for j in range(N):
        if not i<j:
            continue
        k=S[2*j-i] if 2*j-i<N else 'A'
        if set([S[i],S[j]])==set(['R','G']):
            res+=B[-1]-B[j]-(k=='B')
        elif set([S[i],S[j]])==set(['B','G']):
            res+=R[-1]-R[j]-(k=='R')
        elif set([S[i],S[j]])==set(['R','B']):
            res+=G[-1]-G[j]-(k=='G')
print(res)

Measured memory_bytes: 75004
import sys
N,K=map(int, sys.stdin.readline().split())
L=[ 1 for _ in range(N+1)]
L[0]=0
for _ in range(K):
    d=int(sys.stdin.readline().strip())
    A=map(int, sys.stdin.readline().split())
    for a in A:
        L[a]=0
print sum(L)

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

int xx[1000] , yy[1000];
int wf[1000][1000];
int main(){
	int n,X,Y;
	cin >> n;
	while(cin >> n >> X >> Y && n){
		memset(wf,0,sizeof(wf));
		int sx , sy = 0;
		cin >> sx >> sy;
		for(int i = 0 ; i < n ; i++){
			int x,y; cin >> x >> y;
			xx[i] = x , yy[i] = y;
		}
		for(int i = 0 ; i < n ; i++)
			for(int j = 0 ; j < n ; j++)
				if( i != j && (xx[i]-xx[j])*(xx[i]-xx[j])+(yy[i]-yy[j])*(yy[i]-yy[j]) <= 2500 ) wf[i][j] = 1;
		int p[1000];
		int q[1000];
		for(int i = 0 ; i < 1000 ; i++)
			p[i] = -1 , q[i] = -1;
		for(int i = 0 ; i < n ; i++){
			if((sx-xx[i])*(sx-xx[i])+(sy-yy[i])*(sy-yy[i]) <= 100){
				p[i] = X;
			}
		}
		bool flag; int cnt = 0;
		while(cnt != 200000){
			flag = false;/*
			for(int j = 0 ; j < n ; j++) 
				cout << p[j] << " " << q[j] << endl;
			cout << endl;*/
			for(int i = 0 ; i < n ; i++){
				if(p[i] > 0){
					flag = true;
				}
				p[i]--;
				q[i]--;
			}
			for(int i = 0 ; i < n ; i++){
				if(p[i] == 0){
					q[i] = Y;
				}
			}
			for(int i = 0 ; i < n ; i++){
				if(p[i] == 0){
					for(int j = 0 ; j < n ; j++){
						if(wf[i][j] && q[j] < 0){
							p[j] = X;
							flag = true;
						}
					}
				}
			}
			if(!flag) break;
			cnt++;
		}
		if(cnt == 200000) cout << "You're always welcome!" << endl;
		else cout << cnt << endl;
	}	
}
/*
11011

*/

Measured memory_bytes: 0
#include<iostream>
#include<string>
#include<vector>
#include<numeric>
#include<math.h>
#include<algorithm>
#include<iomanip>
#include<list>
#include<bitset>
#include<sstream>
using namespace std;


int main() {

	long long N;
	cin >> N;

	vector<long long> A;
	A.push_back(0);

	long long d;
	for (long long i = 0; i < N; i++) {
		cin >> d;
		A.push_back(d);
	}
	A.push_back(0);

	long long sum = 0;
	for (long long i = 0; i < A.size() - 1; i++) {
		sum += abs(A[i + 1] - A[i]);
	}

	long long val;
	for (long long i = 0; i < N; i++) {
		val = sum - abs(A[i + 1] - A[i]) - abs(A[i + 2] - A[i + 1]) + abs(A[i + 2] - A[i]);
		cout << val << endl;
	}

	return 0;
}

Measured memory_bytes: 4316
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define CMAX(m, x)  m = max(m,x);
#define CMIN(m, x)  m = min(m,x);
#define itn int
typedef long long lint;
const int INF = 1e9;
const lint LINF = 1e18;
int main(){
    int n;
    cin >> n;
    vector<int> p(n);
    vector<int> q(n);
    int a,b;
    int cnt =0;
    REP(i,n)
        cin >> p[i];
    
    REP(i,n)
        cin >> q[i];
    vector<int> v(n);
    iota(ALL(v),1);
    do{
        cnt++;
        if(p == v)            
            a = cnt;
        if(q == v)
            b = cnt;
    }while(next_permutation(ALL(v)));
    cout << abs(a - b) << endl;
    return 0;
}

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

int main() {
    int N;
    cin >> N;
    vector<int> v(N);
    for (int i = 0; i < N; i++) cin >> v[i];

    sort(v.begin(), v.end());
    double ans = 1.0 * v[0];
    for (int i = 1; i < N; i++) {
        ans = (ans + v[i]) / 2;
    }

    cout << fixed << setprecision(12) << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define mp make_pair
#define pb push_back
#define ff first 
#define ss second
#define mod 1000000007
#define lim 100005
#define nfs_mw ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;


string reconstruct(int dp[3001][3001], int ref[3001][3001], int n1, int n2, const string& s)
{
	int i = n1, j = n2; string out = "";
	while(i && j)
	{
		if(ref[i][j] == 2){
			i--;
			j--;
			out += s[i];
		}
		else if(ref[i][j]) j--;
		else i--;		
	}
	reverse(out.begin(), out.end());
	return out;
}

int main()
{
	int dp[3001][3001] = {}, ref[3001][3001] = {};
	int i,j,n1,n2; string s,t;
	cin>>s>>t; n1 = s.length(); n2 = t.length();
	for(i=1; i<=n1; i++)
		for(j=1; j<=n2; j++){
			if(s[i-1] == t[j-1]) { dp[i][j] = dp[i-1][j-1] + 1; ref[i][j] = 2; }
			else{
				dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
				ref[i][j] = (dp[i][j] == dp[i][j-1]);
			}
		}
	cout<<reconstruct(dp,ref,n1,n2,s);
}

Measured memory_bytes: 70656
#include <stdio.h>
int main(){
    int i,n, a[10000],min,max;
    long long int sum = 0;
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }
    min = a[0];
    max = a[0];
    for (i = 0; i < n; i++)
    {
 
        if (min>a[i])
        {
            min = a[i];
        }
        if (max < a[i])
        {
            max = a[i];
        }
 
        sum +=a[i];
 
    }
    printf("%d %d %lld\n", min, max, sum);
    return 0;
}

Measured memory_bytes: 1856
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;

int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int r;
    cin >> r;
    cout << (r * r) << "\n";

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using ll=long long;
using namespace std;
#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;}
int dh[4] = {-1, 0, 0, 1};
int dw[4] = {0, -1, 1, 0}; 
using P = pair<int, int>;
const double pi = acos(-1.0);

int main(){
  ll x;
  cin>>x;
  ll cma=0;
  ll tmp=0;
  while(1){
    tmp=cma*cma+cma;
    if(tmp>=2*x)break;
    cma++;
  }
  cout<<cma<<endl;
    
    
  return 0;
}


Measured memory_bytes: 3600
import java.util.*;
class Main{
  public static void main(String[] args){
    Set<Character>set = new HashSet<>();
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    set.add(s.charAt(0));
    set.add(s.charAt(1));
    set.add(s.charAt(2));
    set.add(s.charAt(3));
    if(set.size()==2)System.out.println("Yes");
    else System.out.println("No");
  }
}


Measured memory_bytes: 21844
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <cassert>
#include <string.h>
#include <iomanip>


using namespace std;

class gfg 
{ 
public : long  gcd(long  a, long  b){ 
	if (a == 0) 
		return b;  
	return gcd(b % a, a);  
} 

long  lcm(long  a, long  b)  
{  
	return (a*b)/gcd(a, b);  
}  
} ; 
// Driver program to test above function  
int main()  
{  
	gfg g; 
	long a, b;
	cin >> a >> b;  
	cout<<g.lcm(a, b); 
	cout <<endl; 
	return 0;  
}  





Measured memory_bytes: 256
n = int(input())

food = []
for i in range(n):
    a,b = map(int, input().split())
    food.append([a+b,a,b])
food.sort()
food.reverse()

ans = 0
for i in range(n):
    ans += (-1)**i * food[i][i%2+1]
print(ans)

Measured memory_bytes: 59608
#include<bits/stdc++.h>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int imos[1000001];
    memset(imos, 0,sizeof(imos));
    int n; cin>>n;rep(i,n){
        int a,b; cin>>a>>b;
        imos[a]++;
        imos[b+1]--;
    }
    rep(i,1000001){
        if(i)imos[i]+=imos[i-1];
    }
    int hoge=0;
    rep(i,1000001)if(imos[i]>0)hoge++;
    cout<<hoge<<endl;
}

Measured memory_bytes: 4096
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

ans = 0
temp = 10**9
for i in range(N):
    if abs(T-H[i]*0.006-A) < temp:
        ans = i+1
        temp = abs(T-H[i]*0.006-A)
print(ans)


Measured memory_bytes: 3060
#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cmath>

using namespace std;

int getnum(int X) {
    int sum = 0;
    while (X > 0) {
        sum += X % 10;
        X /= 10;
    }

    return sum;
}

int main() {
    int X;

    cin >> X;

    int num = getnum(X);

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

    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		long a[] = new long[n];
		String str[] = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(str[i]);
		}

		boolean zouka = false;
		boolean gensyo = false;
		int ans = 0;

		for (int i = 0; i < n - 1; i++) {
			if (a[i] > a[i + 1]) {
				if (zouka) {
					ans++;
					zouka = false;
					gensyo = false;
				} else {
					zouka = false;
					gensyo = true;
				}
			} else if (a[i] < a[i + 1]) {
				if (gensyo) {
					ans++;
					zouka = false;
					gensyo = false;
				} else {
					zouka = true;
					gensyo = false;
				}
			}
		}

		System.out.println(ans + 1);
	}
}


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

typedef long lint;
typedef long long llint;
typedef pair<int, int> pint;
typedef pair<long long, long long> pllint;

// static const int MAX = 1e6;
// static const int NIL = -1;
// static const llint INF = 1<<21;
// static const llint MOD = 1e9 + 7;

bool compPair(const pint& arg1, const pint& arg2) { return arg1.first > arg2.first; }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }

int main(void) {
    string a, b, c;
    cin >> a >> b;
    c =  a;
    c += b;
    
    int ans = 0;
    for(int ic=0;ic<c.size();ic++) {
        ans += c.at(ic)-'0';
        ans *= 10;
    }
    ans /= 10;

    int sqr = sqrt(ans);
    if(sqr*sqr==ans) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
int main(){
  int n;
  cin >> n;
  vector<int> v(n),mask(n);
  rep(i,n){
    int a;
    cin >> a;
    rep(j,a){
      int x,y;
      cin >> x >> y;
      v[i] |= (y << x-1);
      mask[i] |= (1 << x-1);
    }
  }
  int ans = 0;
  rep(i,(1<<n)){
    rep(j,n){
      bool bit = (i>>j)&1;
      if(bit){
        int check = (i^v[j])&mask[j];
        if(check > 0) break;
      }
      if(j == n-1)ans = max(ans,__builtin_popcount(i));
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3644
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <utility>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
typedef long long int ll;

int main() {
  int N,K;
  cin>>N>>K;
  
  vector<int> b(N+1);
  vector<int> d(K);
  for(int i=0;i<K;++i){
    cin>>d[i];
    vector<int> A(d[i]);
    
    for(int j=0;j<d[i];++j){
      cin>>A[j];
      ++b[A[j]];
    }
  }
  
  int ans=0;
  for(int i=1;i<=N;++i){
    if(b[i]==0)
      ++ans;
  }
  
  cout<<ans<<endl;
  
}

Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <map> //map<string, int> cnt; key とvalue
#include <set>//  set<int> s;
#include <cstdlib>  // abs() for integer
#include <vector>
#define rep(i,n) for(int i = 0 ; i < (n); ++i)
using namespace std;
using ll = long long;
// g++ -std=c++11
int main(){
  int x[5];
  int ans;
  rep(i,5){
    cin >> x[i]; 
    if(x[i] == 0) cout << i+1 << endl;
  }
  return 0;
}

Measured memory_bytes: 3132
#include "bits/stdc++.h"
using namespace std;
int main() {
	vector<bool>First_map(200001, false), Second_map(200001, false);
	long long N, M;
	cin >> N >> M;
	vector<long long>A(M), B(M);
	for (long long i = 0; i < M; i++) {
		cin >> A.at(i) >> B.at(i);
		if (A.at(i) == 1) First_map.at(B.at(i)) = true;
		else if (B.at(i) == N) Second_map.at(A.at(i)) = true;
	}
	for (long long i = 0; i < N; i++) {
		if (First_map.at(i) && Second_map.at(i)) {
			cout << "POSSIBLE" << endl;
			return 0;
		}
	}
	cout << "IMPOSSIBLE" << endl;
}

Measured memory_bytes: 3456
#include<bits/stdc++.h>
using namespace std;
int main(){
    int x,y;
    while(true){
        cin>>x>>y;
        if(x==0&&y==0)
        break;
       
       if(x>y)cout<<y<<" "<<x<<endl;
       else cout<<x<<" "<<y<<endl;
    }
}


Measured memory_bytes: 3076
#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) int ab;cin>>ab;(p).push_back(ab);
#define vecpl2(p) long long ab;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007

int main() {
	
	string a,b;
	cin>>a>>b;
	a=a+b;
	int k=atoi(a.c_str());
	bool can=false;
	for(int x=1;x*x<=k;x++){
		if(x*x==k){
			can=true;
			break;
		}
	}
	if(can){
		ce("Yes")
	}else{
		ce("No")
	}

}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using static System.Console;
using static System.Math;
using static Atcoder.IO;

namespace Atcoder
{
    class Program
    {
        static StreamWriter sw = new StreamWriter(OpenStandardOutput()) { AutoFlush = false };
        static void Main(string[] args)
        {
            try
            {
                SetOut(sw);
                Solve.Answer();
                Out.Flush();
            }
            catch (Exception ex)
            {
                WriteLine(ex.ToString());
                Out.Flush();
            }
        }
    }

    public class Solve
    {
        public static void Answer()
        {
            var NH = IO.RSInt;
            var N = NH[0];
            var H = NH[1];
            int[] a = new int[N];
            int[] b = new int[N];
            for (int i = 0; i < N; i++)
            {
                var ab = IO.RSInt;
                a[i] = ab[0];
                b[i] = ab[1];
            }

            Array.Sort(a);
            Array.Reverse(a);
            Array.Sort(b);
            Array.Reverse(b);

            int ans = 0;
            while (H > 0)
            {
                if (ans >= N)
                {
                    ans += H / a[0];
                    if (H % a[0] != 0) ans++;
                    break;
                }
                if (b[ans] >= a[0])
                    H -= b[ans];
                else
                    H -= a[0];
                ans++;
            }
            WriteLine(ans);
        }
    }

    public class IO
    {
        #region Input
        public static int RInt => int.Parse(ReadLine());
        public static long RLong => long.Parse(ReadLine());
        public static double RDouble => double.Parse(ReadLine());

        public static string[] RSString => ReadLine().Split();
        public static int[] RSInt => ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        public static long[] RSLong => ReadLine().Split().Select(s => long.Parse(s)).ToArray();
        public static double[] RSDouble => ReadLine().Split().Select(s => double.Parse(s)).ToArray();
        #endregion

        #region Output
        public static void OutJoinSpace<T>(IEnumerable<T> list) => WriteLine(string.Join(" ", list));
        public static void WriteLineYes_or_No(bool flag) => WriteLine(flag ? "Yes" : "No");
        public static void WriteLineYES_or_NO(bool flag) => WriteLine(flag ? "YES" : "NO");
        #endregion
    }

    public class Mod
    {
        #region
        private readonly static long M = 1000000007;

        public static long Add(long a, long b) => (a * b) % M;
        public static long Sub(long a, long b) => (a - b) % M >= 0 ? (a - b) % M : (a - b) % M + M;
        public static long Multi(long a, long b) => (a * b) % M;
        #endregion
    }
}

Measured memory_bytes: 42032
#include <iostream>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(){
    int r,d,n;
    cin>>r>>d>>n;
    
    for(int i=0;i<10;i++){
        n=r*n-d;
        cout<<n<<endl;
    }
}

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

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=s;i<n;i++)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<double> vd;
typedef vector<vd> vvd;

int main()
{
	double l;
	cin >> l;
	printf("%.10f\n", l*l*l / 27);
	return 0;
}

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

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

using namespace std;

using ll = long long;
using P = pair<int, int>;

int main() {
  vector<int> abc(3);
  rep(i, 3) cin >> abc.at(i);
  sort(abc.rbegin(), abc.rend());
  int res = 0;
  while (abc.at(0) != abc.at(1) || abc.at(1) != abc.at(2)) {
    if (abc.at(0) > abc.at(1)) {
      abc.at(1)++;
      abc.at(2)++;
      res++;
    } else if (abc.at(0) > abc.at(2)) {
      abc.at(2) += 2;
      res++;
    } else {
      abc.at(0)++;
      abc.at(1)++;
      res++;
    }
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 3628
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
using namespace std;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef long long ll;
#define range(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) range(i,0,n)
#define INF 10000000000 //10^10
#define PI 3.141592

int main(){
    int n;
    string s;
    cin >> n >> s;
    int maxx=0;
    range(i,1,n){
        map<char,int> l,r;
        rep(j,i){
            l[s[j]]+=1;
        }
        range(j,i,n){
            r[s[j]]+=1;
        }
        int count=0;
        for(auto it=l.begin();it!=l.end();++it){
            if(r[it->first]!=0){
                ++count;
            }
        }
        maxx=max(maxx,count);
    }
    cout << maxx << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i < (n);++i)
using namespace std;
using ll = long long; 
using P = pair<int,int>;
using vv = vector<vector<ll> >;
template <class _t> inline bool chmax (_t& a,_t b){if(a<b){a=b;return true;}return false;} template <class _t> inline bool chmin (_t& a,_t b){if(a>b){a=b;return true;}return false;}

const int INF = 2147483647;
const int max_N = 1000000000;
const long long inf = 1ll << 60;
const long long mod = 1000000007;

int dx[4] = {1,0,-1,0};
int dy[4] = {0,-1,0,1};
int main(){
    string s;cin >> s;
    int ans = 0;
    if(s[0]=='R'){
        if(s[1]=='R'){
            if(s[2]=='R'){
                ans = 3;
            }else{
                ans = 2;
            }  
        }else{
            ans = 1;   
        }    
    }else{
        if(s[1]=='R'){
            if(s[2]=='R'){
                ans = 2;
            }else{
                ans = 1;
            }  
        }else{
            if(s[2]=='R'){
                ans = 1;
            }else{
                ans = 0;
            }
        }    
          
    }
    cout << ans << endl;

    return 0;
}


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

int main() {
  int h, w;
  cin >> h >> w;

  vector<string> a(h+2);
  string frame(w+2, '-');
  a.at(0) = frame;
  a.at(h+1) = frame;

  for (int i = 1; i < h+1; i++) {
    string x;
    cin >> x;
    string row = "-" + x + "-";
    a.at(i) = row;
  }
  
  for (int i = 1; i < h+1; i++) {
    for (int j = 1; j < w+1; j++) {
      if (a.at(i).at(j) == '#') {
        cout << '#';
      } else {
        int cnt = 0;
        for (int y = -1; y <= 1; y++) {
          for (int x = -1; x <= 1; x++) {
            if (a.at(i + y).at(j + x) == '#') cnt++;
          }
        }
        cout << cnt;
      }
      if (j == w) cout << endl;
    }
  }
}


Measured memory_bytes: 256
//naru-hodo
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<time.h>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#define ff first
#define ss second
#define ll long long 
#define ull unsigned long long
#define loop(i,x,n) for(int i=x; i<=n; i++)
#define rloop(i,x,n) for(int i=x; i>=n; i--)
using namespace std;
int main(){
    int n;
    cin>>n;
    int h[n];
    loop(i,0,n-1) cin>>h[i];
    int m[n];
    m[0]=0;
    m[1]=abs(h[1]-h[0]);
    loop(i,2,n-1) m[i]=min(m[i-1]+abs(h[i]-h[i-1]), m[i-2]+abs(h[i]-h[i-2]));
    cout<<m[n-1];
    return 0;
}

Measured memory_bytes: 1024
package main

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

func main() {
	sc := NewScanner()

	n := sc.NextInt()
	prev := -1
	for i := 0; i < n; i++ {
		h := sc.NextInt()
		if h > prev {
			prev = h - 1
		} else if h == prev {
			prev = h
		} else {
			fmt.Printf("No\n") // output for debug
			return
		}
	}
	fmt.Printf("Yes\n")
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			result = append(result, v)
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	result = append(result, v)

	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Measured memory_bytes: 6528
#include <stdio.h>

int main()
{
	int N, X, L[100], i;
	scanf("%d %d", &N ,& X);
	for (i = 0; i < N; i++) scanf("%d", &L[i]);
	int Ans = 0;
	for (i = 0; i < N; i++) {
		Ans = Ans + L[i];
		if (Ans > X) break;
	}
	printf("%d", i+1);
}

Measured memory_bytes: 128
#include<stdio.h>
#include<stdlib.h>

int main()
{
	int n = 0;
	
	
	scanf("%d", &n);
	for (int i = 1; i < 10; i++)
	{
	
		 if ( n % i == 0 && n / i < 10)
		 {
			 printf("Yes");
			 n = -1;
			 break;
		 }
	}
	if (n != -1)
       printf("No");
	
	return 0;

		
}

Measured memory_bytes: 128
s = gets.chomp.split('')

def is_kaibun?(string)
  palindrome = string.reverse
  string == palindrome
end

def first_half(string)
  n = string.length
  num = ((n-1)/2)
  string[0...num]
end

def latter_harf(string)
  n = string.length
  num = ((n+3)/2)-1
  string[num..n]
end

print is_kaibun?(s) && is_kaibun?(first_half(s)) && is_kaibun?(latter_harf(s)) ? 'Yes' : 'No'

Measured memory_bytes: 1788
def gcd(a,b):
    if a == 0:
        return b
    return gcd(b%a, a)
n,x = map(int, input().split())
l = list(map(int, input().split()))
for i in range(n):
    l[i] -= x
    l[i] = abs(l[i])
ans = []
if len(l) == 1:
    ans.append(l[0])
while len(ans) != 1:
    ans = []
    for i in range(1,len(l)):
        ans.append(gcd(l[i], l[i-1]))
    ans = list(set(ans))
    l = []
    for i in ans:
        l.append(i)
print(ans[0])

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

class Solve {
private:
	std::string inputStr;

	int64_t calcAdd(int& s_i)
	{
		int64_t ret{calcMulti(s_i)};
		while (inputStr[s_i] == '+' || inputStr[s_i] == '-')
		{
			char ope{inputStr[s_i]};
			s_i++;
			if (ope == '+') ret += calcMulti(s_i);
			else ret -= calcMulti(s_i);
		}
		return ret;
	}

	int64_t calcMulti(int& s_i)
	{
		int64_t ret{calcNum(s_i)};
		while (inputStr[s_i] == '*' || inputStr[s_i] == '/')
		{
			char ope{inputStr[s_i]};
			s_i++;
			if (ope == '*') ret *= calcNum(s_i);
			else ret /= calcNum(s_i);
		}
		return ret;
	}

	int64_t calcNum(int& s_i)
	{
		int64_t ret{};
		if (inputStr[s_i] == '(')
		{
			s_i++;
			ret = calcAdd(s_i);
			s_i++;
		}
		else
		{
			while (isdigit(inputStr[s_i]))
			{
				ret = 10 * ret + inputStr[s_i] - '0';
				s_i++;
			}
		}
		return ret;
	}

public:
	bool is_last_query{};
	Solve()
	{
		std::cin >> inputStr;
		int s_i{};
		printf("%lld\n", calcAdd(s_i));
	}
};

int main()
{
	int N;
	scanf("%d", &N);
	for (int i{}; i < N; i++)
		Solve();

	return 0;
}


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

#define endl '\n'
#define rep(i,n)       for(int i=0; i<n; i++)
#define clr(arr)       memset(arr, 0, sizeof arr)
#define all(x)         x.begin(), x.end()
const int MOD = 1e9 + 7;
#define int long long
#ifdef SMIT
template<class F, class S> ostream& operator<<(ostream &out, const pair<F, S> &p)
{
	return out << '(' << p.first << ", " << p.second << ')';
}
template<class T> auto operator<<(ostream &out, T &&x) -> decltype(x.begin(), out)
{
	out << '{';
	for (auto i = x.begin(); i != x.end(); i++)
		out << *i << (i == prev(x.end()) ? "" : ", ");
	return out << '}';
}
void dmp() {}
template<class T, class... Args> void dmp(T &&x, Args... args)
{
	cerr << x << ";  "; dmp(args...);
}
struct Nl {~Nl() {cerr << '\n';}};
#define debug(x...) cerr << (strcmp(#x, "") ? #x ":  " : ""), dmp(x), Nl(), cerr << ""
#else
#define debug(...) {}
#endif
// Yes you CAN


int x, k, d;
void solve()
{
// #define TEST
	cin >> x >> k >> d;
	if (x < 0) x = -x;
	int fr = (x / d);
	int cl = fr;
	if (x % d != 0 and x > d)
		cl++;
	if (x == d)
	{
		if (k & 1)
			cout << 0 << endl;
		else
			cout << x << endl;
	}
	else if (x < d)
	{
		if (k & 1)
			cout << d - x << endl;
		else
			cout << x << endl;
	}
	else if (k < fr)
	{
		cout << x - k*d << endl;
	}
	else
	{
		if ((k - fr) & 1)
			cout << cl * d - x << endl;
		else
			cout << x - fr*d << endl;
	}
}

int32_t main()
{
#ifdef SMIT
	// freopen("/home/smit/Desktop/in.txt", "r", stdin);
#endif
	ios_base::sync_with_stdio(false); cin.tie(nullptr);

	int t = 1;
#ifdef TEST
	cin >> t;
#endif
	while (t--)
		solve();
}

Measured memory_bytes: 3628
#include<iostream>//入出力
#include<vector>//可変長配列
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<deque>//両端アクセスのキュー
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REPS(i,a,b) for(ll i=(a);i<(b);i++)
#define RREPS(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000

int main(){
    string str;
    int count=0;
    cin >> str;
    REP(i,str.length()){
        if(str[i]==str[0]) count++;
    }
    if(count==str.length()) cout << "No" << endl;
    else cout << "Yes" << endl;
    
    return 0;
}

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

using namespace std;

//#define int long long
#define all(v) begin(v), end(v)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for(int i = (int)(s); i < (int)(n); i++)

const int inf = 1<<25;//1LL << 55;
const int mod = 1e9 + 7;

struct edge {
  int to, cost;
  edge(){}
  edge(int to, int cost):to(to), cost(cost){}
};

struct state {
  int v, cost, rt, te;
  state(){}
  state(int v, int cost, int rt, int te):v(v), cost(cost), rt(rt), te(te){}
  bool operator < (const state& r) const {
    return cost > r.cost;
  }
};

int N, M, X;
int T[10010];

vector<edge> G[10010];
int mincost[2][202][10010];

int dijkstra()
{
  rep(i, 2) rep(j, 202) rep(k, 10010) mincost[i][j][k] = inf;
  priority_queue<state> que;
  que.emplace(0, 0, 0, 0);
  mincost[0][0][0] = 0;
  while(!que.empty()) {
    state s = que.top(); que.pop();
    if(s.v == N-1) return s.cost;
    if(s.cost > mincost[s.rt/2][s.te][s.v]) continue;
    for(edge& e : G[s.v]) {
      if(abs(s.rt - T[e.to]) == 2 && s.te + e.cost < X) continue;
      int nrt = s.rt, nte = min(s.te + e.cost, X);
      if(T[e.to] != 1) nrt = T[e.to], nte = 0;
      if(s.cost + e.cost < mincost[nrt/2][nte][e.to]) {
	mincost[nrt/2][nte][e.to] = s.cost + e.cost;
	que.emplace(e.to, s.cost + e.cost, nrt, nte);
      }
    }
  }
  return -1;
}

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  cin >> N >> M >> X;
  rep(i, N) cin >> T[i];
  rep(i, M) {
    int A, B, D;
    cin >> A >> B >> D; A--, B--;
    G[A].emplace_back(B, D);
    G[B].emplace_back(A, D);
  }

  cout << dijkstra() << endl;

  return 0;
}

Measured memory_bytes: 19836