akhauriyash/Code-Regression huggingface dataset:
import java.util.Arrays;
import java.util.Scanner;

/**
 * Domino Quality
 */
public class Main {

    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            int N = sc.nextInt();

            if (N == 2) {
                System.out.println(-1);
                return;
            }

            if (N == 3) {
                System.out.println("aa.");
                System.out.println("..a");
                System.out.println("..a");
                return;
            }

            char[][] c = new char[N][N];
            for (int i = 0; i < N; i++) {
                Arrays.fill(c[i], '.');
            }

            int M = N / 4;
            if (N % 4 != 0) {
                M--;
            }

            for (int i = 0; i < M; i++) {
                place4(c, i * 4);
            }

            if (N % 4 == 1) {
                place5(c, M * 4);
            } else if (N % 4 == 2) {
                place6(c, M * 4);
            } else if (N % 4 == 3) {
                place7(c, M * 4);
            }

            StringBuilder ans = new StringBuilder();
            for (int i = 0; i < N; i++) {
                ans.append(c[i]).append("\n");
            }

            System.out.print(ans.toString());
        }
    }

    static void place4(char[][] c, int n) {
        System.arraycopy("aabc".toCharArray(), 0, c[n], n, 4);
        System.arraycopy("ddbc".toCharArray(), 0, c[n + 1], n, 4);
        System.arraycopy("bcaa".toCharArray(), 0, c[n + 2], n, 4);
        System.arraycopy("bcdd".toCharArray(), 0, c[n + 3], n, 4);
    }

    static void place5(char[][] c, int n) {
        System.arraycopy("aabba".toCharArray(), 0, c[n], n, 5);
        System.arraycopy("bcc.a".toCharArray(), 0, c[n + 1], n, 5);
        System.arraycopy("b..cb".toCharArray(), 0, c[n + 2], n, 5);
        System.arraycopy("a..cb".toCharArray(), 0, c[n + 3], n, 5);
        System.arraycopy("abbaa".toCharArray(), 0, c[n + 4], n, 5);
    }

    static void place6(char[][] c, int n) {
        System.arraycopy("aabc..".toCharArray(), 0, c[n], n, 6);
        System.arraycopy("ddbc..".toCharArray(), 0, c[n + 1], n, 6);
        System.arraycopy("..aabc".toCharArray(), 0, c[n + 2], n, 6);
        System.arraycopy("..ddbc".toCharArray(), 0, c[n + 3], n, 6);
        System.arraycopy("bc..aa".toCharArray(), 0, c[n + 4], n, 6);
        System.arraycopy("bc..dd".toCharArray(), 0, c[n + 5], n, 6);
    }

    static void place7(char[][] c, int n) {
        System.arraycopy("aabbcc.".toCharArray(), 0, c[n], n, 7);
        System.arraycopy("dd.dd.a".toCharArray(), 0, c[n + 1], n, 7);
        System.arraycopy("..d..da".toCharArray(), 0, c[n + 2], n, 7);
        System.arraycopy("..d..db".toCharArray(), 0, c[n + 3], n, 7);
        System.arraycopy("dd.dd.b".toCharArray(), 0, c[n + 4], n, 7);
        System.arraycopy("..d..dc".toCharArray(), 0, c[n + 5], n, 7);
        System.arraycopy("..d..dc".toCharArray(), 0, c[n + 6], n, 7);
    }

}


Measured memory_bytes: 32980
def resolve():
    input()
    num = list(map(int, input().split()))
    num.sort(reverse=True)
    count = 1
    alice = 0
    bob = 0
    for val in num :
        if count % 2 == 0:
            bob += val
        else:
            alice += val
        count += 1
    print(alice - bob if alice >= bob else bob - alice)

if __name__ == '__main__':
        resolve()

Measured memory_bytes: 38256
#include <cstdio>
#include <algorithm>
#define FOR(i, l, r) for(int i = l; i <= r; ++i)

using namespace std;

const int N = 5010;

struct edge{int to, next;} e[N];
int n, k, ans, cnt, x, y;
int head[N], size[N], dep[N];

void ins(int x, int y)
{
    e[++cnt].to = y; e[cnt].next = head[x]; head[x] = cnt;
}

void dfs(int x, int y)
{
    size[x] = (dep[x] == k / 2);
    for(int i = head[x]; i; i = e[i].next)
        if (e[i].to != y)
        {
            dep[e[i].to] = dep[x] + 1;
            dfs(e[i].to, x);
            size[x] += size[e[i].to];
        }
}

int main()
{
    scanf("%d%d", &n, &k); ans = n; ++k;
    FOR(i, 2, n)
    {
        scanf("%d%d", &x, &y);
        ins(x, y); ins(y, x);
    }
    FOR(i, 1, n)
    {
        dep[i] = 0; dfs(i, 0);
        int tans = 0, mx = 0;
        FOR(j, 1, n) if (dep[j] * 2 >= k) ++tans;
        if (k % 2 == 0) for(int j = head[i]; j; j = e[j].next)
            mx = max(mx, size[e[j].to]);
        ans = min(ans, tans - mx);
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 256
def main():
    N=int(input())
    flag=0
    counter=0
    for i in range(N):
        D1,D2=map(int,input().split())
        if D1==D2:
            counter+=1
        else:
            counter=0
        if counter==3:
            flag=1

    if flag==1:
        print("Yes")
    else:
        print("No")
if __name__=="__main__":
    main()

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

int main ()
{
	int n;  cin>>n;
	
	char s;
	bool flag=false;
	for(int i=0;i<n;i++){
		cin>>s;
	     
	     if(s=='Y')
	     flag=true;
	
	
	}
	if(flag) cout<<"Four"<<endl;
	else 
	cout<<"Three"<<endl;
	


}



Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i=0;i<n;i++) cin >> v[i];
    int ans = 0;
    int z = 1, el = v[0];
    for (int i=1; i < n; i++){
        if (v[i] == el) z++;
        else{
            ans += (z)/2;
            z = 1;
            el = v[i];
        }
    }
    ans += (z)/2;
    cout << ans;
    return 0;
}


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

