akhauriyash/Code-Regression huggingface dataset:
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
//#pragma GCC target("avx,avx2")
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")

//# include <x86intrin.h>
# include <bits/stdc++.h>

# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
 
template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void setIO(string s = "") {
	// cin.exceptions(cin.failbit); 
	// throws exception when do smth illegal
	// ex. try to read letter into int
	if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};

set<string> was;
string t;
int dp[N];
int pos[N];
int from[N];
char nxt[N];

int main () {
	SpeedForce;
	string s;
	cin >> s;
	int n = sz(s);
	s = char(1+'z') + s;
	
	for (int i = 0; i < 26; ++i) pos[i] = n+1;
	for (int i = n; ~i; --i) {
		int mn = 0;
		for (int c = 0; c < 26; ++c) {
			if(dp[pos[mn]] > dp[pos[c]]) mn = c;
		}
		dp[i] = dp[pos[mn]] + 1;
		from[i] = pos[mn];
		nxt[i] = char(mn+'a');
		pos[s[i]-'a'] = i;
	} 
	
	int x = 0;
	while(x <= n) {
		cout << nxt[x];
		x = from[x];
	}
	
	return Accepted;
}

// B...a


Measured memory_bytes: 5556
// </> : towhid1zaman

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair< int, int > pii;
typedef pair< pii, int > ppi;
#define fill(a,b) memset(a,b,sizeof(a))
#define all(v) (v).begin(),(v).end()
#define sp(k) cout<<setprecision(k)<<fixed;
#define rep(i,a) for(int i=0;i<a;i++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define irep(i,b,a) for(int i=(b);i>=(a);--i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define unq(v) sort(all(v)),(v).erase(unique(all(v)),(v).end())
#define _ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"
#define sqr(a) ((a)*(a))
#define sz(a) int(a.size())
#define ff first
#define ss second
#define pb push_back

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int inf = 0x3f3f3f3f;// (int)3e18;
const int maxn = 2000100;



int main(){
        _
        int n,m,x; cin >> n >> m >> x;
        vi a(m);
        int l = 0, r = 0;
        for(int i = 0; i<m; i++){
            cin >> a[i];
            if(a[i]<x)l++;
            else if(a[i]>x)r++;
        }
        cout<<min(l,r)<<endl;

return 0;
}




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



int main(){
    int n,k;
    cin >> n >> k;
    set<int> s;
    rep(i,10) s.insert(i);
    rep(i,k){
        int m;cin >> m;
        s.erase(s.find(m));
    }
    vector<int> temp(5);
    int ans = 100000;
    for(auto m:s)for(auto i:s)for(auto j:s)for(auto k:s)for(auto l:s){
        temp[4] = 10000*m+1000*i+100*j+10*k+l;
        temp[3] = temp[4]%10000;
        temp[2] = temp[4]%1000;
        temp[1] = temp[4]%100;
        temp[0] = temp[4]%10;
        rep(j,5){
            if(temp[j]>=n) ans = min(ans,temp[j]);
        }
    }
    cout << ans << endl;


}

Measured memory_bytes: 3628
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:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        a: usize,
        b: usize,
        c: usize
    }
    let max = std::cmp::max(std::cmp::max(a,b),c);
    println!("{}", a + b + c + 9 * max);
}


Measured memory_bytes: 4352
function main(input) {
  var N = input[0].split(" ")[0]-0;
  var K = input[0].split(" ")[1]-0;
  var h = input[1].split(" ").map(v=>v-0);
  var ans = 0;
  for(var i=0;i<h.length;i++){
    if(h[i]>=K) ans++
  }
  console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))


Measured memory_bytes: 18756
#include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) int x; scanf("%d", &x);
#define scll(x) LL x; scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int  ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9+7;

/* Fast I/O */
inline int scanInt() {
	int n = 0;
	char ch = getchar();
	int sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(int)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

inline LL scanLong() {
	LL n = 0;
	char ch = getchar();
	LL sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(LL)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

int main() {
	string s; cin >> s;
	LL curr = 0, maxm = 0;
	rep(i, 0, s.length()) {
		if(s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C')	curr++;
		else	curr = 0;
		maxm = max(curr, maxm);
	}
	pll(maxm); nl;
}


Measured memory_bytes: 256
n = int(input())
a = list( map(int, input().split()) )

#付け足し
a = [0] + a + [0]
n += 2


#総和
s = 0
for i in range(n-1):
	s += abs(a[i+1] - a[i])

#print(n)
#print(a)
#print(s)


for i in range(1, n-1):
	x = abs(a[i-1]-a[i]) + abs(a[i]-a[i+1])
	y = abs(a[i-1]-a[i+1])
	print(s-x+y)




Measured memory_bytes: 14040
n = int(input())
B = list(map(int,input().split()))
A = [max(B)]*n
for i in range(n-1):
    if B[i] >= max(A[i],A[i+1]):
        None
    else:
        if A[i] >= B[i] and A[i+1] <= B[i]:
            A[i] = B[i]
        elif A[i] <= B[i] and A[i+1] >= B[i]:
            A[i+1] = B[i]
        elif A[i] >= B[i] and A[i+1] > B[i]:
            A[i] = B[i]
            A[i+1] = B[i]
print(sum(A))

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

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

	vector<long long> ans( N );
	ans[0] = A[N - 1] + A[0];
	int j = 1;
	for( int i = 0; i < N - 2; i++ ) {
		if( i % 2 ) ans[0] += A[j];
		else ans[0] -= A[j];
		j++;
	}
	for( int i = 1; i < N; i++ ) {
		ans[i] = A[i - 1] * 2 - ans[i - 1];
	}

	for( int i = 0; i < N; i++ ) {
		if( i ) cout << " ";
		cout << ans[i];
	}
	cout << endl;
}


Measured memory_bytes: 4840
import sys
import numpy as np
import math
def input(): return sys.stdin.readline().rstrip()


def main():
    n = int(input())
    engine = np.zeros((n, 3))
    for i in range(n):
        engine[i][0], engine[i][1] = map(int, input().split())
        engine[i][2] = math.atan2(engine[i][1], engine[i][0])
    engines = engine[np.argsort(engine[:, 2])]
    sumen = sum(engines)
    ans = sumen[0]**2+sumen[1]**2
    for i in range(n):
        for j in range(i, n):
            sump=sum(engines[i:j+1])
            ans=max(ans,sump[0]**2+sump[1]**2,(sump[0]-sumen[0])**2+(sump[1]-sumen[1])**2)
    print(math.sqrt(ans))


if __name__ == '__main__':
    main()

Measured memory_bytes: 27364
using static System.Math;
using System.Linq;
using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, int.Parse);
        Console.WriteLine(Max(-1, n - a.Sum()));
    }
}


