akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//get the biggest element.
template<typename KeyType, typename ValueType>
std::pair<KeyType,ValueType> get_max( const std::map<KeyType,ValueType>& x ) {
  using pairtype=std::pair<KeyType,ValueType>;
  return *std::max_element(x.begin(), x.end(), [] (const pairtype & p1, const pairtype & p2) {
        return p1.second < p2.second;
  });
}
using namespace std;
using P = pair<int,int>;
using ll = long long;
const ll INF = 1LL<<60;

int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<bool>> s(m, vector<bool>(n));
  vector<int> p(m);
  rep (i, m) {
    int k;
    cin >> k;
    rep (j, k) {
      int x;
      cin >> x;
      --x;
      s[i][x] = true;
    }
  }
  rep (i, m) cin >> p[i];

  int ans = 0;
  for (int bit = 0; bit < 1 << n; bit++) {
    bool ok = true;
    int cnt = 0;
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < n; j++) {
        if (s[i][j] && (bit & 1 << j)) ++cnt;
      }
      if (cnt % 2 != p[i]) ok = false;
      cnt = 0;
    }
    if (ok) ++ans;
  }

  //rep (i, m) {
  //  printVec(s[i]);
  //}

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


Measured memory_bytes: 3636
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	int INF = 1 << 25;
	int n, m;
	int[][] map;
	int[] min;
	
	void run() {
		Scanner sc = new Scanner(System.in);
		for(;;) {
			n = sc.nextInt();
			m=0;
			if( n == 0) break;
			map = new int [10][10];
			min = new int[10];
			int ans = INF;
			int p = 0;
			for(int i=0;i<10;i++) fill(map[i], INF);
			for(int i=0;i<n;i++) {
				int a = sc.nextInt();
				int b = sc.nextInt();
				int c = sc.nextInt();
				if( m<max(a,b)+1 ) m = max(a,b)+1;
				map[a][b] = map[b][a] = min(c, map[a][b]);
			}
			for(int i=0;i<10;i++) map[i][i] = 0;
			wf();
			for(int i=0;i<m;i++) {
				min[i] = 0;
				for(int j=0;j<m;j++) {
					min[i] += map[i][j];
				}
				if(ans > min[i]) {
					ans = min[i];
					p = i;
				}
			}
			System.out.println(p + " " + ans);
		}
	}
	
	void wf() {
		for(int i=0;i<m;i++) for(int j=0;j<m;j++) for(int k=0;k<m;k++) {
			map[j][k] = min(map[j][k], map[j][i] + map[i][k]);
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 12000
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define  all(A)         (A).begin() , (A).end()
#define  pb             push_back
#define  mp             make_pair
#define  ln(X)          (int)(X).length()
#define  forn(i, n)     for (int i = 0; i < int(n); i++)
#define  forr(i, n)     for (int i = int(n - 1); i >= 0; i--)
#define  fora(i, a, b)  for (int i = int(a); i <= int(b); i++)
#define  forb(i, a, b)  for (int i = int(a); i >= int(b); i--)
#define  deb(x)       cout << #x << ':' << x << endl;
int main()
{
    ios::sync_with_stdio(0); 
    cin.tie(0); 
    cout.tie(0);

    
    int t=1;
    //cin>>t;
    while(t--)
    {
        ll a;
        cin>>a;
        cout<<a*a;
    }
    
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
	int a, b, c;
	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &c);
	if (a < b && b < c){
        printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 580
//W4P3R
#include<bits/stdc++.h>
#define inf 1e9
#define eps 1e-6
#define re register int 
#define FOR(i,a,b) for(re i=a;i<=b;i++)
#define REP(i,a,b) for(re i=a;i>=b;i--)
#define mp make_pair
#define pb push_back
#define pf push_front
#define pa pair<int,int>
#define fr first
#define sd second
#define Z(x) (x>=mod?x-mod:x)
#define lowbit(x) (x&(-x))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
inline ll read()
{
    char ch=getchar();
    ll s=0,w=1;
    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){s=s*10+ch-'0';ch=getchar();}
    return s*w;
}
int m,k;
int d[11];
int Solve(int s,int m)
{
	if(s>=m)return s;
	int ans=inf;
	FOR(i,0,9)if(!d[i]&&(s||i))ans=min(ans,Solve(s*10+i,m));
	return ans;
}
int main()
{
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    m=read(),k=read();
    while(k--)d[read()]=1;
    printf("%d\n",Solve(0,m));
    return 0;
}
//code once,check twice

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b){ 
    if (a == 0) 
        return b;  
    return gcd(b % a, a);  
 } 
ll lcm(ll a, ll b)  
 {  
    return (a*b)/gcd(a, b);  
 }  

int main()
{
  ll a,b,c,d;
  cin>>a>>b>>c>>d;
  ll cnt=0; 
  ll p=lcm(c,d);
  ll f=a/c,s=b/c;
  cnt+=s-f;if(a%c==0)cnt++;
   f=a/d,s=b/d;
  cnt+=s-f;if(a%d==0)cnt++;
   f=a/p,s=b/p;
  cnt-=s-f;if(a%p==0)cnt--;
  cout<<b-a+1-cnt<<endl;
 
  return 0;  
}


Measured memory_bytes: 256
n = gets.to_i
jewels = []
2.times do
  jewels.push(gets.split(" ").map(&:to_i))
end
sum = 0
n.times do |num|
  if jewels[0][num] > jewels[1][num]
    sum += jewels[0][num] - jewels[1][num]
  end
end
puts sum

Measured memory_bytes: 1788
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func main() {
  sc.Split(bufio.ScanWords)
   a, b, c, k := nextInt(), nextInt(),nextInt(), nextInt()
  
  if a-k >= 0{
  	fmt.Println(k)
  }else if a+b-k >= 0{
  	fmt.Println(a)
  }else if c > 0{
    fmt.Println(a+((a+b)-k))
  }

}

Measured memory_bytes: 1756
A,B,C,D = map(int, input().split())

def makemade(x,y):
    ans = x//y + 1
    if x%y == 0:
        ans = ans -1
    return ans

taka = makemade(A,D)
ao = makemade(C,B)

if ao <= taka :
    print("Yes")
else:
    print("No")

Measured memory_bytes: 9188
let string_to_list str =
  let rec loop i limit =
    if i = limit then []
    else (String.get str i) :: (loop (i + 1) limit)
  in
  loop 0 (String.length str)

let fwd arr_length n = if n = (arr_length - 1) then 0 else n+1
let prev arr_length n = if n = 0 then arr_length - 1 else n-1
let flip c = if c = 'S' then 'W' else 'S'
let print_chars arr = Array.iter (fun x -> Printf.printf "%c" x) arr; Printf.printf "\n"
           
let fill arr arr_length n by =
  arr.(fwd arr_length n) <- 
    if (arr.(n) == 'S' && by = 'o') || (arr.(n) == 'W' && by = 'x') then
      arr.(prev arr_length n)
    else
      flip arr.(prev arr_length n)

let rec extend answers ans_length cursor ret = match answers with
  | [] -> ret
  | x::rest ->
     fill ret ans_length cursor x;
     extend rest ans_length (cursor+1) ret

let check arr arr_length by n =
  if (arr.(n) == 'S' && by = 'o') || (arr.(n) == 'W' && by = 'x') then
    arr.(fwd arr_length n) = arr.(prev arr_length n)
  else
    arr.(fwd arr_length n) <> arr.(prev arr_length n)

let make_list f t step =
  let rec make_list_inner c t lst =
    if c >= t then lst else make_list_inner (c+step) t (c::lst)
  in
  List.rev (make_list_inner f t [])

let check_all pos_ans length pairs =
  let checks = List.mapi (fun x y -> check pos_ans length y x) pairs in
  List.for_all (fun x -> x) checks

let array_make length a b =
  let ret = (Array.make length a) in
  ret.(length - 1) <- b;
  ret

let solve str =
  let str_list = (string_to_list str) in
  let length = List.length str_list in
  let pos_ans = extend str_list length 0 (array_make length 'S' 'S') in
  if check_all pos_ans length str_list then pos_ans else
    let pos_ans = extend str_list length 0 (array_make length 'S' 'W') in
    if check_all pos_ans length str_list then pos_ans else
      let pos_ans = extend str_list length 0 (array_make length 'W' 'W') in
      if check_all pos_ans length str_list then pos_ans else
        let pos_ans = extend str_list length 0 (array_make length 'W' 'S') in
        if check_all pos_ans length str_list then pos_ans else
          [||]
  
let () =
  let _ = read_int() in
  let str = read_line () in
  let ans = solve str in
  if ans = [||] then
    Printf.printf ("-1")
  else
    Array.iter (fun x -> Printf.printf "%c" x) ans;
  Printf.printf "\n"
;;


Measured memory_bytes: 17792
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <iomanip>

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

template <typename T>
using vector2 = vector<vector<T>>;
template <typename T>
vector2<T> initVec2(size_t n0, size_t n1, T e = T()){
    return vector2<T>(n0, vector<T>(n1, e));
}

template <typename T>
using vector3 = vector<vector<vector<T>>>;
template <typename T>
vector3<T> initVec3(size_t n0, size_t n1, size_t n2, T e = T()){
    return vector3<T>(n0, vector2<T>(n1, vector<T>(n2, e)));
}

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

    int n;
    cin >> n;

    vector<int> level(500);
    int x = 1;
    int l = 1;
    while(x < 500){
        for(int i = x; i < 500; i += x * 2){
            level[i] = l;
        }
        x *= 2;
        l++;
    }

    rep(i, n - 1){
        for(int j = i + 1; j < n; j++){
            cout << level[j-i] << " ";
        }
        cout << endl;
    }

    return 0;
}


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