#define INF 3000000000000000000
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

int main(void){
    // Here your code !
    long long int n,a[2000],b[2000],da[2000],db[2000];
    scanf("%lld",&n);
    for(int i=0;i<n;i++)scanf("%lld%lld",&a[i],&b[i]);
    da[0]=a[0];
    db[0]=b[0];
    for(int i=1;i<n;i++){
    	long long int c;
	c=max(((da[i-1]-1)/a[i])+1,((db[i-1]-1)/b[i])+1);
    	da[i]=a[i]*c;
    	db[i]=b[i]*c;
    }

    printf("%lld\n",da[n-1]+db[n-1]);
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define MAX 100005
#define NIL -1

struct Node{int p,l,r,lef;};
struct Node T[MAX]; 

void print(int u){

  int i=T[u].p, depth=0;
  while(i!=NIL){
    i = T[i].p;
    depth++;
  }

  if(depth==0){
    printf("node %d: parent = %d, depth = %d, root, ",u,T[u].p,depth);
  }else if(T[u].l==NIL){
    printf("node %d: parent = %d, depth = %d, leaf, ",u,T[u].p,depth);
  }else{
    printf("node %d: parent = %d, depth = %d, internal node, ",u,T[u].p,depth);
  }

  i = T[u].l;
  printf("[");
  if(i!=NIL){
    printf("%d",i);
  }

  while (i!=-1){
  i = T[i].r;

  if(i!=NIL){
    printf(", %d", i);
  }
  }
  printf("]\n");
  return 0;
}

int main(){
  int i, j, d, v, c, l, n;

  scanf("%d", &n);

  for(i=0;i<n;i++){
    T[i].p = T[i].l = T[i].r = NIL;
  }

  for ( i = 0; i < n; i++ ){

    scanf("%d %d",&v,&d);

    for(j=0;j<d;j++){
      scanf("%d",&c);
       T[c].p = v;

       if(j==0){
	 T[v].l = c;
       }else if(j>0){
	 T[l].r = c;
       }
       l = c;

    }
  }  

  for (i=0;i<n;i++){
    print(i);
  }
  return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define INF 100000000000000 //10^14 100兆
// aよりもbが大きいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmax(T &a, const T& b) {
  if (a < b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}
// aよりもbが小さいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmin(T &a, const T& b) {
  if (a > b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}

int main(){
  ll K;
  cin >> K;
  string S;
  cin >> S;
  if(sz(S) <= K){
    cout << S << endl;
  }
  else{
    cout << S.substr(0, K) << "..." << endl;
  }
}

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

int main() {
	int64_t a, b, k; cin >> a >> b >> k;
	{
		int64_t eat = min(k, a);
		k -= eat;
		a -= eat;
	}
	{
		int64_t eat = min(k, b);
		k -= eat;
		b -= eat;
	}
	cout << a << " " << b << '\n';
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <stack>
#include <sstream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;
typedef long long int ll;

int main()
{
	int n;
	int a[3];
	cin>>n>>a[0]>>a[1]>>a[2];
	vector<int> l(n);
	rep(i,n) cin>>l[i];
	int ans = 80 + 1000*3;
	for(int bit = 0; bit < pow((double)4,(double)n);bit++){
		int counter = bit;
		vector<vector<int>> numList(3);
		int cost = 0;
		for(int i = 0; i < n; i++){
			if( counter % 4 == 0){
				numList[0].push_back(l[i]);
			}else if( counter % 4 == 1){
				numList[1].push_back(l[i]);
			}else if( counter % 4 == 2){
				numList[2].push_back(l[i]);
			}else{
				//do nothing
			}
			counter /= 4;
		}
		/*for(int i = 0; i < 3; i++){
			cout<<"i th"<<endl;
			for(auto iter = numList[i].begin(); iter != numList[i].end(); iter++){
				cout<<*iter<<" ";
			}
			cout<<endl;
		}*/
		if( numList[0].size() == 0 || numList[1].size() == 0 || numList[2].size() == 0){
			
		}else{
			for(int i = 0; i < 3; i++){
				cost += (numList[i].size()-1)*10;
				int length = 0;
				for(auto iter = numList[i].begin();iter != numList[i].end(); iter++){
					length += *iter;
				}
				cost += abs(a[i] - length);
			}
			//cout<<cost<<endl;
			ans = min(ans,cost);
		}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 3268
package main

import (
	"fmt"
	"math"
)

func main() {
	var N int
	fmt.Scanf("%d", &N)
	ave := 0.0
	ans := 0

	//動的配列
	X := make([]int, N)
	//みんなの座標の平均値（四捨五入）を出して，その距離で計算する
	for i := 0; i < N; i++ {
		fmt.Scanf("%d", &X[i])
		ave += float64(X[i])
	}
	// fmt.Printf("Origin:%f\n", ave)
	ave = math.Round(ave / float64(N))
	// fmt.Printf("after:%f\n", ave)
	for i := 0; i < N; i++ {
		ans += int(math.Pow(ave-float64(X[i]), 2))
	}
	fmt.Println(ans)

}


Measured memory_bytes: 1844
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
// const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1},
//           dx[] = {0, -1, -1, -1, 0, 1, 1, 1};

struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cerr << fixed << setprecision(10);
  }
} iosetup;
/*-------------------------------------------------*/
int main() {
  int n; string s; cin >> n >> s;
  for (char c : s) cout << char('A' + (c - 'A' + n) % 26);
  cout << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define pf push_front
#define ft first
#define sc second
#define all(v) v.begin(), v.end()
using namespace std;
const int maxn = 102, inf = 1e9;
char tab[maxn][maxn];
int dp[maxn][maxn];
int used[maxn][maxn];
int tek = 1;
void dfs(int d, int i, int d1, int i1) {
    if (used[d][i] == tek) return;
    used[d][i] = tek;
    dp[d1][i1] = min(dp[d1][i1], dp[d - 1][i] + 1);
    dp[d1][i1] = min(dp[d1][i1], dp[d][i - 1] + 1);
    if (d > 1 && tab[d - 1][i] == '#') {
        dfs(d - 1, i, d1, i1);
    }
    if (i > 1 && tab[d][i - 1] == '#') {
        dfs(d, i - 1, d1, i1);
    }
}
signed main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int h, w;
    cin >> h >> w;
    for (int d = 1; d <= h; d++) {
        for (int i = 1; i <= w; i++) {
            cin >> tab[d][i];
        }
    }
    for (int d = 0; d <= h; d++) {
        for (int i = 0; i <= w; i++) {
            dp[d][i] = inf;
        }
    }
    dp[0][1] = 0;
    dp[1][0] = 0;
    for (int d = 1; d <= h; d++) {
        for (int i = 1; i <= w; i++) {
            if (tab[d][i] == '.') {
                dp[d][i] = min(dp[d][i], dp[d - 1][i]);
                dp[d][i] = min(dp[d][i], dp[d][i - 1]);
            } else {
                dfs(d, i, d, i);
                tek++;
            }
        }
    }
    cout << dp[h][w];
}


Measured memory_bytes: 384
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

D, N = MAP()
i = 0

print(100**D*N if N < 100 else 100**D*(N+1))


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

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()

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

  int a,b,c;
  cin>>a>>b>>c;
  if(a+b==c)cout<<"Yes"<<endl;
  else if(a+c==b)cout<<"Yes"<<endl;
  else if(c+b==a)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int judge(int a,int b,int c,int l)
{
    int k=0;
    if(a<l)
        k++;
    if(b<l)
        k++;
    if(c<l)
        k++;
    return k;
}
int main()
{
    int a,b,c,sum=0,max1=0;
    scanf("%d%d%d",&a,&b,&c);
    max1=max(a,b);max1=max(max1,c);
    while((max1-a)>=2)
    {
        a+=2;
        sum++;
    }
    while((max1-b)>=2)
    {
        b+=2;
        sum++;
    }
    while((max1-c)>=2)
    {
        c+=2;
        sum++;
    }

    if(judge(a,b,c,max1)==0)
        printf("%d\n",sum);
    else if(judge(a,b,c,max1)==2)
        printf("%d\n",sum+1);
    else
        printf("%d\n",sum+2);
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define SUM(a)  accumulate((a).begin(),(a).end(),0)
#define SORT(a) sort(ALL(a))
#define REV(a) reverse(ALL(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
typedef long long ll;
const int INTINF = 1<<29;
const ll LLINF = 1LL<<61;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int DX[8]={ 0, 1, 0,-1, 1, 1,-1,-1};
const int DY[8]={ 1, 0,-1, 0, 1,-1, 1,-1};


int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int d;
  vector<int> v;
  REP(i,n){
    cin >> d;
    v.push_back(d);
  }
  int ans = 0;
  REP(i,n){
    FOR(j,i+1,n){
      ans += (v[i]*v[j]);
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define int long long
#define MOD 1000000007
 
using namespace std;
 
template <class T> ostream &operator<<(ostream &os, vector<T> V) {
    os << "[ ";
    for (auto v : V)
        os << v << " ";
    os << "]";
    return os;
}
template <class T> ostream &operator<<(ostream &os, set<T> S) {
    os << "{ ";
    for (auto s : S)
        os << s << " ";
    return os << "}";
}
template <class L, class R> ostream &operator<<(ostream &os, map<L, R> M) {
    os << "{ ";
    for (auto m : M)
        os << "(" << m.first << ":" << m.second << ") ";
    return os << "}";
}
template <class L, class R> ostream &operator<<(ostream &os, pair<L, R> P) {
    return os << "(" << P.first << "," << P.second << ")";
}

void solve() {
    int n, k;
    cin >> n >> k;
    int a[n];
    int prev_sum = 0, sum = 0;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        if(i < k) {
            prev_sum += a[i];
        }
    }
    for(int i = k; i < n; i++) {
        int sum = prev_sum;
        sum -= a[i - k];
        sum += a[i];
        if(sum > prev_sum) {
            cout << "Yes" << endl;
        }
        else cout << "No" << endl;

        prev_sum = sum;
    }
}
 
int32_t main() {
    int t;
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    // cin >> t;
    // while(t--) {
    //     solve();
    // }
    return 0;
}

Measured memory_bytes: 5208
// Created by code_sm
//
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp> 
//using namespace __gnu_pbds;
//typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> pseudo_set;
#define ll long long
#define vi vector<int>
#define si set<int> 
#define mii map<int,int>
#define pb push_back
#define pf push_front
#define pii pair<int,int>
#define extract_word(s)  stringstream str(s); while(str>>word)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define SET(s) cout<<fixed<<setprecision(s)
#define chotu 1000000007
#define set0(a) memset(a,0,sizeof(a))
#define endl "\n"
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define lower_string(s) transform(all(s),s.begin(),::tolower())
#define upper_string(s) transform(all(s),s.begin(),::toupper())
#define size(s) s.size()
template<class T> bool umin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool umax(T &a, T b) { return a < b ? (a = b, true) : false; }
template<typename T,typename U>
bool compare(T x,U y){return(abs(x-y)<=1e-9);}
void solve()
{
fastio
	int a1,a2,a3;
	cin>>a1>>a2>>a3;
	if((a1+a2+a3)>=22)
		cout<<"bust";
	else
		cout<<"win";
}
int main()
{
//code
	
fastio	
int t;
t=1;
while(t--)
{
	solve();
	cout<<endl;
}
}


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

int main()
{
    int n,k; cin>>n>>k;
    int x;
    int sm=0;
    for(int i=0;i<k;i++)
    {
        cin>>x;
        sm+=x;
    }
    if(sm>=n)
    {
        cout<<"Yes\n";
    }
    else
    {
        cout<<"No";
    }
    
    
    
}


Measured memory_bytes: 256
import numpy as np
N,M,C=(int(x) for x in input().split())
B=np.array([int(x) for x in input().split()])
count=0
for i in range(N):
	A=np.array([int(x) for x in input().split()])
	if (np.dot(A,B)+C)>0:
		count+=1
print(count)

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

using namespace std;

typedef long long ll;

int main() {
  int n; cin >> n;
  vector <ll> d(n), c(n);
  ll sum = 0;
  ll cnt = 0;
  for(int i = 0; i < n; i++) {
    cin >> d[i] >> c[i];
    sum += d[i] * c[i];
    cnt += c[i];
  }
  cout << (cnt - 1) + (sum - 1) / 9 << '\n';
}

Measured memory_bytes: 3328
process.stdin.resume();
process.stdin.setEncoding('utf8');

var input_lines = []; 
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  input_lines.push(line);
});
reader.on('close', () => {
  var items = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
  var k = Number(input_lines[0]);
  
  console.log(items[k-1]);
});

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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef long long ll;

const int MOD = 1000000007;

ll calc(ll a) {
    // 10^12 <= 2進数40桁くらい
    if (a <= 0) return 0;

    // a=4のとき 0,1,2,3,4までの数を見るので5つの整数まで
    a++;

    ll ans = 0;
    rep(i, 50) { // i桁目の周期を調べる
        // 0桁目 => 周期2
        // 1桁目 => 周期4
        // 2桁目 => 周期8
        ll loop = (1LL << (i + 1));
        ll cnt = (a / loop) * (loop / 2); // loopした回数 * loop中に1が出現する回数
        cnt += max(0LL, (a % loop) - (loop / 2)); // 残った端数の1の数 loop出来なかった余りの個数から前半のloop/2個の0の個数を引く 引きすぎた場合を考慮してmaxを取る

        if (cnt % 2 == 1) {
            ans += 1LL << i;
        }
    }

    return ans;
}

int main() {
    ll A, B;
    cin >> A >> B;
    ll ans = calc(B) ^calc(A - 1);
    cout << ans << 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>;

const int INF = 1e9;
int dp[3001][3001];
int main() {
  string s, t;
  cin >> s >> t;
  int ls = s.size(), lt = t.size(), l = max(ls, lt);

  string ans = "                                   ";
  rep(i, ls) {
    rep(j, lt) {
      if (s[i] == t[j]) dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j] + 1);
      dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i + 1][j]);
      dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j + 1]);
    }
  }

  int i = ls, j = lt;
  while (i > 0 && j > 0) {
    if (dp[i][j] == dp[i - 1][j])
      --i;

    else if (dp[i][j] == dp[i][j - 1])
      --j;

    else {
      ans = s[i - 1] + ans;
      --i, --j;
    }
  }
  cout << ans << endl;
  return 0;
}

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