Measured memory_bytes: 19980
#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <sstream>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

const int MAX_SIZE = 10000;


int main(){

	int N;

	while(cin >> N && !(N == 0)){
		int x=0;
		int y=0;
		pair<int,int> place[201];
		place[0].first = 0;
		place[0].second = 0;
		for(int i = 1; i < N; i++){
			int n,d;
			cin >> n >> d;
			int yy = place[n].first;
			int xx = place[n].second;
		if(d == 0){
			place[i].second = xx - 1;
			place[i].first = yy;
		}
		else if(d == 1){
			place[i].second = xx;
			place[i].first = yy + 1;
		}
		else if(d == 2){
			place[i].second = xx + 1;
			place[i].first = yy;
		}
		else if(d == 3){
			place[i].second = xx;
			place[i].first = yy - 1;
		}
		}
		
		int minX,minY;
		int maxY,maxX;
		
		minX = minY = maxX = maxY = 0;
		for(int i = 0; i < N; i++){
			int xx = place[i].second;
			int yy = place[i].first;
			minX = min(minX,xx);
			maxX = max(maxX,xx);
			minY = min(minY,yy);
			maxY = max(maxY,yy);
		}
		cout << maxX - minX + 1 << " " << maxY - minY + 1 << endl;
	}	
	
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define int long long
int MOD = (int)1e9 + 7;
int INF = (int)2e18;
// Comment out below and program paste

// #include "UnionFind.hpp"
// #include "power.hpp"

int N, Q;
string s;
char a[200000 + 10], t[200000 + 10], d[200000 + 10];

int simulation(int position) {
    for (int i = 1; i <= Q; i++) {
        if (position == 0) return -1;
        if (position == N + 1) return 1;

        if (a[position] == t[i]) {
            if (d[i] == 'L') position--;
            else position++;
        }
    }

    if (position == 0) return -1;
    if (position == N + 1) return 1;
    return 0;
}

signed main() {
    cin >> N >> Q >> s;
    for (int i = 1; i <= N; i++) a[i] = s[i - 1];
    for (int i = 1; i <= Q; i++) cin >> t[i] >> d[i];

    int left = 1, right = N + 1, max_pos = 0;
    for (int i = 0; i < 20; i++) {
        int pos_binary = (left + right) / 2;
        if (simulation(pos_binary) == -1) {
            max_pos = max(max_pos, pos_binary);
            left = pos_binary;
        } else right = pos_binary;
    }

    left = 1, right = N + 1;
    int min_pos = N + 1;
    for (int i = 0; i < 20; i++) {
        int pos_binary = (left + right) / 2;
        if (simulation(pos_binary) == 1) {
            min_pos = min(min_pos, pos_binary);
            right = pos_binary;
        } else left = pos_binary;
    }
    
    cout << N - max_pos - (N + 1 - min_pos) << endl;
}


Measured memory_bytes: 1156
import sys

w, a, b = list(map(int, input().split()))
temp = 0

if a > b:
  temp = a
  a = b
  b = temp
if a == b or a+w == b or w == b:
  ans = 0
  print(ans)
  sys.exit()
else:
  if b > a+w:
    ans = abs(b-(a+w))
  else:
    ans = abs((a+w)-b)

print(ans)

Measured memory_bytes: 3060
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;


public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		List<Long> lList = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			lList.add(Long.parseLong(sc.next()));
		}
		Collections.sort(lList);

		int result = 0;
		for (int i = 0; i < n - 2 ; i++) {
			long lengthI = lList.get(i);
			for (int j = 1 + i; j < n - 1; j++) {
				long lengthJ = lList.get(j);
				for (int k = 1 + j; k < n; k++) {
					long lengthK = lList.get(k);
					if (lengthI != lengthJ && lengthI != lengthK && lengthJ != lengthK) {
						if (lengthK < (lengthI + lengthJ)) {
							result++;
						}
						
					}
				}
			}
		}
		System.out.println(result);
	}

}


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

int main() {
  string a, b;
  int co = 0;
  cin >> a >> b;
  
  for(int i = 0; i < a.size(); i++) {
    if(a.at(i) != b.at(i)) {
      co++;
    }
  }
  cout << co << endl;
}

Measured memory_bytes: 3916
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <set>
#include <cctype>
#include <bitset>
#include <type_traits>