int n, a, ans = (1 << 30);
int main() {
	cin >> n;
	rep(i, n) {
		cin >> a;
		ans = min(ans, (a & (-a)));
	}
	cout << (int)log2(ans) << endl;
}

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

int n;
long long a[300005];
int main() {
	scanf("%d", &n);
	for (int i = 1; i <= 3 * n; i++) {
		scanf("%I64d", &a[i]);
	}
	sort(a + 1, a + (3 * n) + 1);//
	long long ans = 0;
	for (int i = n + 1; i <= 3 * n; i += 2) {
		ans += a[i];
	}
	cout << ans;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);

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

    double a, b, x;
    cin >> a >> b >> x;

    if (x == pow(a, 2) * b) {
        double ans = 0;
        printf("%.10f\n", ans);
    } else if (x < pow(a, 2) * b / 2) {
        double tmp = 2.0 * x / b / a;
        double angle = atan2(tmp, b) * 180.0 / PI;
        printf("%.10f\n", 90.0 - angle);
    } else if (x == pow(a, 2) * b / 2) {
        double ans = 45;
        printf("%.10f\n", ans);
    } else {
        double tmp = (pow(a, 2) * b - x) * 2.0 / a / a;
        double angle = atan2(tmp, a) * 180.0 / PI;
        printf("%.10f\n", angle);
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
const long long INF = LLONG_MAX / 2;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i, r, n) for(int i=(ll)(r); i<(ll)(n); i++) 
#define REP(i, n) FOR(i, (0), n)
#define ALL(r) r.begin(), r.end()
#define ll long long int
using namespace std;
string s;
vector<ll> v;
vector<pair<ll, ll>> vp;
vector<vector<ll>> vv(110, vector<ll>(50, 0));
vector<tuple<ll, ll, ll>> vt;
set<ll> st;
map<ll, ll> mp;