int main () {
  vector<int> vec(3);
  for (int i=0;i<3;++i) cin >> vec[i];
  swap(vec[0],vec[1]);
  swap(vec[0],vec[2]);
  for (int i=0;i<3;++i) cout << vec[i] << " ";
  cout << endl;
  return 0;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,Q,K,A,B;
string S;
const ll MOD = 998244353;
//const ll MOD = (1e+9) + 7;
typedef pair<ll, ll> P;
const ll INF = (1LL<<58);

int main() {
    cin>>N;
    cout<<N + N * N + N * N * N <<endl;
}


Measured memory_bytes: 3636
N = int(input())

es = []
adj = [[] for _ in range(N)]
e_index = dict()
for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    es.append((a, b))
    es.append((b, a))
    adj[a].append(b)
    adj[b].append(a)
    e_index[(a, b)] = i
    e_index[(b, a)] = i

M = int(input())
uvs = [tuple(map(int, input().split())) for _ in range(M)]

edges = [0] * (N - 1)
for i, (u, v) in enumerate(uvs):
    u -= 1
    v -= 1
    parent = [-1] * N
    stack = [u]
    while stack:
        node = stack.pop()
        if node == v:
            break

        for next_node in adj[node]:
            if parent[node] != next_node:
                parent[next_node] = node
                stack.append(next_node)
             
    node = v
    while node != u:
        next_node = parent[node]
        index = e_index[(node, next_node)]
        edges[index] |= 1 << i
        node = next_node

dp = [0] * (1 << M)
dp[0] = 1
for e in edges:
    for i in range((1 << M) - 1, -1, -1):
        dp[i | e] += dp[i]

print(dp[-1])


Measured memory_bytes: 75376
#include <iostream>
#include <string>
#include <stack>
using namespace std;
int main(){
    int A, B, C, D;
    string X;
    cin >> X;
    A = X[0]-48;
    B = X[1]-48;
    C = X[2]-48;
    D = X[3]-48;
    int nums[4] = {A, B, C, D};
    //cout << A << B << C << D << endl;
    string op1 = "", op2 = "", op3 = "";
    stack<string> S;
    S.push("");
    while (!S.empty()){
        string ops = S.top();
        S.pop();
        int len = ops.size();
        if(len == 3){
            int ans = A;
            for(int i = 0; i < 3; i++){
                if(ops[i] == '+'){
                    ans += nums[i+1];
                }
                else{
                    ans -= nums[i+1];
                }
                if(ans == 7) {
                    cout << A << ops[0] << B << ops[1] << C << ops[2] << D << "=7" << endl;
                    return 0;
                }
            }
        }
        else{
            string opsp = ops + "+";
            string opsm = ops + "-";
            //cout << opsp << " " << opsm << endl;
            S.push(opsp);
            S.push(opsm);
            //cout << "top " << S.top() << endl; 
        }
        //cout << ops << endl;
        
    }
    return 0;
}

Measured memory_bytes: 256
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
//#include <utility>
//#include <memory>
//#include <functional>
//#include <deque>
//#include <cctype>
//#include <ctime>
//#include <numeric>
//#include <list>
//#include <iomanip>

//#if __cplusplus >= 201103L
//#include <array>
//#include <tuple>
//#include <initializer_list>
//#include <forward_list>
//
//#define cauto const auto&
//#else

//#endif

using namespace std;


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

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

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

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	int n;
	while(cin>>n,n){
		vint v(n);
		rep(i,n) cin>>v[i];
		int a;
		cin>>a;
		int l=0;
		int r=n-1;
		int ans=0;
		while(1){
			if(l>r) break;
			int mid=(l+r)/2;
			ans++;
			if(v[mid]==a){
				break;
			}
			else if(v[mid]<a){
				l=mid+1;
			}
			else{
				r=mid-1;
			}
		}
		cout<<ans<<endl;
	}
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(20);
    mainmain();
}

