akhauriyash/Code-Regression huggingface dataset:
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<stack>
#include<queue>

typedef long long i64;

using namespace std;

int main(){
    int N,M;
    cin>>N>>M;
    string s = "Yay!";
    if((N > 8 || M > 8) && (N != M)) s = ":(";

    cout<<s<<endl;


}

Measured memory_bytes: 256
package main

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

func main() {
	fmt.Printf("%d\n", resolve(parseProblem(os.Stdin)))
}

func parseProblem(r io.Reader) (n, m int, mp []int, ms []uint) {
	fmt.Fscan(r, &n, &m)

	ms = make([]uint, m)
	sc := bufio.NewScanner(r)
	sc.Split(bufio.ScanWords)
	for i := 0; i < m; i++ {
		sc.Scan()
		k, _ := strconv.Atoi(sc.Text())
		for j := 0; j < k; j++ {
			sc.Scan()
			ss, _ := strconv.Atoi(sc.Text())
			ms[i] |= 1 << (uint(ss) - 1)
		}
	}
	mp = make([]int, m)
	for i := 0; i < m; i++ {
		sc.Scan()
		p, _ := strconv.Atoi(sc.Text())
		mp[i] = p
	}
	return n, m, mp, ms
}

func resolve(n, m int, mp []int, ms []uint) int {
	var count int
	for i := 0; i < 1<<uint(n); i++ {
		if allOn(uint(i), m, mp, ms) {
			count++
		}
	}
	return count
}
func allOn(l uint, m int, mp []int, ms []uint) bool {
	for i := 0; i < m; i++ {
		if mp[i] != int(onesCount(ms[i]&l)%2) {
			return false
		}
	}
	return true
}

func onesCount(bits uint) (num uint) {
	num = (bits >> 1) & 03333333333
	num = bits - num - ((num >> 1) & 03333333333)
	num = ((num + (num >> 3)) & 0707070707) % 077
	return
}

Measured memory_bytes: 640
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>

using namespace std;
using ll = long long;



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

    ll sum = 0;
    for(int a = 1; a <= k; a++){
        for(int b = 1; b <= k; b++){
            for(int c = 1; c <= k; c++){
                sum += gcd(a,gcd(b,c));
            }
        }
    }
    cout << sum << endl;
}

Measured memory_bytes: 3636
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;