int main()
{
	ll n;
	cin >> n;
	FOR(i,2,n+1)
	{
		ll cnt = 2, k = i;
		while(k>1)
		{
			if (k%cnt) cnt++;
			else {
				mp[cnt]++;
				k /= cnt;
			}
		}
	}
	ll prod = 1;
	REP(i,1001)
	{
		prod *= mp[i] + 1;
		prod %= MOD;
	}
	cout << prod << endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <queue>
#include <cctype>
#include <stdio.h>
#include <map>
#include <string.h>
#include <algorithm>
#include <vector>
using namespace std;


map<char, int> mymap;
int main(int argc, char const* argv[])
{
    //0なら左　1なら右
    mymap['a'] = 0;
    mymap['b'] = 0;
    mymap['c'] = 0;
    mymap['d'] = 0;
    mymap['e'] = 0;
    mymap['f'] = 0;
    mymap['g'] = 0;
    mymap['h'] = 1;
    mymap['i'] = 1;
    mymap['j'] = 1;
    mymap['k'] = 1;
    mymap['l'] = 1;
    mymap['m'] = 1;
    mymap['n'] = 1;
    mymap['o'] = 1;
    mymap['p'] = 1;
    mymap['q'] = 0;
    mymap['r'] = 0;
    mymap['s'] = 0;
    mymap['t'] = 0;
    mymap['u'] = 1;
    mymap['v'] = 0;
    mymap['w'] = 0;
    mymap['x'] = 0;
    mymap['y'] = 1;
    mymap['z'] = 0;
    string s;
    while ( cin >> s && s != "#" ) 
    {
        int count = 0;
        char pre, next;        
        next = s[0];
        for (int i = 0; i < s.length() - 1; i++) 
        {
            pre = next;
            next = s[i+1];
            if ( (mymap[pre] + mymap[next]) % 2 == 1)
            {
                count++;
            }
        }
        cout << count << endl;
    }

    return 0;
}

Measured memory_bytes: 1188
/*
Author : N_o_o_B
Created : April 11 2020 15:00:15 
*/
#include <bits/stdc++.h>
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
*/
#define TRACE
#ifdef TRACE
#define trace(...) { cerr<<"[ "; __trace__(#__VA_ARGS__, __VA_ARGS__);}
#undef endl
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &x) {
    return out<<"("<<x.first<<","<<x.second<<")";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
void __trace__(const string name, Arg1&& arg1){
    cerr << name << " : " << arg1 << " ] " << endl;
}
 
template <typename Arg1, typename... Args>
void __trace__(const string names, Arg1&& arg1, Args&&... args){
    const string name = names.substr(0,names.find(','));
    cerr<<name<<" : "<<arg1<<" | ";
    __trace__(names.substr(1+(int)name.size()), args...);
}
#else
    #define trace(args...)
#endif
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vll;
typedef vector<vl> vvl;
//typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> oset;
#define fori(i,n) for(int i=0;i<n;i++)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repd(i,a,b) for(int i=a;i>=b;i--)
#define ford(i,n)  for(int i=n-1;i>=0;i--)
#define trav(x,a) for(auto& x:a)
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define sz(a) (int)a.size()
#define fi first
#define se second
clock_t time_p=clock();
void time_taken()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
//const ll mod=998244353;
const ll mod=1e9+7;
const ll INF=1e18;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    cout.precision(12);cout << fixed;

    int x,y,z;
    cin >> x >> y >> z;
    cout << z <<" " <<  x <<  " " << y << endl;



    time_taken();
    return 0;
}

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

#define dbg(a)  cerr << __LINE__ << ": " << #a << " = " << a << '\n'

template<class T> inline istream& operator>>(istream& str, vector<T> &a) { for (auto &i : a) str >> i; return str; }

typedef long long ll;

int main(){
  ios::sync_with_stdio(0), cin.tie(0);
  
  int n, k; cin >> n >> k;
  ll a[n];
  for (int i = 0; i < n; ++i){
    cin >> a[i];
  }
  for (int i = k; i < n; ++i){
    if(a[i-k]>=a[i]){
      cout << "No\n";
    } else {
      cout << "Yes\n";
    }
  }
  return 0;
}

Measured memory_bytes: 5220
#include <stdio.h>

#define MAX_N 100

int bubbleSort(int A[], int N);

int main() {
  int N;
  int A[MAX_N];
  int cnt;
  int i;

  scanf("%d", &N);
  for(i = 0; i < N; ++i) scanf("%d", A+i);

  cnt = bubbleSort(A, N);
  for(i = 0; i < N; ++i) printf("%d%c", A[i], " \n"[i==N-1]);
  printf("%d\n", cnt);

  return 0;
}

int bubbleSort(int A[], int N) {
  int cnt = 0;
  int tmp;
  int flag = 1;
  int j;

  while(flag) {
    flag = 0;
    for(j = N-1; j > 0; --j) {
      if(A[j] < A[j-1]) {
        tmp = A[j];
        A[j] = A[j-1];
        A[j-1] = tmp;
        flag = 1;
        ++cnt;
      }
    }
  }
  return cnt;
}



Measured memory_bytes: 2072
#include <bits/stdc++.h>
using namespace std;
 
int main() {
string s;
  cin>>s;
  int n=s.length();
  int ans=1000;
  for (int i = 0; i <= n-3; i++) {
    int a = s[i] -'0';
      int b =s[i+1] -'0';
 int c = s[i+2] -'0';
    int x = a*100+b*10+c;
    ans =min(ans,abs(753-x));
    
}
 
cout<<ans<<endl;
}

Measured memory_bytes: 764
read a b c k

min() {
	min=$1
    shift
    
    for i in $@
    do
    	if (( "$i" < "$min" )); then
        	min=$i
        fi
    done
    
    echo "$min"
}

echo $(( "$(min "$k" "$a" "$(( 2 * "$a" + "$b" - "$k" ))")" ))


Measured memory_bytes: 3752
import java.util.Scanner;