#include <list>
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define YES(j) cout << (j ? "YES" : "NO") << endl;
#define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
#define yes(j) std::cout << (j ? "yes" : "no") << endl;
int main(void)
{
    int n, m;
    cin >> n >> m;
    vector<int> st;
    map<int, int> mp;
    REP(i, m)
    {
        int a, b;
        cin >> a >> b;
        if (a == 1)
        {
            st.push_back(b);
        }
        else if (b == 1)
        {
            st.push_back(a);
        }
        if (a == n)
        {
            mp[b]++;
        }
        else if (b == n)
        {
            mp[a]++;
        }
    }
    for (auto i : st)
    {
        if (mp.count(i) > 0)
        {
            cout << "POSSIBLE" << endl;
            return 0;
        }
    }
    cout << "IMPOSSIBLE" << endl;
}

Measured memory_bytes: 5368
#include<bits/stdc++.h>
#include<string.h>
#include<tuple>
#define all(c) c.begin(),c.end()
#define pb push_back
#define em emplace_back
#define ll long long int
#define mp make_pair
#define isro ios_base::sync_with_stdio(false);
#define debug(c) cout<<c<<endl;
#define find(v,x) find(all(v),x)!=v.end()
using namespace std;

typedef vector<ll>vi;
typedef vector<vi>vii;
typedef pair<ll,ll>pi;
typedef tuple<ll,ll,ll>ti;

int MAXN=100;
int MAXW=100;


int main(){
   isro; 
   ll n;
   cin>>n;
   vii cost(n,vi(3,0));
   vi A(n),B(n),C(n);
   
   for(auto i=0;i<n;i++){
         cin>>A[i]>>B[i]>>C[i];
   }

   cost[0][0]=A[0];
   cost[0][1]=B[0];
   cost[0][2]=C[0];  
       
   for(auto i=1;i<n;i++){
       cost[i][0]=max(A[i]+cost[i-1][1],A[i]+cost[i-1][2]);
       cost[i][1]=max(B[i]+cost[i-1][0],B[i]+cost[i-1][2]);
       cost[i][2]=max(C[i]+cost[i-1][0],C[i]+cost[i-1][1]);
   }

   cout<<max(cost[n-1][0],max(cost[n-1][1],cost[n-1][2]));


}


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

int main(){
    int a,b,k;
    cin >> a >> b >> k;
    int cnt = 0;
    int i;

    for(i = a;i > 0;i --){
        if(a%i==0 && b%i==0){
            cnt ++;
        }
        if(cnt == k){
            break;
        }
    }

    cout << i << endl;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		try {
			int price = sc.nextInt();
			int size = sc.nextInt();

			List<String> dislike = new ArrayList<String>();

			for (int i = 0; i < size; i++) {
				dislike.add(sc.next());
			}

			for (int i = price;; i++) {
				String pay = Integer.toString(i);
				boolean contains = false;

				for (String str : dislike) {
					if (pay.indexOf(str) != -1) {
						contains = true;
						break;
					}
				}

				if (!contains) {
					System.out.println(i);
					break;
				}
			}
		} catch (Throwable t) {
			t.printStackTrace();
		} finally {
			sc.close();
		}
	}
}


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

// TYPEDEF
// ----------------------------------------
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pair;
typedef vector<ll> vll;
typedef vector<vector<ll>> Graph;
typedef vector<string> vs;
typedef vector<pair<ll, ll>> Pll;
typedef queue<ll> qll;

// REPEAT
// ----------------------------------------
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REPA(i,a) for(ll i=0;i<(ll)(a.size());i++);
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define COUT(a) cout << (a) << endl;
#define ENDL(a) cout << endl;
#define COUTA(i,a) for(ll i=0;i<(ll)(a.size());i++) {cout << (a)[i] << " ";} cout << endl;

// UTIL
// ----------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define RSORT(a) sort((a).rbegin(), (a).rend())

// DEBUG
// ----------------------------------------
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif

template <typename T>
void debugV(const vector<T> v) {
#ifdef _DEBUG
  rep(i, v.size()) {
    cout << i << ":" << v[i] << " ";
  }
  cout << endl;
#else
  (void)v;
#endif
}

// BIT FLAG
// ----------------------------------------
const unsigned int BIT_FLAG_0 = (1 << 0); // 0000 0000 0000 0001
const unsigned int BIT_FLAG_1 = (1 << 1); // 0000 0000 0000 0010
const unsigned int BIT_FLAG_2 = (1 << 2); // 0000 0000 0000 0100
const unsigned int BIT_FLAG_3 = (1 << 3); // 0000 0000 0000 1000
const unsigned int BIT_FLAG_4 = (1 << 4); // 0000 0000 0001 0000
const unsigned int BIT_FLAG_5 = (1 << 5); // 0000 0000 0010 0000
const unsigned int BIT_FLAG_6 = (1 << 6); // 0000 0000 0100 0000
const unsigned int BIT_FLAG_7 = (1 << 7); // 0000 0000 1000 0000
const unsigned int BIT_FLAG_8 = (1 << 8); // 0000 0001 0000 0000
const unsigned int BIT_FLAG_9 = (1 << 9); // 0000 0010 0000 0000
const unsigned int BIT_FLAG_10 = (1 << 10); // 0000 0100 0000 0000
const unsigned int BIT_FLAG_11 = (1 << 11); // 0000 1000 0000 0000

// CONST
// ----------------------------------------
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI=3.14159265358979323846; // or M_PI
constexpr int MOD = 1000000007;