Measured memory_bytes: 3200
n,m = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
r = [[] for i in range(n)]
ans = 0
for i in range(m):
    a,b = [int(i) for i in input().split()]
    r[a-1].append(b-1)
    r[b-1].append(a-1)
for i in range(n):
    for j in r[i]:
        if h[i] <= h[j]:
            ans += 1
            break

print(n-ans)


Measured memory_bytes: 29432
#include <bits/stdc++.h>
	    
	    
	    using namespace std;
	
	    #define ll long long
	    #define do double
	    #define ff first
	    #define ss second
	    #define FOR(a,n) for(i=0;i<n;i++){    cin>>a[i];}
	    #define pb push_back
	    #define mp make_pair
	    #define inf LONG_LONG_MAX
	    #define mod  1000000007
	    #define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
/*	
	    

	ll d,x,y;
	void extendedEuclid(ll A, ll B) 
	{
	    if(B == 0) {
	        d = A;
	        x = 1;
	        y = 0;
	    }
	    else {
	        extendedEuclid(B, A%B);
	        int temp = x;
	        x = y;
	        y = temp - (A/B)*y;
	    }
	}

	ll power(ll x,ll y, ll p) 
	{ 
	    ll res = 1; 
	    x = x % p;
	    while (y > 0) 
	    {  // If y is odd, multiply x with result 
	        if (y & 1) 
	            res = (res*x) % p;
	            
	        y = y>>1; 
	        x = (x*x) % p;   
	    } 
	    return res; 
	} 
	ll isPrime(ll n)
	        {
	            
	           if(n==0 || n==1)
	           return 0;
	            if (n%2 == 0) 
	                return 2;
	            
	            if(n%3==0)
	                return 3;
	         
	            for (ll i=5; i*i<=n; i=i+6)
	            {
	                if (n%i == 0)
	                   return i;
	                if (n%(i+2) == 0)
	                   return i+2;
	            }
	            
	            return n;
	        }



map<ll,ll> par,val;
void ini()
{
	for(ll i=0;i<500010;i++)
		{
			par[i]=i;
		}
}

ll root(ll x)
{
	while(par[x]!=x)
	{
		par[x]=par[par[x]];
		x=par[x];
	}
	return x;
}

void uni(ll x,ll y)
{
	x=root(x);
	y=root(y);
	if(val[x]<=val[y])
		par[y]=par[x];
	else
		par[x]=par[y];
	
}
vector<vector<pair<ll,ll> > > v(200010);
vector<ll> ans;
map<ll,ll> vis,dis;

ll bfs(ll n)
{
	vis[1]=1;
	dis[1]=0;
	ll f=0,i;
	queue<ll> q;
	q.push(1);
	ll ans=0;
	while(q.size()>0)
	{
		ll x=q.front();
		q.pop();
		for(i=0;i<v[x].size();i++)
		{
			if(!vis[v[x][i].ff])
			{
				dis[v[x][i].ff]=dis[x]+v[x][i].ss;
				ans=max(ans,dis[v[x][i].ff]);
				q.push(v[x][i].ff);
				vis[v[x][i].ff]=1;
			}
		}
	}
	return ans;
}
vector<ll> a(1000000);
vector<ll> spf(1000000);
void sieve()
{
	ll i,j;
	bool prime[1000000];
	memset(prime, true, sizeof(prime));
	prime[0]=prime[1]=false; 
	for(i=2;i*i<=1000000;i++)
	{
		if(prime[i]==true)
		{
			for(j=i*i;j<=100000;j+=i)
			{
				prime[j]=false;
				if(spf[j]==0)
					spf[j]=i;
			}
		}
	}
}

int gcdExtended(int a, int b, int *x, int *y) 
{ 

    if (a == 0) 
    { 
        *x = 0, *y = 1; 
        return b; 
    } 
    int x1, y1;
    int gcd = gcdExtended(b%a, a, &x1, &y1); 
    *x = y1 - (b/a) * x1; 
    *y = x1;
    return gcd; 
}  
int modInverse(int b, int m) 
{ 
    int x, y; 
    int g = gcdExtended(b, m, &x, &y); 
    if (g != 1) 
        return -1; 
    return (x%m + m) % m; 
} */