public class Main {
    public static int gcd(int a, int b)
    {
        while (a*b != 0){
            if (a > b){
                a %= b;
            }else{
                b %= a;
            }
        }
        return a + b;
    }
    public static void main(String[] args) {
        int K;
        Long sum = 0L;
        Scanner sc = new Scanner(System.in);
        K = sc.nextInt();
        for(int i = 1 ; i <= K ; i++)
        {
            for(int j = 1 ; j <= K ; j++)
            {
                for(int k = 1 ; k <= K ; k++)
                {
                    sum += gcd(gcd(i,j),k);
                }
            }
        }
        System.out.println(sum);
    }
}


Measured memory_bytes: 52964
a, b = map(int, input().split())
 
kleine = 2018
 
if b-a == 1:
	print((a*b)%2019)
elif b-a>= 2018:
	print(0)    
else:
	for i in range (a, b):
		for j in range (i+1, b+1):
			k = (i*j)%2019
			if k < kleine:
				kleine = k
			else:
				continue
	print(kleine)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
const ll MOD = 1e9+7;
const ll INF = 1LL << 60;
const vi d8x = {1, 0, -1, 0, 1, -1, -1, 1};
const vi d8y = {0, 1, 0, -1, 1, 1, -1, -1};
const vi d4x = {1, 0, -1, 0};
const vi d4y = {0, 1, 0, -1};

//---------------from here-----------------

int main(){
    ll n; cin>>n;
    vector<ll> a(n);
    rep(i,n) cin>>a[i];
    ll ans=0;
    rep(i,n){
        ans=__gcd(ans,a[i]);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int n,a[110];
long long ans=0;
int main()
{
	cin>>n;
	for (int i=1;i<=n;i++)
	  cin>>a[i];
	for (int i=1;i<=n;i++)
	  for (int j=i+1;j<=n;j++)
	    ans+=1LL*a[i]*a[j];
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define ll long long 
#define db double
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define swap(T, a, b) ({T ttt = a; a = b; b = ttt;})
ll x, Ans = 0; 
int main()
{
   std::cin >> x;
   Ans += (x / 11) * 2; x %= 11; 
   if (x > 0 && x <= 6) Ans += 1;
   else if (x > 6 && x <= 11) Ans += 2;
   std::cout << Ans << std::endl; 
   return 0; 
}


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

int main()
{
    int x1,y1,x2,y2;
    cin >> x1 >> y1 >> x2 >> y2;
    
    int dx,dy;
    dx = x2-x1;
    dy = y2-y1;
    
    cout << x2-dy << " " 
        << y2+dx << " "
        << x1-dy << " "
        << y1+dx << endl;
    
}



Measured memory_bytes: 3568
import math
  
a = int(raw_input())
  
while a > 0:
    a -= 1
    x1,y1,x2,y2,x3,y3 = map(float,raw_input().split())
  
    a1 = 2*(x2-x1)
    b1 = 2*(y2-y1)
    c1 = x1*x1-x2*x2+y1*y1-y2*y2
    a2 = 2*(x3-x1)
    b2 = 2*(y3-y1)
    c2 = x1*x1-x3*x3+y1*y1-y3*y3
  
    X = (b1*c2-b2*c1)/(a1*b2-a2*b1)
    Y = (c1*a2-c2*a1)/(a1*b2-a2*b1)
  
    R = math.sqrt((X-x1)*(X-x1)+(Y-y1)*(Y-y1))                                     
  
    print "%.3f %.3f %.3f" % (X,Y,R)

Measured memory_bytes: 4416
#include <iostream>

using namespace std;

int mod(int x){
	return (x >= 0 ? x : -x);
}
int main(){
	int n, k; cin >> n >> k;
	int a[n];
	for (int i = 0; i < n; ++i)
	{
		cin >> a[i];
	}
	int d[n+k];
	for (int i = 0; i < n+k; ++i)
	{
		d[i] = 1<<30;
	}
	d[0] = 0;
	for (int i = 0; i < n-1; ++i)
	{
		for (int j = i+1; j <= i+k; ++j)
		{
			d[j] = min(d[j], d[i] + mod(a[i] - a[j]));
		}
	}
	cout << d[n-1];
}

Measured memory_bytes: 4376
function Main(input) {
    var N = input[0].split('');
    var A = 0;
    var B = 0;

    for (var i = 0; i < N.length; i++) {
        if (N[i] === 'A') {
            A++;
        }
        if (N[i] === 'B') {
            B++;
        }
    }

    console.log(A !== 0 && B !== 0 ? 'Yes' : 'No');
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));

Measured memory_bytes: 21952
#include <cstdio>
#include <algorithm>
using namespace std;

int r,d,x;

int main()
{
    scanf("%d%d%d",&r,&d,&x);
    for (int i=1;i<=10;i++)
    {
        x=r*x-d;
        printf("%d\n",x);
    }
    getchar(); getchar();
    return 0;
}

Measured memory_bytes: 128
package main

import (
		"fmt"
)

func reverse(s string) string{
	rs := []rune(s)
    for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
        rs[i], rs[j] = rs[j], rs[i]
    }
    return string(rs)
}

func main()  {
	var s string
	fmt.Scanf("%s", &s)
	rs := reverse(s)

	short := string([]rune(s)[:(len(s)-1)/2])
	rs_short := reverse(short)
	
	short_2 := string([]rune(s)[:(len(s)-1)/2])
	rs_short_2 := reverse(short_2)

	if s == rs && short == rs_short && short_2==rs_short_2 {
		fmt.Printf("Yes")
	}else{
		fmt.Printf("No")
	}
}

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

int main() {
  int N;
  cin >> N;
  int A = N % 10;
  if (A == 3) {
    cout << "bon" << endl;
  }
  else if (A == 0 || A == 1 || A == 6 || A == 8) {
    cout << "pon" << endl;
  }
  else {
    cout << "hon" << endl;
  }
}


Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順

int main() {
    int a, b;
    cin >> a >> b;
    int c = a * b;
    if (c % 2 == 0) {
        cout << "Even" << endl;
    } else {
        cout << "Odd" << endl;
    }
}


Measured memory_bytes: 256
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

int dp[1 << 16], A[16][16], sum[1 << 16];
signed main() {
    int N; cin >> N;
    for(int i=0; i<N; i++) {
        for(int j=0; j<N; j++) {
            cin >> A[i][j];
        }
    }

    for(int bit=0; bit<(1<<N); bit++) {
        for(int i=0; i<N; i++) {
            for(int j=i+1; j<N; j++) {
                if((bit >> i & 1) and (bit >> j & 1)) {
                    sum[bit] += A[i][j];
                }
            }
        }
    }

    fill(dp, dp + (1<<N), -INF);
    dp[0] = 0;
    for(int bit=0; bit<(1<<N); bit++) {
        chmax(dp[bit], dp[0] + sum[bit]);
        for(int mask=bit; mask>0; mask=(mask-1)&bit) {
            chmax(dp[bit], dp[mask] + sum[bit - mask]);
        }
    }
    cout << dp[(1 << N) - 1] << endl;
    return 0;
}


Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
const ll INF=mod*mod;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(x) (x).begin(),(x).end()
ll min(ll a,ll b){
  if(a>b){
    return b;
    }
      else{
        return a;
      }
  }
  
  ll max(ll a,ll b){
    if(a>b){
      return a;
    }
    else{
      return b;
    }
  }

ll power(ll a,ll b){
 ll ans=1;
 for(ll i=1;i<=b;i++){
ans*=a;
  }
  return ans;
}

 ll gcd(ll m,ll n){
 	if(n==0){
       return m;
     }
   return gcd(n,m%n);
 }
ll lcm(ll a,ll b){
  ll g=gcd(a,b);
  return a/gcd(a,b)*b;
		

}
int main(){
  
  ll N;
  cin>>N;
 ll ans=1;
  bool flag=true;
  for(ll i=1;i<=N;i++){
    
    ans=i*1.08;
    
    if(ans==N){
cout<<i<<endl;
      flag=false;
      break;
    }
  }

  if(flag){
    cout<<":("<<endl;
            }
  
}




Measured memory_bytes: 256
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt(), b = scan.nextInt();
        String judge = "";
        if(a > b){ judge = "a > b"; }
        else if(a < b){ judge = "a < b"; }
        else{ judge = "a == b"; }
        System.out.println(judge);
    }
}