class Main{
	public static void main(String[] args) {
		SC sc=new SC(System.in);
		int N=sc.nextInt();
		int[] dp=new int[N];
		int[] cost=new int[N];
		for(int i=0; i<N; i++) {
			cost[i]=sc.nextInt();
		}
		dp[0]=0;
		dp[1]=Math.abs(cost[1]-cost[0]);
		for(int i=2; i<N; i++) {
			dp[i]=Math.min(dp[i-2]+Math.abs(cost[i]-cost[i-2]),dp[i-1]+Math.abs(cost[i]-cost[i-1]));
		}
		pl(dp[N-1]);
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
	public static void pl() {
		System.out.println();
	}
	public static void p(Object o) {
		System.out.print(o);
	}
	static class SC {
		private BufferedReader reader = null;
		private StringTokenizer tokenizer = null;
		public SC(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String next() {
			if (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
	}
}

Measured memory_bytes: 32596
#include "bits/stdc++.h"
using namespace std;
int main() {
	string S;
	cin >> S;
	long long ans = 0;
	for (int i = 0; i < S.size() - 1; i++) {
		if (S.at(i) != S.at(i + 1)) ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
// memo  fixed  setprecision(20);
using vvll = vector<vector<ll>>;
ll mod =1e9+7;
/*"itob" int to "N"base */           template<typename TypeInt> string itob(const TypeInt v, int base){static const char table[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";string ret;static numeric_limits<TypeInt> t;TypeInt n = v;if (t.is_signed) {if (v < 0) n *= -1;}while (n >= base) {ret += table[n%base];n /= base;}ret += table[n];if (t.is_signed) {if (v < 0 && base == 10) ret += '-';}reverse(ret.begin(), ret.end());return ret;}
/*"chmin" a = MAX*/                  template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
/*"chmax" a = MIN*/                  template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
/*"ctoi"  char to int*/              int ctoi(char c) {return c-'0';}
/*"gcd"   MAX Euclidean */           ll gcd(ll a,ll b){if(b==0)return a; return gcd(b,a%b);}
    /*"lcm"   MIN*/                      ll lcm(ll a,ll b){ll g = gcd(a,b);return a/g*b;}
/*"primecheck"If prime,return true.*/bool primecheck(ll n){if(n < 2) return false;else{for(int i = 2; i * i <= n; i++){if(n % i == 0) return false;}return true;}}
string  reverserange(string s,ll a,ll b){reverse(s.begin()+a-1,s.begin()+b); return s;}
ll modpow(ll a,ll n, ll mod){ll res = 1;while(n>0){if (n%2==1){res = res * a % mod;}a = a * a % mod;n/=2;}return res;}
int main() {    
    int l,r,d;
    cin >> l >> r>>d;
    ll ans = 0;
    for(int i=l;i<=r;i++){
        if(i%d==0)ans++;
    }
    cout<<ans<<endl;
}
    



Measured memory_bytes: 3528
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  
    vector<int> vec(N);
  
  for (int i = 0; i < N; i++) {
		cin >> vec.at(i);
  }
      
    sort(vec.begin(), vec.end());
    reverse(vec.begin(), vec.end());

  int sum = 1;
  for(int i = 0; i < N-1; i++){
    if (vec.at(i) > vec.at(i+1)){
      sum++;
    }
   }
    
    cout << sum << endl;
  }
      
       
      


Measured memory_bytes: 256
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.temporal.ChronoField;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws IOException {

        Scanner scanner = new Scanner(System.in);
        ;
        String[] s = scanner.nextLine().split(" ");
        int h1 = Integer.parseInt(s[0]);
        int m1 = Integer.parseInt(s[1]);
        int h2 = Integer.parseInt(s[2]);
        int m2 = Integer.parseInt(s[3]);
        int k = Integer.parseInt(s[4]);

        LocalTime startTime = LocalTime.of(h1,m1);
        LocalTime endTime = LocalTime.of(h2,m2);

        if(endTime.get(ChronoField.MINUTE_OF_DAY) - k - startTime.get(ChronoField.MINUTE_OF_DAY) > 0){
            System.out.println(endTime.get(ChronoField.MINUTE_OF_DAY) - k - startTime.get(ChronoField.MINUTE_OF_DAY));
        }else{
            System.out.println(0);
        }
    }
}



Measured memory_bytes: 36204
s=list(input())
t=list(input())
s_r=["*"]
t_r=["*"]
s_ans=[]
t_ans=[]
for c in s:
  if c in s_r:
    s_ans.append(s_r.index(c))
  else:
    s_r.append(c)
    s_ans.append(len(s_r)-1)
for c in t:
  if c in t_r:
    t_ans.append(t_r.index(c))
  else:
    t_r.append(c)
    t_ans.append(len(t_r)-1)
print("Yes" if t_ans==s_ans else "No")


Measured memory_bytes: 9776
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF (long long)(1e18)
#define MOD (int)(1e9+7)

#define yn(f) (f?"Yes":"No")
#define YN(f) (f?"YES":"NO")

signed main(){
	cout<<fixed<<setprecision(7);
	
	int N, p,ma = 0, sum = 0;
	
	cin>>N;
	
	for(int i = 0; i < N; i++){
		cin>>p;
		sum += p;
		ma = max(ma,p);
	}
	
	cout<<sum - ma/2<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define downque(que) priority_queue<ll> que;
#define upque(que) priority_queue<ll, vector<int>, greater<int>> que;
typedef long long ll;
typedef vector<vector<int>> Matrix;
const int MOD = 1e9 + 7;
const int MAX = 1e7;
const int INF = numeric_limits<int>::max();


int main(){

  ll n,count=0;
  cin >> n;
  bool flag = true;

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

  while(flag){
    REP(i,n){
      if(a[i]%2==0) a[i]/=2;
      else{
        flag = false;
        count--;
        break;
            }
    }
    count++;
  }

  cout << count << endl;
}


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

using namespace std;

struct Data {
    int y, m, d, ny;
} nn;

int main()
{
    while (cin >> nn.y >> nn.m >> nn.d) {
        int num = nn.d + nn.m * 100 + nn.y * 10000;
         
        if (num < 18680908) {
            cout << "pre-meiji" << endl;
            continue;
        } else if (18680908 <= num && num <= 19120729) {
            cout << "meiji" << ' ';
            nn.ny = nn.y - 1867;
        } else if (19120730 <= num && num <= 19261224) { 
            cout << "taisho" << ' ';
            nn.ny = nn.y - 1911;
        } else if (19261225 <= num && num <= 19890107) {
            cout << "showa" << ' ';
            nn.ny = nn.y - 1925;
        } else {
            cout << "heisei" << ' ';
            nn.ny = nn.y - 1988;
        }
        cout << nn.ny << ' ' << nn.m << ' ' << nn.d << endl;
    }
    return 0;
}

Measured memory_bytes: 2996
a,b,c,x,y = gets.split.map(&:to_i)
if x < y
  pin = b
elsif x > y
  pin = a
end

if a+b <= c*2
  puts x * a + y * b
else
  if x == y
    puts c * 2 * x
  else
    puts [c * 2 * [x, y].max, c * 2 * [x, y].min + (x - y).abs * pin].min
  end
end

Measured memory_bytes: 1788
#include<stdio.h>

int main(){
  int n,a[1000];
  int i,j,k;
  int v;
  
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&a[i]);

  for(i=1;i<n;i++){
    v=a[i];
    j=i-1;

     for(k=0;k<n;k++){
      printf("%d",a[k]);
      if(k!=n-1)
	printf(" ");
    }
    printf("\n");
    
    while(j>=0 && a[j]>v){
      a[j+1] = a[j];
      j--;
    }
    a[j+1] = v;
  }
   for(k=0;k<n;k++){
      printf("%d",a[k]);
      if(k!=n-1)
	printf(" ");
    }
    printf("\n");
    
  return 0;
}



Measured memory_bytes: 2136
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define all(v) v.begin(),v.end()
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define outmat(v) for(auto i : v){for(auto j : i) cout << j << " ";cout << endl;}
#define in(n,v) for(int i=0; i<(n); i++){cin >> v[i];}
#define out(n) cout << (n) << endl
#define fi first
#define se second
#define pb push_back
#define mod 1000000007
#define infi 1900000000
#define infl 1100000000000000000
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
#define csp << " " <<
#define outset(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T> using ve = vector<T>;
template<typename T> using pq2 = priority_queue<T>;
template<typename T> using pq1 = priority_queue<T,vector<T>,greater<T>>;
template<typename T> bool chmax(T &a, T b) {if(a < b) {a = b;return 1;}return 0;}
template<typename T> bool chmin(T &a, T b) {if(a > b) {a = b;return 1;}return 0;}


int N,M;
vvi G;
vi dp;

int rec(int n){
    
    if(dp[n] >= 0) return dp[n];
    int res = 0;
    
    for (int p : G[n]) {
        chmax(res,rec(p)+1);
    }
    
    return dp[n] = res;
    
}


int main(){
    
    cin >> N >> M;
    G.resize(N);
    dp.resize(N,-1);
    rep(i,M){
        int u,v;
        cin >> u >> v;
        u--,v--;
        
        G[u].pb(v);
    }
    
    int res = 0;
    rep(i,N) chmax(res,rec(i));
    
    cout << res << endl;
    

    
    
    
    

    return 0;
}


Measured memory_bytes: 8192
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

/* define*/
#define Yes(X) puts ( X ? "Yes" : "No")
#define YES(X) puts ( X ? "YES" : "NO")
#define FOR(i, a, b) for ( i = a, i < b ; i++)
#define REP(i, n) for ( i = 0; i < n ; i++)
#define DER(i, n) for ( i = 0; n ; i--)
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max3(a, b, c) ((max((a), (b)) > (c)) ? max((a), (b)) : (c))
#define min3(a, b, c) ((min((a), (b)) < (c)) ? min((a), (b)) : (c))

/* const */
const int MOD = 1e9 + 7;

/* alias */
typedef long long ll;

/* function */
int cmp(const int *a, const int *b) {
	return *a - *b;
}
int cmp2(const int *a, const int *b) {
	return *b - *a;
}

//* main */

int main() {
	int i, n, h, w, a, b, c = 0;
	scanf("%d%d%d", &n, &h, &w);
	REP(i, n) {
		scanf("%d%d", &a, &b);
		if (a >= h && b >= w)c++;
	}
	printf("%d", c);
	return 0;
}

Measured memory_bytes: 128
import sys
from functools import lru_cache
input = sys.stdin.readline
sys.setrecursionlimit(2 * 10**6)


def inpl():
    return list(map(int, input().split()))


def main():
    @lru_cache(maxsize=None)
    def recur(i, j):
        # print(i, j)
        if i == j:
            return 0
        for k in range(i, j):
            c = recur(i, k) + recur(k + 1, j) + P[i] * P[k + 1] * P[j + 1]
            if c < cost[i][j]:
                cost[i][j] = c
        return cost[i][j]

    N = int(input())
    RC = [inpl() for _ in range(N)]
    cost = [[float('inf')] * (N + 1) for a in range(N + 1)]
    P = [0] * (N + 1)
    for i, rc in enumerate(RC):
        P[i] = rc[0]
    P[N] = RC[N - 1][1]

    print(recur(0, N - 1))


if __name__ == '__main__':
    main()



Measured memory_bytes: 7096
using System;
using System.Collections.Generic;
using System.Text;

class TEST{
	static void Main(){
		while(true){
			var s=Console.ReadLine().Split(' ');
			int N=int.Parse(s[0]);
			if(N==0)break;
			long K=long.Parse(s[1]);
			WriteAns(N,K);
			Console.WriteLine("");
		}
	}

	static void WriteAns(int N,long K){
		if(N%2==1){
			Console.WriteLine("No");
			return;
		}
		int M=N/2;
		if(K>(0x1L<<M)){
			Console.WriteLine("No");
			return;
		}
		//possible pattern;
		char[][] Arr=new char[N+1][];
		for(int i=0;i<N+1;i++)Arr[i]=new char[N];
		
		for(int i=0;i<M;i++){
			Arr[0][0+2*i]=Arr[0][1+2*i]='x';
			Arr[1][(N-1)-(0+2*i)]=Arr[1][(N-1)-(1+2*i)]='.';
			if(((K-1)&(0x1L<<i))!=0)Arr[1][(N-1)-(0+2*i)]=Arr[1][(N-1)-(1+2*i)]='E';
		}
		
		Console.WriteLine(new String(Arr[1]));
		for(int i=2;i<N+1;i++){
			for(int j=0;j<N;j++){
				bool f=false;
				if(j==0){
					if(Arr[i-1][j]==Arr[i-1][j+1] && Arr[i-1][j]==Arr[i-2][j])f=true; 
				} else if(j==N-1){
					if(Arr[i-1][j]==Arr[i-1][j-1] && Arr[i-1][j]==Arr[i-2][j])f=true; 
				}
				else {
					if(Arr[i-1][j]==Arr[i-1][j-1] && Arr[i-1][j]==Arr[i-1][j+1])f=true; 
					if(Arr[i-1][j]==Arr[i-1][j-1] && Arr[i-1][j]==Arr[i-2][j])f=true; 
					if(Arr[i-1][j]==Arr[i-1][j+1] && Arr[i-1][j]==Arr[i-2][j])f=true; 
				}

				Arr[i][j]=f?flip(Arr[i-1][j]):Arr[i-1][j];
			}
			Console.WriteLine(new String(Arr[i]));
		}
	}
	
	static char flip(char c){
		return c=='E'?'.':'E';
	}
}

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

# define rep(i, n) for(int(i)=0;(i)<(n);(i)++)
# define reps(i, n) for(int(i)=1;(i)<=(n);(i)++)
# define rrep(i, n) for(int i=((int)(n)); i>0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>=0; --i)
# define ALL(v) v.begin(), v.end()
template<class T>inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<typename T> void dump(T e){std::cout << e << std::endl;}
template<typename T> void dump(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void dump(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ dump(v); } }
template <typename T>
void dump_stack(std::stack<T>& stack) {
  std::stack<T> temp;
  while (!stack.empty()) {
    T top = stack.top(); stack.pop();
    std::cout << top << " ";
    temp.push(top);
  }
  std::cout << endl;
  while (!temp.empty()) {
    T top = temp.top(); temp.pop();
    stack.push(top);
  }
}
template <typename T>
void dump_queue(std::queue<T>& queue) {
  std::queue<T> temp;
  while (!queue.empty()) {
    T top = queue.front(); queue.pop();
    std::cout << top << " ";
    temp.push(top);
  }
  std::cout << endl;
  while (!temp.empty()) {
    T top = temp.front(); temp.pop();
    queue.push(top);
  }
}

typedef long long ll;




int main(){
  int n;cin >> n;
  //vector<Item> lists(n);
  list<int> lists;
  list<int>::iterator it,l;
  string op;
  int num;
  rep (i, n) {
    cin >> op;
    if(op == "insert") {
      cin >> num;
      lists.push_front(num);
    } else if(op == "delete") {
      cin >> num;
      for(it=lists.begin(),l=lists.end();it!=l;++it){
	    if(*it == num){
	      lists.erase(it);
	      break;
	    }
      }
    } else if(op == "deleteFirst") {
      lists.pop_front();
    } else if(op == "deleteLast") {
      lists.pop_back();
    }
  }
  int cnt=0;
  for(auto itr = lists.begin(); itr != lists.end(); ++itr) {
    cout << (cnt==0? "": " ") << *itr;
    cnt++;
  }
  cout << endl;
}



Measured memory_bytes: 34444
#ifdef _MSC_VER
#  define _CRT_SECURE_NO_WARNINGS
#  define _USE_MATH_DEFINES
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif

#include <bits/stdc++.h>
using namespace std;
using i32 = int; using i64 = long long int; using f64 = double;
using u32 = unsigned int; using u64 = unsigned long long int; using str = string;
template <typename T> using vec = vector<T>; void in() { }
template <typename T, typename...TS> void in(T &&x, TS &&...xs) { cin >> x; in(move(xs)...); }
template <typename T> void out(T &&x) { cout << x << "\n"; }
template <typename T, typename...TS> void out(T &&x, TS &&...xs) { cout << x << " "; out(move(xs)...); }
#define indef(t, ...) t __VA_ARGS__; in(__VA_ARGS__)
#define get(t) []{ t x; cin >> x; return x; }()
#define times(n, i) for (i32 i = 0; i < (n); ++i)
#define range(a, b, i) for (i32 i = (a); i < (b); ++i)
#define upto(a, b, i) for (i32 i = (a); i <= (b); ++i)
#define downto(a, b, i) for (i32 i = (a); i >= (b); --i)
#define all(xs) (xs).begin(), (xs).end()
#define sortall(xs) sort(all(xs))
#define reverseall(xs) reverse(all(xs))
#define even(x) ((abs(x) & 1) == 0)
#define odd(x) ((abs(x) & 1) == 1)
#define bit(x, i) (((x) >> i) & 1)
#define append emplace_back
#define bisect_left lower_bound
#define bisect_right upper_bound
#define bound(a, x, b) (a <= x && x <= b)
const i64 MOD = 1000000007ll;
const f64 EPS = 1e-10;

template <typename T> T gcd(T a, T b) { while (b!=0) { swap(a, b); b = b%a; } return abs(a); }
template <typename T> T lcm(T a, T b) { return a==0 ? a : abs(b/gcd(b, a)*a); }

i32 a[4][4];
i32 oy[4] = { 0, -1, 0, 1 };
i32 ox[4] = { -1, 0, 1, 0 };

i64 solve() {
    indef(i32, n);
    i64 ans = 1;
    times(n, i) {
        indef(i64, t);
        ans = lcm(ans, t);
    }
    return ans;
}

i32 main()
{
    ios::sync_with_stdio(false);

#ifdef _MSC_VER
    /**
    ifstream fin("input.txt"); cin.rdbuf(fin.rdbuf()); assert(fin);
    ofstream fout("output.txt"); cout.rdbuf(fout.rdbuf()); assert(fout);
    /**/
#endif

    //cout << fixed << setprecision(9);
    out(solve());

#ifdef _MSC_VER
    /**/
    /**/
#endif
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define N 200000

int main(){
	int num,FX[N],max=-1000000000,sa,i,j;
	int min=0;

	scanf("%d",&num);

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

	min=FX[0];

	for(i=1;i<num;i++){
		sa=FX[i]-min;
		if(max<sa)
			max=sa;
		if(FX[i]<min)
			min=FX[i];
	}

	printf("%d\n",max);

	return 0;
}


Measured memory_bytes: 2516
#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 * 2 + 7;


int a[N];
bool used[N]; 

main()
{
	int n , ans = 0;
	cin >> n;
	
	for(int i = 1; i <= n; i++)scanf("%d" , &a[i]);
	
	
	sort( a + 1 , a + n + 1 );
	
	
	
	for(int pw = (1 << 30); pw > 0; pw >>= 1)
	{
		
		for(int i = 1 , j = n; i < j; i++)
		{
			if( !used[i] )
			{
				while(j > i && ( used[j] == true || a[i] + a[j] > pw ) )j--;
				
				if( j > i && used[j] != true &&  a[i] + a[j] == pw )
				{
					ans ++;
					used[i] = used[j] = true;
				}
				
			}
		}
	
	}
	
	
	cout << ans << endl;
	
}


Measured memory_bytes: 1280
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
const int MOD = 1E9+7;
const int N = 1000000+5;
const int dx[] = {0,0,-1,1,-1,-1,1,1};
const int dy[] = {-1,1,0,0,-1,1,-1,1};
using namespace std;
int main() {
    int n;
    scanf("%d",&n);

    LL a=1,b=1;
    for(int i=1;i<=n;i++){
        LL x,y;
        scanf("%lld%lld",&x,&y);
        LL percent=max(a/x,b/y);
        while(true){
            if(percent*x>=a&&percent*y>=b)
                break;
            percent++;
        }
        a=percent*x;
        b=percent*y;
    }
    printf("%lld\n",a+b);

    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
	int n,t,m,a,i;
	cin>>n>>m>>a;
	if(n>m) t=n;
	else t=m;
	for(i=1;;i++)
	{
		if(i*t>=a) {cout<<i; 
		break;
		}
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  Int n,k;
  cin>>n>>k;
  cout<<n-k+1<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define pb push_back
template<class T>void chmax(T &a,T b){if(a<b)a=b;}
template<class T>void chmin(T &a,T b){if(a>b)a=b;}
constexpr int INF=1000000000000000000;
constexpr int mod=1000000007;
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int kaijo[2000010];
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
void init_fact(){
    kaijo[0]=1;
    for(int i=1;i<=2000000;i++){
        kaijo[i]=kaijo[i-1]*i;
        kaijo[i]%=mod;
    }
}
int modpow(int a,int b){
    if(b==0)return 1;
    if(b%2)return modpow(a,b-1)*a%mod;
    int memo=modpow(a,b/2);
    return memo*memo%mod;
}
int comb(int a,int b){
    if(!kaijo[0])init_fact();
    return kaijo[a]*modpow(kaijo[a-b],mod-2)%mod*modpow(kaijo[b],mod-2)%mod;
}
int inv(int x){
    x=modpow(x,mod-2);
    return x;
}
bool kosa(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){
    double ta=(cx-dx)*(ay-cy)+(cy-dy)*(cx-ax);
    double tb=(cx-dx)*(by-cy)+(cy-dy)*(cx-bx);
    double tc=(ax-bx)*(cy-ay)+(ay-by)*(ax-cx);
    double td=(ax-bx)*(dy-ay)+(ay-by)*(ax-dx);
    return tc*td<0&&ta*tb<0;
}
int h,w,n,x[200010],y[200010],ans[200010],res;
map<P,bool>mp;
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin>>h>>w>>n;
    rep(i,n){
        cin>>x[i]>>y[i];
        mp[{x[i],y[i]}]=true;
    }
    int ri=0;
    for(int i=1;i<=h;i++){
        ri+=1-mp.count({i,ri+1});
        ans[i]=ri;
        //[1,ans[i]]
    }
    res=h;
    rep(i,n){
        if(y[i]<=ans[x[i]-1])chmin(res,x[i]-1);
    }
    cout<<res<<endl;
	return 0;
}


Measured memory_bytes: 18944
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>

using namespace std;

int main()
{
    char c;
    cin>>c;
    switch(c)
    {
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u': cout<<"vowel"<<endl; break;
        default:cout<<"consonant"<<endl; break;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val
using namespace std;
using namespace __gnu_pbds;

#define sp << " " <<
#define mod 1000000007
#define PI 3.14159265358979323
#define y second
#define x first
#define pb push_back
#define mp make_pair
#define sz(a) a.size()
#define pqueue priority_queue< ll >
//#define pdqueue priority_queue< ll,vector<ll> ,greater< ll > >
#define codejamDebug(x) cout<<"Case #"<<x<<": ";
#define debug(x) cout<<#x<<" :"<<x<<endl;
#define rep(i,n) for(long long i=0;i<n;i++)
#define f(i,a,b) for(long long i = a; i < b; i++)
#define fd(i,a,b) for(long long i = a; i >=b; i--)
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef long long int           ll;
typedef long double             ld;
typedef unsigned long long int ull;
typedef vector <int>            vi;
typedef vector <ll>            vll;
typedef pair <int, int>        pii;
typedef pair <ll, ll>          pll;
typedef vector < pii >        vpii;
typedef vector < pll >        vpll;
typedef vector <string>         vs;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

//Handle:cyber_rajat

int main(int argc, char const *argv[])
{
	sync;
	ll a;
	cin >> a;
	int ans = 0;
	ll tmp = 100;
	while(tmp < a)
	{
		tmp *=1.01;
		ans++;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>
using namespace std;
using ll = long long;


int main(){
  ll n; cin >> n;
  vector<vector<ll>> v(n,vector<ll>(2, 0));
  
  for(int i = 0; i < n; i++){
    cin >> v[i][1] >> v[i][0];
  }
  sort(v.begin(), v.end());

  ll sum = 0;
  bool f = true;
  for(int i = 0; i < n; i++){
    sum += v[i][1];
    //cout << sum << endl;
    if(sum > v[i][0]){ f = false; break;}
    
  }
  if(f) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 11136
#include<bits/stdc++.h>
using namespace std;
int main(){
  int H,W;
  cin>>H>>W;
  char s[H+1][W+1];
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++)
      cin>>s[i][j];
  }
  for(int i=0;i<H+1;i++)
    s[i][W]='#';
  for(int j=0;j<W+1;j++)
    s[H][j]='#';
  int s1[H+1][W+1],s2[H+1][W+1];
  
  for(int l=0;l<W+1;l++){
    int i=0,j=0;
    while(j<H+1){
      if(s[j][l]=='.'){
        j+=1;
      }
      else{//s[j][l]=='#'
        s1[j][l]=0;
        for(int k=i;k<j;k++)
          s1[k][l]=j-i;
        j+=1;
        i=j;
      }
    }
  }
  
  for(int l=0;l<H+1;l++){
    int i=0,j=0;
    while(j<W+1){
      if(s[l][j]=='.'){
        j+=1;
      }
      else{//s[l][j]=='#'
        s2[l][j]=0;
        for(int k=i;k<j;k++)
          s2[l][k]=j-i;
        j+=1;
        i=j;
      }
    }
  }
  int ans=0;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      ans=max(ans,s1[i][j]+s2[i][j]);
    }
  }
  cout<<ans-1<<endl;
  /*
  for(int i=0;i<H+1;i++){
    for(int j=0;j<W+1;j++){
      cout<<s1[i][j]<<" ";
    }
    cout<<endl;
  }
  cout<<endl;
  for(int i=0;i<H+1;i++){
    for(int j=0;j<W+1;j++){
      cout<<s2[i][j]<<" ";
    }
    cout<<endl;
  }
  */
}

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

int main(void)
{
	int ans = 0;
	int N; cin >> N;
	vector<int> h(N);
	int max = 0;
	for (int i = 0; i < N; i++) {
		cin >> h[i];
		max = (max < h[i]) ? h[i] : max;
	}

	while (max--) {
		int count = 1;
		for (int i = 1; i < N-1; i++) {
			if (h[i] == 0 && h[i - 1] != 0)count++;
		}
		if (h[N - 2] == 0 && h[N - 1] == 0)count--;
		for (int i = 0; i < N; i++) {
			if (h[i] > 0)h[i]--;
		}
		ans += count;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#define INF 1001001001
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
vector <int> pre(n,-1);
vector <int> dist(n,INF);
vector <int> to[n];
for(int i=0;i<m;i++)
{
int a,b;
cin>>a>>b;
a--;b--;
to[a].push_back(b);
to[b].push_back(a);
}

queue<int>q;
q.push(0);
while(!q.empty())
{
int v =q.front();q.pop();
    for(int u :to[v])
    {
        if(dist[u]!=INF)continue;
        dist[u]=dist[v]+1;
        pre[u]=v;
        q.push(u);

    }
}

cout <<"Yes"<<endl;
for(int i=0;i<n;i++)
{
if(i==0)continue;
int ans =pre[i];
ans++;
cout <<ans <<endl;

}
}

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

int main()
{
	int n,m,goal;
	cin >> n >> m >> goal;
	long book[n],skill[n][m];
	long d[m];
	rep(i, n)
	{
		cin >> book[i];
		rep(j, m)
		{
			cin >> skill[i][j];
			d[j] = 0;
		}
	}
	long ans = LONG_MAX;
	long sum ;
	long cnt ;
	for (int bit = 0; bit < (1<<n); bit++)
	{
		sum = 0;
		rep(s, m)
		{
			d[s] = 0;
		}
		for (int i = 0; i < n; i++)
		{
			cnt = 0;
			if (bit>>i&1)
			{
				sum += book[i];
				rep(j, m)
				{
					d[j] += skill[i][j];
				}
				rep(k, m)
				{
					if (d[k] >= goal)
					{
						cnt++;
					}
				}
				if (cnt == m)
					ans = min(ans, sum);
			}
		}
	}
	if (ans != LONG_MAX)
		cout << ans << endl;
	else
		cout << -1 << endl;
	return (0);
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define rep(i, a, b) for (register int i = a; i <= b; i++)

using namespace std;

const int N = 1e5 + 10;
char str[N];
int ans, len;

void savecode() {

}

int main() {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    int ans = 0;
    int t = min(b, c);
    ans += 2 * t;
    c -= t;
    b -= t;

    if (c == 0) {
        ans += b;
        cout << ans;
        return 0;
    }

    ans += min(a, c);
    c -= min(a, c);
    if (c != 0) ans++;
    cout << ans;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import itertools
x = int(input())
l = [0, 1, 32, 243, 1024, 3125, 7776, 16807, 32768, 59049, 100000, 161051, 248832, 371293, 537824, 759375, 1048576, 1419857, 1889568, 2476099, 3200000, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176, 69343957, 79235168, 90224199, 102400000, 115856201, 130691232, 147008443, 164916224, 184528125, 205962976, 229345007, 254803968, 282475249, 312500000, 345025251, 380204032, 418195493, 459165024, 503284375, 550731776, 601692057, 656356768, 714924299, 777600000, 844596301, 916132832, 992436543, 1073741824, 1160290625, 1252332576, 1350125107, 1453933568, 1564031349, 1680700000, 1804229351, 1934917632, 2073071593, 2219006624, 2373046875, 2535525376, 2706784157, 2887174368, 3077056399, 3276800000, 3486784401, 3707398432, 3939040643, 4182119424, 4437053125, 4704270176, 4984209207, 5277319168, 5584059449, 5904900000, 6240321451, 6590815232, 6956883693, 7339040224, 7737809375, 8153726976, 8587340257, 9039207968, 9509900499, 10000000000, 10510100501, 11040808032, 11592740743, 12166529024, 12762815625, 13382255776, 14025517307, 14693280768, 15386239549, 16105100000, 16850581551, 17623416832, 18424351793, 19254145824, 20113571875, 21003416576, 21924480357, 22877577568, 23863536599, 24883200000, 25937424601, 27027081632, 28153056843, 29316250624, 30517578125, 31757969376, 33038369407, 34359738368, 35723051649, 37129300000, 38579489651, 40074642432, 41615795893, 43204003424, 44840334375, 46525874176, 48261724457, 50049003168, 51888844699, 53782400000, 55730836701, 57735339232, 59797108943, 61917364224, 64097340625, 66338290976, 68641485507]
for comb in itertools.combinations_with_replacement(l, 2):
    if comb[0] - comb[1] == x:
        print(l.index(comb[0]), l.index(comb[1]))
        exit()
    elif comb[0] + comb[1] == x:
        print(l.index(comb[0]), -(l.index(comb[1])))
        exit()
    elif - comb[0] + comb[1] == x:
        print(-(l.index(comb[0])), -(l.index(comb[1])))
        exit()
    elif - comb[0] - comb[1] == x:
        print(-(l.index(comb[0])), l.index(comb[1]))
        exit() 

Measured memory_bytes: 9344
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <vector>
#include <sys/mman.h>
#include <unistd.h>
typedef long long lint;
const int N=2e5+5;
const int mod=1e9+7;
int n,lim1,lim2,npos1,npos2,col[N],wgt[N],lpos[N];
int fac[N],ifac[N];
std::vector <int> list[N];

namespace IO{
	char *ibuf;
	struct _Init{
		_Init(){ibuf=(char*)mmap(0,lseek(0,0,SEEK_END),PROT_READ,MAP_PRIVATE,0,0);}
	}_init;
	inline int nxi(){
		int x=0;
		char c;
		while((c=*ibuf++)>'9'||c<'0');
		while(x=x*10-48+c,(c=*ibuf++)>='0'&&c<='9');
		return x;
	}
}
using IO::nxi;

template <class T> inline int fpow(int x,T t){
	int ans=1;
	for(; t; x=(lint)x*x%mod,t>>=1){
		if(t&1) ans=(lint)ans*x%mod;
	}
	return ans;
}

inline void init(){
	fac[0]=1;
	for(int i=1; i<=n; ++i){
		fac[i]=(lint)fac[i-1]*i%mod;
	}
	ifac[n]=fpow(fac[n],mod-2);
	for(int i=n; i; --i){
		ifac[i-1]=(lint)ifac[i]*i%mod;
	}
}

namespace U{
	int fa[N];
	int find_rt(const int x){
		return fa[x]?fa[x]=find_rt(fa[x]):x;
	}
	inline void link(int x,int y){
		//printf("linked: %d %d\n",x,y);
		x=find_rt(x),y=find_rt(y);
		if(x!=y) fa[x]=y;
	}
}

int solve(const int x){
	static int buk[N];
	int res=fac[list[x].size()];
	for(std::vector <int> ::iterator it=list[x].begin(); it!=list[x].end(); ++it){
		++buk[col[*it]];
	}
	for(std::vector <int> ::iterator it=list[x].begin(); it!=list[x].end(); ++it){
		if(!buk[col[*it]]) continue;
		res=(lint)res*ifac[buk[col[*it]]]%mod;
		buk[col[*it]]=0;
	}
	return res;
}

int main(){
	n=nxi(),lim1=nxi(),lim2=nxi();
	init();
	wgt[0]=mod;
	for(int i=1; i<=n; ++i){
		col[i]=nxi(),wgt[i]=nxi();
		if(!lpos[col[i]]||wgt[lpos[col[i]]]>wgt[i]){
			lpos[col[i]]=i;
		}
	}
	for(int i=1; i<=n; ++i){
		if(i!=lpos[col[i]]&&wgt[i]+wgt[lpos[col[i]]]<=lim1){
			U::link(i,lpos[col[i]]);
		}
	}
	for(int i=1; i<=n; ++i){
		if(!lpos[i]) continue;
		int tmp=lpos[i];
		if(wgt[npos1]>wgt[tmp]) std::swap(npos1,tmp);
		if(wgt[npos2]>wgt[tmp]) std::swap(npos2,tmp);
	}
	assert(npos1);
	for(int i=1; i<=n; ++i){
		if(npos1&&col[i]!=col[npos1]&&wgt[i]+wgt[npos1]<=lim2){
			U::link(i,npos1);
		}
		if(npos2&&col[i]!=col[npos2]&&wgt[i]+wgt[npos2]<=lim2){
			U::link(i,npos2);
		}
	}
	for(int i=1; i<=n; ++i){
		list[U::find_rt(i)].push_back(i);
	}
	int ans=1;
	for(int i=1; i<=n; ++i){
		if(U::find_rt(i)==i){
			ans=(lint)ans*solve(i)%mod;
		}
	}
	printf("%d\n",ans);
	return 0;
}

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

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int mod = (int)1e9 + 7;
void dbg(){ cerr << "\n"; }  template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

vector<VI> r;
VI mem;

int rec(int p){
	if(mem[p] !=-1) return mem[p];
	mem[p] = 0;
	for(int u: r[p]) mem[p] = max(mem[p], rec(u)+1);
	return mem[p];
}

int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n, m, ans =0;
	cin >>n >>m;
	r.resize(n);
	mem.assign(n, -1);
	VI rh(n);
	rep(i,m){
		int x, y;
		cin >>x >>y;
		r[x-1].emplace_back(y-1);
		rh[y-1]++;
	}
	
	rep(i, n) if(rh[i] ==0) ans = max(ans, rec(i));
	cout << ans <<"\n";
	return 0;
}


Measured memory_bytes: 11136
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

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

	bool isOk = false;
	for (int i = A; i <= B; i++) {
		if (i % K == 0) {
			isOk = true;
			break;
		}
	}

	if (isOk) {
		cout << "OK" << endl;
	}
	else {
		cout << "NG" << endl;
	}

	return 0;
}

Measured memory_bytes: 3100
import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		int N = Integer.parseInt(in.readLine());
		String S = in.readLine();
		boolean result = false;
		if (N % 2 == 0) {
			String s1 = S.substring(0, N / 2);
			String s2 = S.substring(N / 2, N);
			if (s1.equals(s2)) {
				result = true;
			}
		}
		System.out.println((result ? "Yes" : "No"));
	}
}


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

int main()
{
	int N;
	scanf("%d", &N);
	
	int ans = 0;
	for(int i = 1; i <= N; i++)
	{
		int ai;
		scanf("%d", &ai);
		
		if(i % 2 == 1 && ai % 2 == 1)
			ans++;
	}
	
	printf("%d", ans);
}


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

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double
# define ull unsigned long long

# define pb push_back
# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vld vector < ld >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()

# define pii pair < int , int >
# define vpii vector < pii >
# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);
# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b));
# define mod 1000000007

# define pp(n) printf("%.10f",n);
# define line cout<<"\n";

const D pie = acos(-1);
const D hpie = asin(1);
const D qpie = atan2(1,1);
const D tpie = 2*pie;

string vow = "aeiou";

void solve( int test_case )
{
    ull n;
    cin >> n;
    
    cout << (n*(n+1))/2;
    line
}

int main()
{
    int t = 1;
    //cin>>t;

    for ( int i=0 ; i<t ; i++ ) solve(i);
    return 0;
}


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

#define NL '\n'
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define ones __builtin_popcount
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%I64d",&x)
#define sd(x) scanf("%lf",&x)
#define ss(x) scanf("%s",x)
#define mem(a,b) memset(a,b,sizeof(a))
#define FOR(i,j,k) for(int i=j;i<=k;i++)
#define REV(i,j,k) for(int i=j;i>=k;i--)
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#define debug(x) cerr << "debug = " << x << "\n";
#define debugs(s,x) cerr << "debug : " << s << " = " << x << "\n";
#define cnd tree[idx]
#define lnd tree[idx*2]
#define rnd tree[(idx*2)+1]
#define lndp (idx*2),(b),((b+e)/2)
#define rndp (idx*2+1),((b+e)/2+1),(e)
#define X real()
#define Y imag()
#define Point complex<long double>
#define pi 2.0*acos(0.0)
#define EPS 1e-9
#define INF INT_MAX
#define MOD 1000000007
#define MAX 100005

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;


int mod(string num, int a)
{
    // Initialize result
    int res = 0;

    // One by one process all digits of 'num'
    for (int i = 0; i < num.length(); i++)
         res = (res*10 + (int)num[i] - '0') %a;

    return res;
}

int main()
{
    //READ("input.txt");
    //WRITE("out.txt");
    //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    //uniform_int_distribution<int>(0, 10000)(rng)
    std::ios_base::sync_with_stdio(0);
int m,n;
cin>>m>>n;
if(m==n){
   for(int i=0;i<n;i++){
    cout<<n;
   }
   cout<<endl;
}
else{
    for(int i=0;i<max(m,n);i++){
    cout<<min(m,n);
   }
   cout<<endl;
}



    return 0;
}





Measured memory_bytes: 256
card = []
for i in range(3):
    num = [int(i) for i in input().split(" ")]
    for n in num:
        card.append(n)
# print(card)
N = int(input())
for i in range(N):
    m = int(input())
    try:
        idx = card.index(m)
    except ValueError:
        continue
    card[idx]=0
# print(card)
flag = 0
for i in [0,3,6]:
    if (card[i]+card[i+1]+card[i+2])==0:
        flag=1
        break
if flag!=1:
    for i in [0,1,2]:
        if (card[i]+card[i+3]+card[i+6])==0:
            flag=1
            break
if flag!=1:
    if (card[0]+card[4]+card[8])==0:
        flag=1
    elif (card[2]+card[4]+card[6])==0:
        flag=1
        
if flag==1:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll er[10000001];
int n;
ll res;
int main()
{
    cin.sync_with_stdio(0); cin.tie(0);
    for(int i = 1; i <= 10000001; i++){
        for(int j = i; j <= 10000001; j += i){
            er[j]++;
        }
    }
    cin >> n;
    for(int i = 1; i <= n; i++){
        res += er[i]*i;
    }
    cout << res << endl;
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  int L[N];
  int ans=0;
  for(int i=0;i<N;i++){
    cin >> L[i];
  }
  for(int i=0;i<N;i++){
    for(int j=i;j<N;j++){
      for(int k=j;k<N;k++){
        if(L[i] !=L[j] && L[j] !=L[k] && L[k] !=L[i]){
          if(L[i]+L[j]>L[k] && L[j]+ L[k]>L[i] && L[k]+L[i]>L[j]){
            ans = ans + 1;
          }
        }
      }
    }
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3592
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;
using System.Runtime.InteropServices.ComTypes;
using System.Xml.Schema;
using System.ComponentModel.DataAnnotations;
using System.Security.Cryptography;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var (N, K) = Slice2<long>();
            var S = "1" + ReadLine() + "10";
            var bs = new List<(long b, long e)>();
            bs.Add((1, 0));
            for (var i = 0; i < S.Length - 1; ++i)
            {
                if (S[i] == '1' && S[i + 1] == '0')
                    bs[bs.Count - 1] = (bs[bs.Count - 1].b, i + 1);
                if (S[i] == '0' && S[i + 1] == '1')
                    bs.Add((i + 1, 0));
            }
            bs[bs.Count - 1] = (bs[bs.Count - 1].b, bs[bs.Count - 1].e - 1);
            if (bs.Count <= K + 1)
            {
                WriteLine(N);
                return;
            }
            var max = 0L;
            for (var i = 0; i < bs.Count - K; ++i)
                max = Max(max, bs[i +(int)K].e - bs[i].b);
            WriteLine(max);
        }

        static long Mod = (long)1e9 + 7;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
        static public (T a, T b, T c, T d) Slice4<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)),
            (T)Convert.ChangeType(t[3], typeof(T)));
        }
    }
}

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

def saiki(i,ans):
    if i>N:
        return ans
    else:
        s = str(i)
        if ("7" in s) and ("5" in s) and ("3" in s):
            ans += 1
        ans = saiki(i*10+3,ans)
        ans = saiki(i*10+5,ans)
        ans = saiki(i*10+7,ans)
        return ans
    
print(saiki(0,0))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define fol(i,n) for(int i=0;i<n;i++)
#define pb push_back
typedef long long ll;
typedef pair<int,int> P;
typedef vector<P> vip;

int main(){
  int a,b,c;cin>>a>>b>>c;
  cout << min(c,b/a)<<endl;
  return 0;
}

Measured memory_bytes: 764
#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <vector>
using namespace std;
const int maxn = 2e6+10;
typedef pair<int,int> pii;
typedef long long ll;

string S,T,U;
int A,B;
int main(){
    cin>>S>>T;
    cin>>A>>B;
    cin>>U;
    if(U == S){
        cout<<A-1<<" "<<B;
    }else if(U == T){
        cout<<A<<" "<<B-1;
    }else{
        cout<<A<<" "<<B;
    }
    return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var S string
	fmt.Scan(&S)
	ans := 1000000
	for i := 0; i+2 < len(S); i++ {
		X, _ := strconv.Atoi(S[i : i+3])
		d := 753 - X
		if d < 0 {
			d *= -1
		}
		if ans > d {
			ans = d
		}
	}
	fmt.Println(ans)
}


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

#define rep(ver,n) rep2(ver,0,n)
#define rep2(ver,m,n) for(int ver=m;ver<(n);ver++)
#define loop while(true)
#define dup(x,y) (((x)+(y)-1)/(y))
#define all(v) (v).begin(), (v).end()
#define debug(x) std::cerr<<#x<<": "<<x<<"\n"
#define debug2(x,y) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<"\n"
#define debug3(x,y,z) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<", "<<#z<<": "<<z<<"\n"

typedef long long ll;
typedef pair<int, int> P;

int main(){
  string s;
  cin>>s;
  
  int num=0;
  
  for(int i=0;i<(int)s.length();i++){
    num+=(s[i]-'0');
  }
  
  if(num%9==0)cout<<"Yes";
  else cout<<"No";
  
  return 0;
}


Measured memory_bytes: 3748
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

/* Macros reg. ends here */

const ll INF = 1LL << 50;

int main() {
  // ios_base::sync_with_stdio(0), c
  cout << fixed << setprecision(15);

  ll n;
  cin >> n;

  multiset<ll> lst;
  rep(i, n){
    ll a;
    cin >> a;
    if(lst.empty()){
      lst.insert(a);
      continue;
    } 
    auto itr = lst.lower_bound(a);
    if(itr == lst.begin()){
      lst.insert(a);
    } else {
      itr--;
      lst.erase(itr);
      lst.insert(a);
    }
  }

  cout << lst.size() << endl;

  return 0;
}


Measured memory_bytes: 8240