int main()
{
		FAST;
		ll n,m,k,i,j,h;
		ll t;
		cin>>n>>k;
		map<ll,ll> fr;
		for(i=0;i<k;i++)
		{
			cin>>j;
			fr[j]=1;
		}
		ll a[n+10]={0};
		a[0]=1;
		if(fr[1]==0)
		a[1]=1;
		for(i=2;i<=n;i++)
		{
			if(fr[i]==0)
				a[i]=((a[i-1]%mod)+(a[i-2]%mod))%mod;
		}
		cout<<a[n]%mod;
}

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

int main()
{
    long long n;
    long long k;
    long long bt = 0;
    cin >> n >> k;
    multimap<long long, long long> x;
    for (int i = 0; i < n; i++)
    {
        int ai, bi;
        cin >> ai >> bi;
        x.insert({ai, bi});
    }
    for (multimap<long long, long long>::iterator i = x.begin(); i != x.end(); i++)
    {
        bt += i -> second;
        if (bt >= k)
        {
            cout << i -> first;
            return 0;
        }
    }
}


Measured memory_bytes: 6528
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()
A = rl()

m = 1
for a in A:
	m *= a
s = 0
for a in A:
	s += m/a
print(m/s)


Measured memory_bytes: 62188
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=100000+10;

int n;
int a[maxn];
int kq;