Measured memory_bytes: 26156
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using static System.Math;
 
public class Hello{
    public static void Main(){
        long readhp = long.Parse(ReadLine());
//        string[] reader = ReadLine().Split(' ');
//        int monster = int.Parse(reader[0]);
//        int wazasu = int.Parse(reader[1]);
//        string[] readerhp = ReadLine().Split(' ');
//        long total = 0;
//        int leng = readerhp.Length;


        long checker = 1;
        
        while(checker <= readhp){
            checker *= 2;
        }
        
        WriteLine(checker-1);

/*        int[] hplist = new int[leng];
        for(int i=0;i<leng;i++){
            hplist[i] = int.Parse(readerhp[i]);
        }
        
        Array.Sort(hplist);
        Array.Reverse(hplist);
        
        if(leng >= wazasu){
            for(int i=0;i<wazasu;i++){
                hplist[i] = 0;
            }
            
            for(int i=0;i<leng;i++){
            total += hplist[i];
            }
        }else{
            total = 0;
        }
        
        WriteLine(total);
*/
/*        for(int i=0;i<wazasu;i++){
            total += int.Parse(readerwaza[i]);
        }
        
        if(total >= hp){
            WriteLine("Yes");
        }else{
            WriteLine("No");
        }*/
        
/*        string[] hyokol = ReadLine().Split(' ');
        double minsa = 99999999;
        int titen = 0;
        for(int i=0;i<kazu;i++){
            int hyoko = int.Parse(hyokol[i]);
            double hiku = (double)(hyoko*6)/1000;
            double kionh = (double)kion - hiku;
            double sa = Abs(kionh - (double)moku);
//            WriteLine(kionh);
//            WriteLine(sa);
            if(minsa > sa){
                minsa = sa;
                titen = i+1;
            }
        }
        WriteLine(titen);*/
    }
}

Measured memory_bytes: 13140
class RollingHash():
    def __init__(self,s):
        self.n=n=len(s)
        self.b=b=129
        self.M=M=2**61-1
        x,y=1,0
        self.f=f=[x]*(n+1)
        self.h=h=[y]*(n+1)
        for i,c in enumerate(s.encode()):
            f[i+1]=x=x*b%M
            h[i+1]=y=(y*b+c)%M
    def get(self,l,r):
        return(self.h[r]-self.h[l]*self.f[r-l])%self.M
def check(x):
    d={}
    for i in range(0,n-x+1):
        k=s.get(i,i+x)
        if k in d:
            if d[k]+x<=i:
                return True
        else:
            d[k]=i
    return False
n=int(input())
s=RollingHash(input())
ok,ng=0,n
while ng-ok>1:
    mid=ok+ng>>1
    if check(mid):
        ok=mid
    else:
        ng=mid
print(ok)