void Main() {
  string s;
  ll n;

  cin >> n;
  REP(i, 10) {
    REP(j, 10) {
      if(n == i * j) {
        COUT("Yes");
        return;
      }
    }
  }

  COUT("No");


}

int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}

/*

3 2
*/


Measured memory_bytes: 3604
#include <iostream>
#include <string>

using namespace std;

int lcslen[1001][1001]={0};
int compute_lcslen(const string &x,const string &y);

int main(){
  int q;
  cin >> q;
  for(int i=0;i<q;++i){
    string x,y;
    cin >> x;
    cin >> y;
    cout << compute_lcslen(x,y) << endl;
  }

  return 0;
}

int compute_lcslen(const string &x,const string &y){
  for(int i=1;i<=x.length();++i){
    for(int j=1;j<=y.length();++j){
      if(x[i-1]==y[j-1]){
        lcslen[i][j] = lcslen[i-1][j-1]+1;
      }else{
        lcslen[i][j] = max(lcslen[i-1][j],lcslen[i][j-1]);
      }
    }
  }
  return lcslen[x.length()][y.length()];
} 

Measured memory_bytes: 7044
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<String> alp = Arrays.asList("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z");
        long n = sc.nextLong();
        int a = 0;
        for (int i = 1; i <= 26; i++) {

            long pow = (long) Math.pow(26, i);
            long sub = 0;
            if (n <= pow) {
                a = i;
                break;
            } else {
                sub += pow;
            }
            n = n - sub;
        }
        StringBuilder sb = new StringBuilder();

        for (int i = 1; i < a; i++) {
            long pow = (long) Math.pow(26, a - i);
            long sub = 0;
            for (int j = 1; j <= 26; j++) {
                if (n <= pow * j) {
                    sb.append(alp.get(j - 1));
                    break;
                } else {
                    sub += pow;
                }
            }
            n = n - sub;
        }
        sb.append(alp.get((int) (n - 1)));
        System.out.println(sb.toString());
    }
}


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


int main(){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    while (true){
        c -= b;
        if (c <= 0){
            cout << "Yes" << endl;
            break;
        }
        a -= d;
        if (a <= 0){
            cout << "No" << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 3624
import java.util.*;

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

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();

        int[] A = new int[M + 1];
        int[] costs = new int[]{0,0};
        for (int i = 1; i <= M; i++) {
            A[i] = sc.nextInt();
            if (A[i] < X) {
                costs[0] += 1;
            } else if (A[i] > X) {
                costs[1] += 1;
            }
        }

        System.out.println(Math.min(costs[0], costs[1]));

        return;
    }

}

Measured memory_bytes: 22996
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    vector<int> A(N+2,0);
    int sum = 0;
    for(int i = 1;i <= N;i++){
        cin >> A[i];
        sum += abs(A[i] - A[i-1]);
    }
    sum += abs(A[N]);
    for(int i = 1;i <= N;i++){
        int a = abs(A[i-1] - A[i]) + abs(A[i] - A[i+1]);
        int b = abs(A[i-1] - A[i+1]);
        cout << sum - a + b << endl;
    }
}

Measured memory_bytes: 1664
h, w, k = map(int, input().split())
p = 10**9+7
# DP[i][j]=i段目まで見て0からjに着くパターン数
DP = [[0 for j in range(w+1)] for i in range(h+1)]
DP[0][0] = 1
# F[k]=k個の枠に隣り合わないように線を引くパターンの数
F = [1, 1, 2, 3, 5, 8, 13, 21]
for i in range(h):
    for j in range(w):
        a = DP[i][j-1]*F[j-1]*F[w-1-j]
        b = DP[i][j]*F[j]*F[w-1-j]
        c = DP[i][j+1]*F[j]*F[w-2-j]
        DP[i+1][j] = (a+b+c) % p
print(DP[h][k-1])


Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>

#define REP(i,n) for(int i = 0; i < (n); ++i)
#define REPC(x,c) for(auto x:(c))
#define FOR(i, b, e) for(int i = (b); i < (e); ++i)
#define VS vector<string>
#define VI vector<int>
#define VVI vector<vector<int>>

#define ll long long

using namespace std;

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

	cout << ((n % 2 == 0) ? n : 2 * n) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

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

//const ll INF = 1e18L + 5;
//const int INF = 1e9 + 5;
//const double pi = 3.14159265358979323846;