int main(){
  cin>>n;
  for(int i=1;i<=n;i++) cin>>a[i];
  sort(a+1,a+n+1);
  int id=n/2;
  kq=a[id+1]-a[id];
  cout<<kq;
}


Measured memory_bytes: 640
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef std::vector<ll> lls;
constexpr ll INF = 1LL << 60;
constexpr ll MOD = 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 + 7;// 998244353L;
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; }
template<class T> inline T MaxE(vector<T>&v,ll S,ll E){T m=v[S];for(ll i=S;i<=E;i++)chmax(m,v[i]);return m;}//v[S]～v[E]の最大値
template<class T> inline T MinE(vector<T>&v,ll S,ll E){T m=v[S];for(ll i=S;i<=E;i++)chmin(m,v[i]);return m;}
template<class T> inline T MaxE(vector<T>&v,ll N) { return MaxE(v, 0, N - 1); } //先頭N個中の最大値
template<class T> inline T MinE(vector<T>&v,ll N) { return MinE(v, 0, N - 1); }
template<class T> inline T MaxE(vector<T>&v) { T m = v[0]; for (T e : v)chmax(m, e); return m; }
template<class T> inline T MinE(vector<T>&v) { T m = v[0]; for (T e : v)chmin(m, e); return m; }
template<class T> inline ll MaxI(vector<T>&v,ll S,ll E){ll m=S;for(ll i=S;i<=E;i++){if(v[i]>v[m])m=i;}return m;}
template<class T> inline ll MinI(vector<T>&v,ll S,ll E){ll m=S;for(ll i=S;i<=E;i++){if(v[i]<v[m])m=i;}return m;}
template<class T> inline ll MaxI(vector<T>&v,ll N) { return MaxI(v, 0, N - 1); }
template<class T> inline ll MinI(vector<T>&v,ll N) { return MinI(v, 0, N - 1); }
template<class T> inline ll MaxI(vector<T>& v) { return MaxI(v, (ll)v.size() ); }
template<class T> inline ll MinI(vector<T>& v) { return MinI(v, (ll)v.size() ); }


void cinv(lls& llVec, ll n, bool to_0_origin = false) {
	ll val;
	llVec.reserve((size_t)(n));
	for (ll i = 0; i < n; i++) {
		cin >> val;
		if (to_0_origin) val--;
		llVec.push_back(val);
	}
}


int main()
{
	ll H, W;
	cin >> H >> W;
	std::vector<std::string> a(H+1);
	ll i_ = 1, j_ = 1;//offset
	for (ll i = 0; i < H; i++) {
		std::string tmp;
		cin >> tmp;
		a[i+i_] = '#' + tmp;
	}
	a[-1 + i_] = std::string(W + 1, '#');

	std::vector<lls> tbl(H + 1, lls(W + 1, 0));

	tbl[0+i_][0+j_] = 1;

	//貰うDP
	for (ll i = 0; i < H; i++) {
		for (ll j = 0; j < W; j++) {
			if (i == 0 && j == 0) continue;

			if (a[i+i_][j+j_] == '#') continue;
			tbl[i + i_][j + j_] = tbl[i - 1 + i_][j + j_] + tbl[i + i_][j - 1 + j_];
			tbl[i + i_][j + j_] %= MOD;
		}
	}

	cout << tbl[H-1+i_][W-1+j_] << '\n';

	return 0;
}