Measured memory_bytes: 4220
#define _CRT_SECURE_NO_WARNINGS
/*                   وتزودوا فإن خير الزاد التقوى                    */
/*       وما تدري نفس ماذا تکسب غدا وما تدري نفس باي ارض تموت      */
#include <bits/stdc++.h>
#include<unordered_map>
#include<iomanip>
#include<fstream>
using namespace std;
#include<iostream>
#define endl '\n'
#define ll long long
#define ull unsigned long long
#define dll double
#define PI acos(-1)
#define watch(x) cout<<#x<<" = { "<<x<<" }\n"
#define sz(n) n.size()
#define M_Sayed fast() 
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define RT(v) return cout<<v,0
int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
const double EPS = (1e-7);
ll Ceil(ll x, ll y) { return (x + y - 1) / y; }
void run() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#else
#endif
}
ll gcd(ll a, ll b) { return !b ? abs(a) : gcd(b, a % b); }
ll lcm(ll a, ll b) { return abs(a / gcd(a, b)) * b; }
ll power(ll x, ll y, ll mod) {
	if (y == 0) return 1;
	if (y == 1) return x % mod;
	ll r = power(x, y >> 1, mod);
	return (((r * r) % mod) * power(x, y & 1, mod)) % mod;
}
void fast() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); }
ll n, m, k,su,cnt;
ll vis[100009];
vector<ll>v;
ll Jum(int x) {
	if (x+1 == n)
		return 0;
	ll &ret = vis[x];
	if (~ret)return ret;
	 ret = abs(v[x] - v[x + 1])+Jum(x + 1) ;
	for (int i = 2; i <=k; i++) {
		if(i+x<n)ret = min(ret,Jum(x + i) + abs(v[x] - v[x + i]));
	}
	return ret;
}
int main()
{
	//run();
	M_Sayed;
	cin >> n>>k ;
	memset(vis, -1, sizeof vis);
	v.resize(n);
	for (int i = 0; i <n; i++) {
		cin >> v[i];
	}
	RT(Jum(0));
}

Measured memory_bytes: 8064
// mmm
// dfs

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
const int inf=1e9+7;
const ll INF=1LL<<61;
const ll mod=1e9+7;

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


int n;
vector<int> E[100];
vector<bool> v(100);

int dfs(int cu) {
  v[cu]=1;
  int cnt=0;
  for(int to:E[cu]) {
    if (!v[to]) {
      cnt=max(cnt,dfs(to));
    }
  }
  v[cu]=0;
  return cnt+1;
}


int main(){
    int i,j;
    while(1){
        int n;
        cin>>n;
        if(n==0) break;
        for(i=0;i<100;i++) E[i].clear();
        for(i=0;i<n;i++){
            int x,y;
            cin>>x>>y;
            x--; y--;
            E[x].pb(y);
            E[y].pb(x);
        }
        int ans=0;
        for(i=0;i<100;i++) ans=max(ans,dfs(i));
        cout<<ans<<endl;
    }

}


Measured memory_bytes: 3028
#include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define int long
using namespace std;
signed main(void){
    // Here your code !
    int a, b, c;
    cin >> a >> b >> c;
    if(b-a == c-b) cout << "YES" << endl;
    else cout << "NO" << endl;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define PI 3.141592
#define MOD7 1000000007
#define LL_INF 9000000000000000000
#define LL_MINF -9000000000000000000
#define INT_INF 2000000000
#define INT_MINF -2000000000
#define all(a) (a).begin(), (a).end()
#define fi first
#define se second
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int main(){
    int N, M;
    cin >> N >> M;
    vector<pair<int,int>> LR(M);
    for(int i = 0; i < M; i++) cin >> LR[i].fi >> LR[i].se;
    int right = INT_INF;
    for(auto p : LR) right = min(right, p.se);
    int left = 0;
    for(auto p : LR) left = max(left, p.fi);
    cout << max(0, right - left + 1) << endl;
}

Measured memory_bytes: 4040
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"

int main(void) {
	map<int, int> m;
	for (int i = 0; i < 3; i++) {
		int a;
		cin >> a;
		m[a]++;
	}
	(m.size() == 1) ? cout << "Yes\n" : cout << "No\n";
}

Measured memory_bytes: 256
a, b = map(int, input().split())
S = input()

numbers = set([str(i) for i in range(10)])
flag = 0
for s in S[:a]:
  if not s in numbers:
    flag = -1

if S[a] != "-":
  flag = -1

for s in S[a+1:]:
  if not s in numbers:
    flag = -1

if flag == 0:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3064
X,N = map(int,input().split())
P = list(map(int,input().split()))

if X not in P:
    print(X)
    exit()

for i in range(1,101):
    if X-i not in P:
        print(X-i)
        exit()
    elif X+i not in P:
        print(X+i)
        exit()

Measured memory_bytes: 9104
#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x)  cerr<< #x <<" = "<< x<<endl;
using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
int main(){
    //~ freopen("file.in", "r", stdin);
    ll a,b;
    scanf("%lld%lld",&a,&b);
    int ans=0;
    while(a<=b){
		ans++;
		a*=2;
	}
	printf("%d\n",ans);
	return 0;
}


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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vll = vector<ll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	for (auto &u : v) os << u << el;
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u;
	return (is);
}
int N;

bool judge(ll val) {
	char c;
#ifdef DEBUG
	if (val <= N && to_string(val) <= to_string(N) ||
			val > N && to_string(val) > to_string(N) ) {
		c = 'Y';
	} else {
		c = 'N';
	}
#else
	cout << "? " << val << el;
	cin >> c;
#endif
	return (c == 'Y');
}

int main() {
#ifdef DEBUG
	cin >> N;
#endif
	ll n = 1;
	ll big = 1000000000;
	ll L = 0;
	while (n <= big) {
		char c;
		if (!judge(n)) break;
		n *= 10;
		L++;
	}
	if (n <= big) {
		ll ng = n / 10, ok = n - 1;
		while (llabs(ng - ok) > 1) {
			ll m = (ng + ok) / 2;
			ll v = m * 10;
			if (judge(v)) ok = m;
			else ng = m;
		}
		cout << "! " << ok << el;
	} else {
		ll n = 2;
		while (!judge(n)) n *= 10;
		cout << "! " << n / 2 << el;
	}
	return (0);
}

Measured memory_bytes: 596
#include<iostream>
using namespace std;
   
int Merge(int A[],int left,int mid,int right){
  int n1=mid-left;
  int n2=right-mid;
  int i,j,k;
  int L[n1+1],R[n2+1];
     
  for(i=0;i<n1;i++)L[i]=A[left+i];
  for(i=0;i<n2;i++)R[i]=A[mid+i];
  L[n1]=1000000000;
  R[n2]=1000000000;
     
  i=j=0;
  for(k=left;k<right;k++){
    if(L[i]<=R[j]){
      A[k]=L[i];
      i++;
    }else{
      A[k]=R[j];
      j++;
    }
  }
  return right-left;
}
   