int		main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n;
	cin >> n;

	int ans = 0;
	for (int i = 1; i <= n; i++) {
		int cnt = 0;
		for (int j = 1; j <= i; j++) {
			if (i % 2 && i % j == 0) cnt++;
		}
		if (cnt == 8) {
			ans++;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define pcnt __builtin_popcount
#define show(x) cout<<#x<<" = "<<x<<endl;
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define fi first
#define se second
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define sz(x) (int)(x).size()
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v)
{stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
ll gcd(ll a,ll b){if(a>b)swap(a,b);for(;a>0;b%=a,swap(a,b));return b;}
int modpow(ll a,ll n,int m){if(a==0)return a;ll p=1;for(;n>0;n/=2,a=a*a%m)if(n&1)p=p*a%m;return(int)p;}
void dout(double d){printf("%.12f\n",d);}

const int iinf = 1e9;
const ll linf = 1e18;
const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;
const int N = 100005;
int n, t, a[N], minv[N], maxv[N];

main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> t;
  FOR(i, 0, n) cin >> a[i];
  int v = iinf;
  FOR(i, 0, n){
    mins(v, a[i]);
    minv[i] = v;
  }
  v = -iinf;
  FORR(i, n-1, 0){
    maxs(v, a[i]);
    maxv[i] = v;
  }
  v = 0;
  set<pii> s;
  map<int, vi> m;
  FOR(i, 0, n){
    if(m.find(a[i]) == m.end()) m[a[i]] = vi();
    m[a[i]].pb(i);
  }
  FOR(i, 0, n-1){
    int d = maxv[i+1] - minv[i];
    if(d > v){
      s.clear();
      v = d;
    }
    if(d == v) s.insert(mp(maxv[i+1], minv[i]));
  }
  ll ans = 0;
  each(itr, s){
    vpii vv;
    each(itrr, m[itr->fi]) vv.pb(mp(*itrr, 1));
    each(itrr, m[itr->se]) vv.pb(mp(*itrr, 0));
    sort(rng(vv));
    int cost = iinf, c = 0;
    minv[0] = 0;
    FOR(i, 1, sz(vv)+1) minv[i] = minv[i-1] + (vv[i-1].se == 0);
    maxv[sz(vv)] = 0;
    FORR(i, sz(vv)-1, 0) maxv[i] = maxv[i+1] + (vv[i].se == 1);
    FOR(i, 0, sz(vv)+1) mins(cost, minv[i] + maxv[i]);
    ans += cost;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 14720
import math

N = int(input())
CSF = [list(map(int, input().split())) for _ in range(N-1)]

for i in range(N-1):
    time = CSF[i][1] + CSF[i][0] 
    for j in range(i+1, N-1):
        if time <= CSF[j][1]:
            time = CSF[j][1] + CSF[j][0]
        else:
            time = math.ceil(time / CSF[j][2]) * CSF[j][2] + CSF[j][0]
    print(time)
print(0)





Measured memory_bytes: 3188
import java.util.*;
class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        String t = sc.next();
        
        StringBuilder buf = new StringBuilder();
        buf.append(t);
        buf.append(s);
        System.out.println(buf.toString());
        }
    }

Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
int bits[25];
vector <pair <int, pair<int,int > > > nonzeroes;

void addnumber(int a){
    for(int i=0;i<25;i++){
        if(a%2==1){
            bits[i]++;
        }
        a/=2;
    }
}

void removenumber(int a){
    for(int i=0;i<25;i++){
        if(a%2==1){
            bits[i]--;
        }
        a/=2;
    }
}

bool checkbits(){
    for(int i=0;i<25;i++){
        if(bits[i]>1){
            return false;
        }
    }
    return true;
}

int main(){
    int n;
    cin>>n;
    int a[n];
    int indexfirst=0,indexlast=1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(a[i]!=0){
            nonzeroes.push_back({a[i],{0,0}});
        }
    }
    int z=0;
    int initialzeroes=0;
    while(z<n&&a[z]==0){
        initialzeroes++;
        z++;
    }
    int countnon=0;
    int count0s=0;
    long long int ans=0;
    ans+=((long long)initialzeroes*(long long)(initialzeroes+1))/2;
    if(!nonzeroes.empty()){
        nonzeroes[0].second.first=initialzeroes;
        countnon++;
        for(int i=initialzeroes+1;i<n;i++){
            if(a[i]==0){
                count0s++;
            }
            else{
                ans+=((long long)count0s*(long long)(count0s+1))/2;
                nonzeroes[countnon-1].second.second=count0s;
                nonzeroes[countnon].second.first=count0s;
                countnon++;
                count0s=0;
            }
        }
        ans+=((long long)count0s*(long long)(count0s+1))/2;
        nonzeroes[nonzeroes.size()-1].second.second=count0s;
    }
    int numnon=nonzeroes.size();
    for(int i=1;i<=25;i++){
        if(n>=numnon){
            for(int j=0;j<numnon;j++){
                if(j<i-1){
                    addnumber(nonzeroes[j].first);
                }
                else if(j==i-1){
                    addnumber(nonzeroes[j].first);
                    if(checkbits()){
                        ans+=(long long)(nonzeroes[0].second.first+1)*(long long)(nonzeroes[j].second.second+1);
                    }
                }
                else{
                    removenumber(nonzeroes[j-i].first);
                    addnumber(nonzeroes[j].first);
                    if(checkbits()){
                        ans+=(long long)(nonzeroes[j].second.second+1)*(long long)(nonzeroes[j-i+1].second.first+1);
                    }
                }
            }
        }
        for(int i=0;i<25;i++){
            bits[i]=0;
        }
    }
    cout<<ans;
}


Measured memory_bytes: 5364
#include<bits/stdc++.h>
using namespace std;
#define int long long

#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif

int n;
double dp[301][301][301];

double dfs(int x,int y,int z){
  if(x == 0 && y == 0 && z == 0) return 0;
  if(dp[x][y][z] != -1) return dp[x][y][z];

  double res = 0;
  if(x) res += dfs(x-1,y,z) * double(x)/(x+y+z);
  if(y) res += dfs(x+1,y-1,z) * double(y)/(x+y+z);
  if(z) res += dfs(x,y+1,z-1) * double(z)/(x+y+z);
  return dp[x][y][z] = res + double(n)/(x+y+z);
}

signed main(){

  cin >> n;
  vector<int> a(n),cnt(4);
  for(int i = 0; i < n; i++){
    cin >> a[i];
    cnt[a[i]]++;
  }

  for(int i = 0; i <= n; i++){
    for(int j = 0; j <= n; j++){
      for(int k = 0; k <= n; k++){
        dp[i][j][k] = -1;
      }
    }
  }
  printf("%.10f\n",dfs(cnt[1],cnt[2],cnt[3]));

  return 0;
}