Measured memory_bytes: 9088
import numpy as np

n = int(input())
h = list(map(int, input().split()))

# n = 8
# h = [1,2,3,1,5,6,7,8]

tmp = [h[0]-1]

ok = True
for i in range(1, n):
#     print(tmp, i)
    tmp[i-1]
    if h[i] - tmp[i-1] >= 1:
        tmp.append(h[i] - 1)
    elif h[i] - tmp[i-1] == 0:
        tmp.append(h[i])
    else:
        ok = False
        break
if ok:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 23112
#include "bits/stdc++.h"
using namespace std;
typedef pair<int,int> pii;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

int main(){
    int n,k;
    cin>>n>>k;
    vector<int> v(n);
    rep(i,n)cin>>v[i];
    
    if(n==1 && v[0]!=k){
        cout<<"IMPOSSIBLE"<<endl;
        return 0;
    }
    
    rep(i,n){
        if(v[i] == k){
            cout<<"POSSIBLE"<<endl;
            return 0;
        }
    }
    
    int g = v[0];
    for(int i=1;i<n;i++){
        g = __gcd(g,v[i]);
    }
    
    if(g==1){
        cout<<"POSSIBLE"<<endl;
        return 0;
    }else{
        if(k%g==0 && *max_element(all(v))>=k)cout<<"POSSIBLE"<<endl;
        else cout<<"IMPOSSIBLE"<<endl;
    }
}

Measured memory_bytes: 768
void p(char c1, char c2, int n) {
	for (int i = 0; i < n; i++) {
		putchar(i % 2 ? c1 : c2);
	}
	putchar('\n');
}
int main() {
	int h, w;
	for (;;) {
		scanf("%d %d", &h, &w);
		if (h == 0)return 0;
		for (int i = 0; i < h; i++) {
			if (i % 2) {
				p('#', '.', w);
			} else {
				p('.', '#', w);
			}
		}
		putchar('\n');
	}
}



Measured memory_bytes: 2040
#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i) 
#define REP(i,k,n) for (i = k; i <= n; ++i) 
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);


int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  #ifndef ONLINE_JUDGE
 freopen("input.txt", "r", stdin);
 freopen("output.txt", "w", stdout);
#endif  
 // taskkill -im new.exe -f
  ll n,k;
  cin>>n>>k;
  if(n<10)
    cout<<k + 100 * (10 - n);
  else 
    cout<<k;
  return 0;
}

Measured memory_bytes: 3644
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.lang.*;


public class Main {


    public static void main(String[] args) {
        FastReader in = new FastReader();
        int n = in.nextInt();
        int k = in.nextInt();
        int arr[] = new int[n];
        for(int i=0;i<n;i++){
            arr[i] = in.nextInt();
        }
        int ans[] = new int[n+1];
        ans[1] = 0;
        int limit = Math.min(n,k);
        for(int i=2;i<=limit;i++){
            int min = Integer.MAX_VALUE;
            for(int j=1;j<i;j++){
                min = Math.min(min,ans[j]+Math.abs(arr[i-1]-arr[j-1]));
            }
            ans[i] = min;
        }

        for(int i=k+1;i<=n;i++){
            int min = Integer.MAX_VALUE;
            for(int j=i-k;j<i;j++){
                try {
                    min = Math.min(min, ans[j] + Math.abs(arr[i-1] - arr[j-1]));
                }catch (Exception e){
                    System.out.println(i+" "+j);
                }
            }
            ans[i] = min;
        }
        System.out.println(ans[n]);



    }



    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}



Measured memory_bytes: 34972
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vd = vector<double>;
using vp = vector<P>;
using vs = vector<string>;

#define INF 1000000005
#define mod 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i = 0; i < (n); ++i) /*0からn-1までのrep*/
#define rrep(i,n) for(int i = 1; i <= (n); ++i) /*1からnまでのrep*/
#define drep(i,n) for(int i = (n)-1; i >= 0; --i) /*n-1から0までのrep*/
#define srep(i,s,t) for (int i = s; i < t; ++i) /*sからt-1までのrep*/
#define each(a,b) for(auto& (a): (b)) /*よくわからん*/
#define all(v) (v).begin(),(v).end() /*全選択*/
#define sz(v) (int)(v).size() /*大きさ*/
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end()) /*重複削除*/
#define cmx(x,y) x=max(x,y) /*最大値*/
#define cmn(x,y) x=min(x,y) /*最小値*/
#define fi first
#define se second
#define pb push_back //a.push_back(最後に任意の数字を追加); a.pop_back();
#define rev(v) reverse((v).begin(),(v).end());
#define so(v) sort((v).begin(), (v).end()); //sort((v).begin(), (v).end(), greater<int>());
#define yn {puts("Yes");}else{puts("No");}
const double eps = 1e-10;
const ll MOD = 1000000007;
constexpr ll MAX = 5000000;

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

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

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(){
    COMinit();//COM(n,k) : nCk
    int n;
    cin >> n;
    rep(i,n){
        cout << "ACL";
    }
    return 0;
}

Measured memory_bytes: 120640
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <vector>
#include <set>
#include <numeric>

using namespace std;