int Merge_Sort(int A[],int left,int right){
  int mid,res=0;
  if(left+1<right){
    mid=(left+right)/2;
   
    res+=Merge_Sort(A,left,mid);
    res+=Merge_Sort(A,mid,right);
    res+=Merge(A,left,mid,right);
       
  }
  return res;
}
   
int main(){
  int i,x,n,S[500000];
  cin>>n;
  for(i=0;i<n;i++)cin>>S[i];
   
  x=Merge_Sort(S,0,n);
     
  for(i=0;i<n;i++){
    if(i)cout<<" ";
    cout<<S[i];
  }
  cout<<endl;
  cout<<x<<endl;
  return 0;
}


Measured memory_bytes: 6864
from collections import deque

N, Q = map(int, input().split())
graph = [[] for _ in range(N+1)]
ans = [0] * (N+1)

for i in range(N-1):
  x, y = map(int, input().split())
  graph[x].append(y)
  graph[y].append(x)
  
for i in range(Q):
  p, x = map(int, input().split())
  ans[p] += x
  
flag = [0] * (N+1)
flag[1] = 1
q = deque([1])
while q:
  parent = q.popleft()
  for child in graph[parent]:
    if(flag[child] == 0):
      ans[child] += ans[parent]
      flag[child] = 1
      q.append(child)
      
ans = ans[1:]
print(*ans)

Measured memory_bytes: 56160
def resolve():
    # 読み込み
    N, Q = map(int, input().split())
    S = 'X' + input()
    l = [0]
    r = [0]
    for i in range(Q):
        ll, rr = map(int, input().split())
        l.append(ll)
        r.append(rr)
    
    # n番目までにACが含まれる数をc[n]としてカウント
    c = [0] * (N + 1)
    for i in range(2, N + 1):
        if S[i - 1] == 'A' and S[i] == 'C':
            c[i] = c[i-1] + 1
        else:
            c[i] = c[i-1]

    # 各l[i], r[i]について出力
    for i in range(1, Q+1):
        cr = c[r[i]]
        cl = c[l[i]]

        print(cr - cl)
        
resolve()

Measured memory_bytes: 14332
//#define NDEBUG
#include <cstddef>
#include <cstdint>
#include <vector>

using i8 = ::std::int_least8_t;
using i32 = ::std::int_least32_t;
using i64 = ::std::int_least64_t;
using u8 = ::std::uint_least8_t;
using u32 = ::std::uint_least32_t;
using u64 = ::std::uint_least64_t;
using isize = ::std::ptrdiff_t;
using usize = ::std::size_t;

class rep {
	const usize f, l;

public:
	class itr {
		friend rep;
		usize i;
		itr(usize x) noexcept : i(x) {}

	public:
		void operator++() noexcept { ++i; }
		usize operator*() const noexcept { return i; }
		bool operator!=(const itr x) const noexcept { return i != x.i; }
	};
	rep(usize first, usize last) noexcept : f(first), l(last) {}
	itr begin() const noexcept { return itr(f); }
	itr end() const noexcept { return itr(l); }
};
class revrep {
	const usize f, l;

public:
	class itr {
		friend revrep;
		usize i;
		itr(usize x) noexcept : i(x) {}

	public:
		void operator++() noexcept { --i; }
		usize operator*() const noexcept { return i; }
		bool operator!=(const itr x) const noexcept { return i != x.i; }
	};
	revrep(usize first, usize last) noexcept : f(first), l(last) {}
	itr begin() const noexcept { return itr(l - 1); }
	itr end() const noexcept { return itr(f - 1); }
};
template <class T> bool maxi(T &a, const T &b) {
	return a <= b ? (a = b, 1) : 0;
}
template <class T> bool mini(T &a, const T &b) {
	return b <= a ? (a = b, 1) : 0;
}
template <class T> bool smaxi(T &a, const T &b) {
	return b <= a ? 0 : (a = b, 1);
}
template <class T> bool smini(T &a, const T &b) {
	return a <= b ? 0 : (a = b, 1);
}
template <class T> using vec_alias = ::std::vector<T>;
template <class T> auto md_vec(usize n, const T &value) {
	return ::std::vector<T>(n, value);
}
template <class... Args> auto md_vec(usize n, Args... args) {
	return ::std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
}
template <class T> const T &as_const(const T &v) noexcept { return v; }

#include <algorithm>
#include <iostream>
#include <utility>
#include <array>

int main() {
	::std::array<u32, 3> a;
	for (auto &e : a)
		::std::cin >> e;
	::std::sort(a.begin(), a.end());
	::std::cout << a[2] * 10 + a[1] + a[0] << ::std::endl;
	return 0;
}


Measured memory_bytes: 256
S = list(input())
#print(S)

n = len(S)
# 端と端から同じものに合わせていく
cou = 0
for i in range(n//2):
    if S[i] != S[n-1-i]:
        S[n-1-i] = S[i]
        cou += 1
    else:
        continue
#print(S)
print(cou)

Measured memory_bytes: 3060
#include <stdio.h>

int heap[250];

int main()
{
  int n,i;
  scanf("%d",&n);
  for(i=1;i<=n;i++) scanf("%d",&heap[i]);

  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ",i,heap[i]);
    if(i!=1) printf("parent key = %d, ",heap[i/2]);
    if(2*i<=n) printf("left key = %d, ",heap[2*i]);
    if(2*i+1<=n) printf("right key = %d, ",heap[2*i+1]);
    printf("\n");
  }
  return 0;
}



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

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

        vector<int> dp(N, 0);
        dp[0] = 0;
        dp[1] = abs(h[1]-h[0]);
        for (int i = 2; i < N; ++i) {
                dp[i] = min(abs(h[i]-h[i-2])+dp[i-2], abs(h[i]-h[i-1])+dp[i-1]);
        }
        cout << dp[N-1] << endl;




}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
    using namespace std;
        int main() {
        	int A, B, C, D;
    		cin >> A >> B >> C >> D;
			int A_count = 0;
			while(A > 0){
				A = A - D;
				A_count++;
			}

			int B_count = 0;
			while(C > 0){
				C = C -B;
				B_count++;
			}

			if(A_count >= B_count)	cout << "Yes" << endl;
			else cout << "No" << endl;
        }

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