Measured memory_bytes: 213376
N, M = map(int, input().split())
S = 0
S = [True]*(N+1)
for _ in range(M):
  a = int(input())
  S[a] = False
T = [0]*(N+1)
T[0] = 1
T[1] = 1 if S[1] else 0
for i in range(2, N+1):
  if S[i]:
    T[i] = int((T[i-1]+T[i-2])%1000000007)
print(T[N])


Measured memory_bytes: 45016
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
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; }

int main(){
    int N; cin >> N;
    vector <int> H(N);
    rep(i,N) cin >> H[i];
    
    int ans=0;
    int active=0;
    rep(i,N){
        if (active>=H[i]) active=H[i];
        else {
            ans+=H[i]-active;
            active=H[i];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
i = input()
a = input().split()
c = a[0]
d = a[0]
for j in range(int(i)):
    if int(c) > int(a[j]):
        c = int(a[j])

                
for j in range(int(i)):
    if int(d) < int(a[j]):
        d = int(a[j])

e = sum(int(o) for o in a)

print('{0} {1} {2}'.format(int(c),int(d),int(e)))


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

using namespace std;

int main()
{
    int n;
    scanf("%d",&n);
    int x[n],A=0,B=0;
    for(int i=0;i<n;i++)
        scanf("%d",&x[i]);
    sort(x,x+n);
    reverse(x,x+n);
    for(int i=0;i<n;i++){
        if(i%2==0)
            A+=x[i];
        else
            B+=x[i];
    }
    printf("%d",(A-B));
    return 0;
}


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

char c;
int a , b;
 
int main () {
	scanf("%d %c %d",&a,&c,&b);
	if (c == '+') printf("%d\n",a+b);
	else if (c == '-') {
		if (a > b) printf("%d\n",a-b);
		else if (b > a) printf("-%d\n",b-a);
	}
}

Measured memory_bytes: 1644
#include <bits/stdc++.h>
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable" 
//#pragma GCC diagnostic ignored "-Wformat"

using namespace std ;

#define   Pi     2*acos(0.0)
#define   LINF   1LL<<63
#define   ll     long long
#define   ull    unsigned long long
#define   pb     push_back
#define   mp     make_pair
#define   MAX    500006
#define   MAX1   10000008
#define   mem(a,v)   memset(a,v,sizeof(a))
#define   all(x) x.begin(),x.end()
#define   lcm(a, b)        ((a)*((b)/gcd(a,b)))
#define yes   cout<<"YES"<<endl
#define no   cout<<"NO"<<endl
#define buga  cout<<1<<endl
#define bugb  cout<<2<<endl
#define bugc  cout<<3<<endl
#define bugd  cout<<4<<endl
#define buge  cout<<5<<endl

void fastIO (){ios_base::sync_with_stdio(false);cin.tie(0); cout.precision(20);}

ll A[MAX];
ll B[MAX];
ll C[MAX];
vector< ll >V;
vector< ll >Ans;
vector< pair<ll,ll> >VP;
map< ll,ll >M;
vector<ll>prime;
bool mark[MAX1];
ll N=1e7;
void seive (){int limit = sqrt(N*1.0)+2;mark[1]=1;for (int i=4;i<=N;i+=2)mark[i]=1;prime.push_back(2);for (int i=3;i<=N;i+=2){if(!mark[i]){prime.push_back(i);if(i<=limit){for (int j=i*i;j<=N;j+=i*2)mark[j]=1;}}}}

/*
ll bin_pow(ll o, ll s) {
    if (s == 0) return 1;
    if (s == 1) return o % mod;
    ll d = bin_pow(o, s/2);
    d = (d * 1ll * d) % mod;
    if (s % 2 == 1)
        d = (d * 1ll * o) % mod;
    return d;
}
*/

int main ()
{
    fastIO();
    ll a,b,c,d,n,m,k,l,p,q,r,t,x,y;
    ll cnt=0,cntr=0,sum=0,ans=1,check=0;
    ll Max= 0,Max1=-1e18+1,Min=LINF;
    string s,s1,s3,s4;

    //cin>>n;
    cin>>n>>x>>m; y = x;
    a = 0;
    M[x] = 1;
    V.pb(x); sum += x; M[x] = 1;
    cntr = 1;
    if(n==1){
    	cout<<x<<endl; return 0;
    }
    for(int i = 2; i <= 10000000; i++){
    	if(i>n)break;
    	x = (x * x) % m; M[x]++;
    	if(M[x]== 1){sum += x; ++cntr;}
    	if(x == 1 || x == 0 || M[x] == 3){
    		a = i; break;
    	}
    	if(M[x]==2){
    		Ans.pb(x);
    	}
    }
    
    if(x == 0){
    	cout<<sum<<endl; return 0;
    }
    if(x == 1 || Ans.size()==0){
    	n -= cntr;
    	cout<<sum + n <<endl; return 0;
    }
    ll res = accumulate(Ans.begin(),Ans.end(), 0LL);
    n -= cntr;
    a = Ans.size();
    if(a)b = n / a;
    ans = res * b;
    b = n % a;
    for(int i =0 ; i < b; i++){
    	ans += Ans[i];
    }
    
    cout<<ans + sum<<endl;

    return 0;
}


Measured memory_bytes: 7004
#include <stdio.h>

int main(void)
{
	int n;
	int a, b, c, d;
	int count;
	
	while (scanf("%d", &n) != EOF){
		count = 0;
		
		for (a = 0; a <= 9; a++){
			for (b = 0; b <= 9; b++){
				for (c = 0; c <= 9; c++){
					for (d = 0; d <= 9; d++){
						if (a + b + c + d == n){
							count++;
						}
					}
				}
			}
		}
		
		printf("%d\n", count);
	}
	
	return (0);
}

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

int main()
{
    ll n;
    string s;
    cin >>n>>s;
    ll ans=s.length();
    rep(i,s.length()){
        if(s[i]==s[i+1])ans--;
    }
    cout << ans <<endl;
    
}

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

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

	int ans = 0;
	for( int i = 0, x = 400; i < 8; i++, x += 200 ) {
		if( x <= X && X < x + 200 ) {
			ans = 8 - i;
			break;
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
const int N=1e6+20;
const int inf=2e8;
int n,m,num;
map<int,int> mp[N];
vector<ii> e[N];
int inq[N],d[N];
queue<int> q;
int getid(int u,int c)
{
	if(mp[u][c]==0)
		mp[u][c]=++num;
	return mp[u][c];
}
int SPFA(int s,int t)
{
	for(int i=1;i<=num;i++)
		d[i]=inf,inq[i]=0;
	q.push(s);
	d[s]=0,inq[s]=1;
	while(!q.empty())
	{
		int u=q.front();
		q.pop(),inq[u]=0;
		for(int i=0;i<e[u].size();i++)
		{
			int v=e[u][i].first,w=e[u][i].second;
			if(d[v]>d[u]+w)
			{
				d[v]=d[u]+w;
				if(!inq[v])
					inq[v]=1,q.push(v);
			}
		}
	}
	return d[t]>=inf?-1:d[t]/2;
}
int main()
{
    ios::sync_with_stdio(false);
	while(cin>>n>>m)
	{
		for(int i=0;i<=n;i++)
			e[i].clear();
		int u,v,c;
		num=n;
		while(m--)
		{
            cin>>u>>v>>c;
			int uc=getid(u,c);
			int vc=getid(v,c);
			e[u].push_back(ii(uc,1));
			e[uc].push_back(ii(u,1));
			e[v].push_back(ii(vc,1));
			e[vc].push_back(ii(v,1));
			e[uc].push_back(ii(vc,0));
			e[vc].push_back(ii(uc,0));
		}
		cout<<SPFA(1,n)<<endl;
		for(int i=0;i<=num;i++)
			mp[i].clear();
	}
	return 0;
}


Measured memory_bytes: 115584
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;

int dfs(int a, int b, int c, int count, vector<int> vec, int K, int X, int Y, int  Z){
    if (count == K){
        if (a > 0 && b > 0 && c > 0){
            return max(a - X, X - a) + max(b - Y, Y - b) + max(c - Z, Z - c) - 30;
        }
        else{
            return 1000000000;
        }
    }
    int not_use = dfs(a,b,c,count + 1,vec,K,X,Y,Z);
    int use_A = dfs(a + vec[count],b,c,count + 1,vec,K,X,Y,Z) + 10;
    int use_B = dfs(a,b + vec[count] ,c,count + 1,vec,K,X,Y,Z) + 10;
    int use_C = dfs(a,b,c + vec[count],count + 1,vec,K,X,Y,Z) + 10;
    return min(not_use , min(use_A , min(use_B,use_C)));
}

int main(){
    int N,A,B,C;
    cin >> N >> A >> B >> C;
    vector<int> kadomatsu(N);
    rep(i,N){
        cin >> kadomatsu[i];
    }
    cout << dfs(0,0,0,0,kadomatsu,N,A,B,C) << endl;
}


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

for i in range(1, n + 1):
    anstmp = 0
    test = i
    while test % 2 == 0:
        test = test / 2
        anstmp = anstmp + 1

    if num <= anstmp:
        ans = i
        num = anstmp

print(ans)

Measured memory_bytes: 3060
while 1:
    n,x = map(int,input().split())
    if x+n == 0:
        break
    else:
        ans = 0
        for i in range(1,n+1):
            for j in range(i+1,n+1):
                for k in range(j+1,n+1):
                    if i+j+k == x:
                        ans +=1
        
        print(ans)


Measured memory_bytes: 5596
n = int(input())
s = input()

def z_algorithm(str):
    len_str = len(str)
    p = [0] * len_str
    j = 0
    for i in range(1, len_str):
        if i + p[i-j] < j + p[j]:
            p[i] = p[i-j]
        else:
            k = max(0, j+p[j]-i)
            while i + k < len_str and str[k] == str[i+k]:
                k += 1
            p[i] = k
            j = i
    p[0] = len_str
    return p

ans = 0
for x in range(n):
    temp = [] + z_algorithm(s[x:])
    for y in range(n - x):
        z = min(temp[y], y)
        ans = max(ans, z)

print(ans)


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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define MP make_pair
ll MOD = 1e9+7;
//ll MOD = 998244353;
ll INF = 1e18;
void chmin(ll &a,ll b){if(a>b)a=b;}
void chmax(ll &a,ll b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
void ans(bool x, ll y, ll z){if(x)cout<<y<<endl;else cout<<z<<endl;}   


int main(){
  ll i,j,o;
  ll result=0,buf=0,buf1=0,buf2=0,buf3=0,buf4=0;
  bool judge = true;
  ll n;cin>>n;
  set<ll> a;
  for(i=0;i<n;i++){
    cin>>buf;
    if(a.find(buf)==a.end()){
      a.insert(buf);
    }
    else{
      a.erase(buf);
    }  
  }
  cout<<a.size()<<endl;

  return 0;
}

Measured memory_bytes: 4864
/*input
3
2
1 2
10
2
1 1
10
6
2 3 4 5 6 7
111000
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define eb emplace_back
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (int)(lower_bound(c.begin(),c.end(),x)-c.begin())
#define EL cout<<'\n'
#define BS(a,x) binary_search(ALL(a),x)
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
template<typename T>
ostream& operator<<(ostream& out,vector<T> V){
	REP(i,SZ(V)) out<<V[i]<<((i!=SZ(V)-1)?" ":"");
	return out;
}
//}}}
const ll maxn=300005;
const ll maxlg=20;
const ll INF64=1e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}

int n;
string s;
ll a[maxn];


ll v[60];
bitset<60> vis;

void solve(){
	vis.reset();

	cin>>n;
	REP(i,n) cin>>a[i];
	cin>>s;

	bool flag = 0;
	for(int i=n-1;i>=0;i--){
		if(s[i]=='1'){
			for(int j=60;j>=0;j--) if(a[i]&(1LL<<j)){
				if(!vis[j]) flag = 1;
				else{
					a[i]^=v[j];
				}
			}
			if(flag) break;
		}
		else{
			for(int j=60;j>=0;j--) if(a[i]&(1LL<<j)){
				if(!vis[j]){
					vis[j] = 1;
					v[j]=a[i];
					break;
				}
				else{
					a[i]^=v[j];
				}
			}
		}
	}
	cout<<flag<<'\n';
}

int main(){
	IOS;
	int T;
	cin>>T;
	while(T--) solve();
	return 0;
}


Measured memory_bytes: 3572
import Control.Arrow
import Data.Maybe
import qualified Data.ByteString.Char8 as B
main=putStrLn.unwords.map show.solve.map (fst.fromJust.B.readInt).B.words=<<B.getContents
solve (n:as)
  |odd n=reverse a1s++a2s
  |otherwise=reverse a2s++a1s
  where (a1s,a2s)=(f odd&&&f even)as
f g=map snd.filter (g.fst).zip [1..]

Measured memory_bytes: 54140
s = list(input())
k = int(input())
a = []

for i in range(1, len(s) + 1):
    if i >= k+1:
        break
    for j in range(len(s) - i + 1):
        word = s[j:j+i]
        if word not in a:
            a.append(word)


a.sort()

print(''.join(a[k-1]))


Measured memory_bytes: 4852
/* **********************************JAI SAI RAM ************************************* */
//HELP IN CODEFORCES ROUND 641
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll i,j,k,l,m;
    string s;
    cin>>s;
    s=s.substr(0,3);
    cout<<s<<endl;
    return 0;
}


Measured memory_bytes: 3644
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>
#include <iterator>

using namespace std;

long long int const LL_MAX = 10000000000000000; // 10^16

int main(){
	
	int N, M, D;
	
	cin >> N >> M >> D;
	
	string str[200];
	
	for(int i = 0; i < N; i++){
		cin >> str[i];
	}
	
	int ans = 0;
	
	for(int i = 0; i < N - D + 1; i++){
		for(int j = 0; j < M; j++){
			bool flag = true;
			for(int k = 0; k < D; k++){
				if(str[i + k][j] == '#'){
					flag = false;
					break;
				}
			}
			if(flag){
				ans++;
			}
		}
	}
	
	for(int i = 0; i < N; i++){
		for(int j = 0; j < M - D + 1; j++){
			bool flag = true;
			for(int k = 0; k < D; k++){
				if(str[i][j + k] == '#'){
					flag = false;
					break;
				}
			}
			if(flag){
				ans++;
			}
		}
	}
	
	cout << ans << endl;
	
	return 0;
}

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

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

  vector<int> d(N);

  int MAX = 0;
  for (int i = 0; i < N; i++) {
    cin >> d.at(i);
  }

  for (int i = 0; i < N - 1; i++) {
    for(int j = i + 1; j < N; j++) {
      int tmp;
      if (d.at(i) < d.at(j)) {
        tmp = d.at(i);
        d.at(i) = d.at(j);
        d.at(j) = tmp;
      }
    }
  }

  int count = 1;
  int tmp = d.at(0);
  for (int i = 0; i < N; i++) {
    if (d.at(i) < tmp) count++;
    tmp = d.at(i);
  }

  cout << count << endl;
}


Measured memory_bytes: 256
#include <vector>
#include <string>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <sstream>
#include <map>
#include <unordered_map>
#include <ctime>
#include <cassert>
#include <cstring>
#include <sys/time.h>
#include <stdlib.h>
using namespace std;

int main(int argc, char *argv[]){
  string s;
  cin >> s;
  long long int sum = 0, l = 0, r = 0, ln = 0;
  for(int i=0;i<(int)s.length();i++){
    if(s[i]=='<'){
      l++;
      if(r!=0){
        sum += (r+1)*(r+2)/2-r-1;
        if(ln>r){
          sum -= r;
        }else{
          sum -= ln;
        }
        ln = 0;
        r = 0;
      }
    }else{
      r++;
      if(l!=0){
        sum += (l+1)*(l+2)/2-l-1;
        if(ln>l){
          sum -= l;
        }else{
          sum -= ln;
        }
        ln = l;
        l = 0;
      }
    }
    //cout << sum << ' ' << l << ' ' << r << endl;
  }
  if(r!=0){
    sum += (r+1)*(r+2)/2-r-1;
    if(ln>r){
      sum -= r;
    }else{
      sum -= ln;
    }
  }
  if(l!=0){
    sum += (l+1)*(l+2)/2-l-1;
    if(ln>l){
      sum -= l;
    }else{
      sum -= ln;
    }
  }
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 900