int main(){
   int a,b;
   string s;
   cin>>a>>b>>s;
   for(int i=0;i<a+b+1;i++){
      if(i!=a && s[i]=='-'){
         cout<<"No"<<endl;
         return 0;
      }
      if(s[a]!='-'){
         cout<<"No"<<endl;
         return 0;
      }
   }
   cout<<"Yes"<<endl;
   

}

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

int main() {
  long long a, b, x; cin >>a >>b >>x;
  long long ans = 0;
  
  long long ax, bx;
  bx = b/x;
  
  if (a == 0){
    ax = 0;
  }else if (a%x == 0){
    ax = a/x;
  }else{
    ax = a/x+1;
  }
  cout <<bx-ax+1 <<endl;
}


Measured memory_bytes: 256
function Main(input) {
  lines = input.split("\n");
  numbers = lines[1].split(" ");
  count = 0;
  
  for(i=0; i<lines[0]-2; i++){
    max = Math.max(numbers[0], numbers[1], numbers[2]);
    min = Math.min(numbers[0], numbers[1], numbers[2]);
    if(numbers[1] != max && numbers[1] != min){
      count += 1;
    }
    numbers.splice(0,1);
  }
  console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));



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

int main() {
  long long N;
  cin >> N;

  long long ans = 0;

  if (N % 2 == 0) {
    for (long long i = 5; i <= N; i *= 5) ans += N / 2 / i;
  }

  cout << ans << "\n";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int (i) = 1; (i) <= (n); (i++))
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
#define printd(x) printf("%.12f\n", ans);
template<class T> bool chmin(T& a, const T& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b) {if (a < b) {a = b; return 1;} return 0;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main(void) {
	char a, b;
	cin >> a >> b;
	string aa = "", bb = "";

	rep (i, a - '0') aa += b;
	rep (i, b - '0') bb += a;

	cout << min(aa, bb) << endl;

	return 0;
}

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

const int maxn=10;
int x[maxn],y[maxn],n,a[maxn],vis[maxn];
double sum,ans;

void dfs(int id)
{
	if(id==n+1) {
		sum=0;
		for(int i=1;i<n;++i) {
			sum+=sqrt(double(x[a[i]]-x[a[i+1]])*double(x[a[i]]-x[a[i+1]])+double(y[a[i]]-y[a[i+1]])*double(y[a[i]]-y[a[i+1]]));
		}
		ans+=sum;
		return ;
	}
	for(int i=1;i<=n;++i) {
		if(vis[i]) continue;
		vis[i]=1;
		a[id]=i;
		dfs(id+1);
		vis[i]=0;
	}
}

int main()
{
	scanf("%d",&n);
	int t=1;
	for(int i=1;i<=n;++i) t*=i;
	for(int i=1;i<=n;++i) scanf("%d %d",&x[i],&y[i]);
	dfs(1);
	printf("%lf",ans/t);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;

int main(){
    int s;
    cin >> s;
    int ans=1;
    vector<int> num;

    while(true){
        for(int i=0; i<num.size(); i++){
            if(num[i]==s){
                cout << ans << endl;
                return 0;
            }
        }
        num.push_back(s);
        if(s%2==0){
            s /=2;
        }
        else if(s%2==1){
            s = 3*s+1;
        }
        ans ++;
    }
}

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


#define LETS_GET_SCHWIFTY ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);  
#define ff              first
#define ss              second
//#define int             long long
#define ll              long long
#define pb              push_back
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)      __builtin_ctzll(x)
#define mod             998244353
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define vpii            vector<pair<int,int> >
#define all(x)          x.begin(),x.end()
#define matrixprint(arr,a,b,c,d) for(int i=a;i<=c;i++){for(int j=b;j<=d;j++){cout<<arr[i][j]<<" ";}cout<<"\n";}
#define show(arr,x,y)   for(int i=x;i<=y;i++){cout<<arr[i]<<" ";}cout<<"\n"
#define sz(x)           (int)x.size()
#define db(x)           cout<<x<<"\n";

const int N = 2e5 + 5;

#define TRACE
#ifdef TRACE
#define deb(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
#else
#define deb(...)
#endif

	
//////////////////////////////code//////////////////////////////

void solve()
{
   // cout << "-------------------" << "\n";
   
    string s,t;
    cin>>s>>t;
    
    s='#'+s;
    t='#'+t;
    
    
    vector<vi>dp(sz(s)+1,vi(sz(t)+1,0));

    
    for(int i=1;i<sz(s);i++)
    {
        for(int j=1;j<sz(t);j++)
        { 
           dp[i][j] = max(dp[i-1][j],dp[i][j-1]);
            
            if(s[i]==t[j])
            dp[i][j] = max(dp[i-1][j-1]+1,dp[i][j]);
        }
    }
    
 
  
  list<char>ans;
  
  int x = sz(s)-1,y = sz(t)-1;
 
  
  while(x>0 && y>0)
  {  
      if(s[x] == t[y])
      { 
        ans.push_front(s[x]);
        x--,y--;
      }
      else if(dp[x-1][y] > dp[x][y-1])
      x--;
      else
      y--;
  }
    
  for(auto i:ans)
  cout<<i;
  
 

   // cout << "-------------------" << "\n";

}

int32_t main()
{

    LETS_GET_SCHWIFTY;

    int t = 1;
    //cin >> t;

    while (t--)
        solve();

}

// check out for following mistakes-
// if using pb operation on vector and then trying to access index..check if sizeof that vec could remain 0 only
// is using prime sieve make sure it fits


Measured memory_bytes: 38888