template <typename T> inline void rd(T& x) {
	int si = 1; char c = getchar(); x = 0;
	while(!isdigit(c)) si = c == '-' ? -1 : si, c = getchar();
	while(isdigit(c)) x = x * 10 + c - 48, c = getchar();
	x *= si;
}
template <typename T, typename... Args>
inline void rd(T& x, Args&... args) { rd(x); rd(args...); }
#define fi first
#define se second
#define mkp std::make_pair
typedef long long ll;
typedef double ff;
typedef std::pair <int, int> pii;
const int kN = 4e5 + 5, kInf = 0x3f3f3f3f;
const ll kMod = 998244353, kInfLL = 0x3f3f3f3f3f3f3f3fLL;

int n, mx, mn, a[kN], cnt;
int main() { 
#ifndef ONLINE_JUDGE
	freopen("a.in", "r", stdin);
	freopen("a.out", "w", stdout);
#endif
	int T = 1; //rd(T);
	while(T--) {
		rd(n); mx = 0; mn = n;
		for(int i = 1; i <= n; ++i)
			rd(a[i]), mx = std::max(mx, a[i]), mn = std::min(mn, a[i]);
		if(mn == mx && mn == n - 1) return printf("Yes\n"), 0;
		if(mx - mn > 1) return printf("No\n"), 0;
		if(mn == mx) --mn;
		for(int i = 1; i <= n; ++i)
			if(a[i] == mn) ++cnt;
		for(int i = 1; i <= n; ++i) {
			int dlt = (a[i] == mn);
			//printf("%d %d\n", cnt - dlt + 1, (n - cnt) / 2);
			if(a[i] < cnt - dlt + 1 || a[i] > cnt - dlt + (n - cnt) / 2)
				return printf("No\n"), 0;
		}
		printf("Yes\n");
	} return 0;
}

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

const int mod = 1e9 + 7;

int n, k;
ll ans = 1;
vector<vector<int>> G;

void dfs(int cur, int pre, int num) {
  ans = ans * num % mod;

  num = k - 1;
  if(pre != -1) num--;
  for (auto nxt : G[cur]) {
    if(nxt == pre) continue;
    dfs(nxt, cur, num);
    num--;
  }
}

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

  G.resize(n);
  for (int i = 0; i < n - 1; i++) {
    int a,b;
    cin >> a >> b;
    a--, b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }

  dfs(0, -1, k);
  cout << ans << '\n';
}

Measured memory_bytes: 9216
/*
 * Click `Run` to execute the snippet below!
 */
 
import java.io.*;
import java.util.*;

/*
 * To execute Java, please define "static void main" on a class
 * named Solution.
 *
 * If you need more classes, simply define them inline.
 */

public class Main {
  
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int ans = 0;
    for(int n = 1; n<=N; n++){
      if(n%2 == 0){
        continue; 
      }
      int cnt = 0;
      
      for(int j = 1; j<=n; j++){
        if(n%j == 0){
          cnt++; 
        }
      }
      if(cnt == 8){
        ans++; 
      }
    }
    System.out.println(ans);
    
    
    
    
    
    /*
    Scanner sc = new Scanner (System.in);
        int N = sc.nextInt();
        int count = 0;
        for (int i = 0; i < N; i++){
            if (i%2 != 0){
              int factorCount = 0;
                for (int j = 1; j <= i; i++){
                    if (i%j==0) factorCount++;
                }
                if (factorCount == 8) count++;
            }
        }
    */
  }
}


Measured memory_bytes: 35824
#include<string.h>
  
int main() {
    char s1[1000001];
    char s2[10001];
    int i, j, k;
  
    scanf("%s", s1);
    scanf("%s", s2);
      
    int s1len = strlen(s1);
    int s2len = strlen(s2);
  
    for (i = 0; i < s1len; i++) {
        if(strncmp(s2, &s1[i], s2len)==0) printf("%d\n", i);
    }
  
    return 0;
}


Measured memory_bytes: 2844
//use itertools::Itertools;
use std::cmp;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::collections::BinaryHeap;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::io::Read;
use std::usize::MAX;

macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

fn solve() {
    input! {
        n: usize,
        t: usize,
        foods:[(usize,usize);n]
    }

    let cap = t - 1;
    let mut foods = foods;
    foods.sort();

    // dp[x][y] = 前からx個までの料理をy時間使って食べた場合の最大の満足度,諦めた最大の料理の満足度
    let mut dp = vec![vec![(0, 0); cap + 1]; n + 1];

    for i in 1..n + 1 {
        let target = i - 1;
        for j in 0..cap + 1 {
            if foods[target].0 > j {
                dp[i][j].0 = dp[i - 1][j].0;
                dp[i][j].1 = cmp::max(dp[i - 1][j].1, foods[target].1);
            } else {
                if dp[i - 1][j - foods[target].0].0 + foods[target].1 > dp[i - 1][j].0 {
                    // iを採用した方がよい
                    dp[i][j].0 = dp[i - 1][j - foods[target].0].0 + foods[target].1;
                    dp[i][j].1 = dp[i - 1][j - foods[target].0].1;
                } else {
                    dp[i][j].0 = dp[i - 1][j].0;
                    dp[i][j].1 = cmp::max(dp[i - 1][j].1, foods[target].1);
                }
            }
        }
    }

    //println!("{:?}", dp);

    let mut ans = dp[0][cap].0 + foods[1].1;
    for i in 1..n {
        ans = cmp::max(ans, dp[i][cap].0 + foods[i].1);
    }
    println!("{}", ans);
}

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet


Measured memory_bytes: 141836