akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath> 
#include <queue>
#include <functional>

using namespace std;
typedef long long ll;
//typedef pair<int, int> P;
//static const int dx[4] = {1, -1, 0, 0};
//static const int dy[4] = {0, 0, 1, -1};

//const ll MOD = 1e+9 + 7;
//const int MAX = 10001;

int main() {

    ll L , R; cin >> L >> R;

    ll mod = 2019;

    vector<ll> mul;
    for (ll i = 0; i * 2019 <= 2e+9; i++) {
        mul.push_back(i * 2019);
    }

    ll ans = 100000;

    for(int i = 0; i < mul.size(); i++) {
        if (L <= mul[i] and mul[i] <= R)
            ans = 0;
    }
    if (ans == 100000) {
        for (ll i = L; i <= L + 2019 * 2 and i <= R; i++) {
            for ( ll j = i + 1; j <= L + 2019 * 2 and j <= R; j++) {
                ll x = i * j % mod;
                ans = min(ans, x);
            }
        }
    }
    cout << ans << '\n';


}


Measured memory_bytes: 10604
import copy

data = raw_input()

n,m = map(int,data.split(" "))

db = []
ans = 0

def search(pos,vis):
  global db
  global ans
  global n,m
  if len(vis) == n:
    ans = ans + 1
    return
  for x in db:
    if x[0] == pos:
      if x[1] not in vis:
        vis2 = copy.deepcopy(vis)
        vis2.append(x[1])
        search(x[1],vis2)

    if x[1] == pos:
      if x[0] not in vis and x[0] != 1:
        vis2 = copy.deepcopy(vis)
        vis2.append(x[0])
        search(x[0],vis2)


for x in range(m):
  data = raw_input()
  a,b = map(int,data.split(" "))
  db.append([a,b])

for x in db:
  if x[0] == 1:
    search(x[1],[1,x[1]])

print ans


Measured memory_bytes: 2696
package main

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

var nextString func() string

func init() {
	nextString = newReadString(os.Stdin)
}

func main() {
	s := nextString()
	for i := 0; i < len(s); i += 2 {
		fmt.Print(string(s[i]))
	}
	fmt.Println()
}

func nextInt() (result int) {
	result, _ = strconv.Atoi(nextString())
	return
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
		}
		return r.Text()
	}
}


Measured memory_bytes: 2048
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<math.h>
#include<climits>
#include<set>
#define debug(x) cout <<#x<<" = "<<x<<endl
#define debug2(x, y) cout<<#x<<" = "<<x<<", "<<#y<<" = "<<y<<endl
#define gg cout <<"---------------QAQ---------------"<<endl
#define fi first
#define SZ(x) (int)x.size()
#define se second
#define pb push_back
#define inf 0x3f3f3f3f
#define lson l, m, rt<<1
#define rson m+1, r, rt<<1|1
#define PI acos(-1)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, ll> Pii;
template<class T> inline void read(T &x){
    x=0; char c=getchar(); int f=1;
    while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
    while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
const int N = 2e5+10, maxn = 1e6+5;
void FAST(){ios::sync_with_stdio(false);cin.tie(0);}
const ll mod =  1e9+7;

int n, m, k, q;
struct node
{
    int a, b, c, d;
}s[100];
int ans = 0;
int pre[100];

void dfs(int step, int x)
{
    if(step == n+1) {
        int tmp = 0;
        for(int i = 0;i < q; ++i) {
            if(pre[s[i].b]-pre[s[i].a] == s[i].c)
                tmp += s[i].d;
        }
        ans = max(ans, tmp);
        return ;
    }
    for(int i = x; i <= m; ++i) {
        pre[step] = i;
        dfs(step+1, i);
    }
}
void solve()
{
    scanf("%d%d%d", &n, &m, &q);
    for(int i = 0; i < q; ++i) {
        scanf("%d%d%d%d", &s[i].a, &s[i].b, &s[i].c, &s[i].d);
    }
    dfs(1, 1);
    printf("%d\n", ans);
}


int main()
{

//    int _; scanf("%d", &_); while(_--)
//    while(~scanf("%d", &n))
//    while(scanf("%d", &n)&&n)
    solve();
    return 0;
}


Measured memory_bytes: 3828
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::ops::Bound::*;
use itertools::Itertools;
use num_traits::clamp;
use ordered_float::OrderedFloat;
use proconio::{input, marker::*, fastout};
use superslice::*;

#[fastout]
fn main() {
    input! {
        n: usize, q: usize,
        a: [usize; n],
    }

    let mut bit = BIT::new(n);
    for (i, a) in (0..).zip(a) {
        bit.add(i + 1, a);
    }

    for _ in 0..q {
        input!(command: usize, x: usize, y: usize);
        if command == 0 {
            bit.add(x + 1, y);
        } else {
            let res = bit.sum(y) - bit.sum(x);
            println!("{}", res);
        }
    }
}

#[allow(dead_code)]
/// Binary Indexed Tree of usize
pub struct BIT {
    buf: Vec<usize>,
}
#[allow(dead_code)]
impl BIT {
    pub fn new(n: usize) -> BIT {
        BIT {
            buf: vec![0; n + 1],
        }
    }
    pub fn sum(&self, i: usize) -> usize {
        let mut i = i;
        let mut s = 0;
        while i > 0 {
            s += self.buf[i];
            i &= i - 1;
        }
        s
    }
    pub fn add(&mut self, i: usize, x: usize) {
        let mut i = i as i64;
        while i < self.buf.len() as i64 {
            self.buf[i as usize] += x;
            i += i & -i;
        }
    }
}

Measured memory_bytes: 23008
using System;
// using System.Collections.Generic;
// using System.Linq;
using System.Text;

class Program
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        string S = Console.ReadLine();
        string alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        Console.WriteLine(tran(S, alp, alp.Substring(N) + alp.Substring(0, N)));
        return;
    }
    static string tran(string S, string f, string t)
    {
        StringBuilder sb = new StringBuilder(S.Length);
        for (int i = 0; i < S.Length; i++)
        {
            int idx = f.IndexOf(S[i]);
            sb.Append(t[idx]);
        }
        return sb.ToString();
    }
}

Measured memory_bytes: 27588
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define fi first
#define se second

#define INF 2147483600

int main(){
  int n;
  cin>>n;
  cout<< n*(n+1)/2 <<endl;

  return 0;
}


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

int main() {
    int n;
    string s;
    cin >> n >> s;
    bool flag = false;
    if (n % 2 == 0) {
        flag = true;
        rep(i,n/2) {
            if (s[i] != s[n/2+i]) {
                flag = false;
                break;
            }
        }
    }
    if (flag) cout << "Yes\n";
    else cout << "No\n";
    return 0;
}

Measured memory_bytes: 256
#include <string>
#include <iostream>
using namespace std;
int main(){
    int n;
    cin >> n;
     int J;
    cin >> J;
    int k = J-1;


    char a[n];
    for(int i =0; i< n; i++){
        cin >> a[i];
    }
    if(a[k] == 'A'){
        a[k] = 'a';
    }
    if(a[k] == 'B'){
        a[k] = 'b';
    }
    if(a[k] == 'C'){
        a[k] = 'c';
    }
    for(int i = 0; i<n ;i++){
        cout << a[i];
    }
}


Measured memory_bytes: 256
#include <stdio.h>
#include <limits.h>

int main(void) {
	int N, T, c, t, C = INT_MAX, Flag = 0;
	scanf("%d %d", &N, &T);
	for (int i = 0; i < N;++i) {
		scanf("%d %d", &c, &t);
		if (t <= T && C > c) {
			C = c;
			Flag = 1;
		}
	}
	if (Flag)printf("%d", C);
	else printf("TLE");
	return 0;
}

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

int main(){
  int n; cin >> n;
  vector<int> d(n);
  for(int i = 0; i < n; i++){
    cin >> d.at(i);
  }
  int ans = 0;
  for(int i = 0; i< n; i++){
    for(int j = i + 1; j < n; j++){
      ans += d.at(i)*d.at(j);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
N=gets.to_i
C=[]
S=[]
F=[]
(N-1).times{
    c,s,f=gets.split.map(&:to_i)
    C << c
    S << s
    F << f
}
r=Array.new(N){0}
(N-1).times{|i|
    (0 .. i).each{|j|
        if r[j] < S[i]
            r[j] = S[i]
        else
            t = r[j] / F[i]
            if r[j] % F[i] != 0
                t += 1
            end
            r[j] = t * F[i]
        end
        r[j] += C[i]
    }
    warn r.inspect
}
puts r


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

int desc(const void *a, const void *b) {
  return *(int *)b - *(int *)a;
}

int main(void){
    int N;
    scanf("%d",&N);
    
    int a[110] = {0};
    for(int i = 0; i < N; i++){
        scanf("%d",a+i);
    }
    
    qsort(a,sizeof(a)/sizeof(int),sizeof(int),desc);
    
    printf("%d\n",a[0]-a[N-1]);
    
    return 0;
}



Measured memory_bytes: 128
import java.util.*;
import java.util.regex.Pattern;

public class Main {

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

        if (Pattern.matches("^[A-Z]+$", n)) {
            System.out.println("A");
        }else {
            System.out.println("a");
        }
    }
}


Measured memory_bytes: 35756
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Arrays;
import java.util.Collections;
import java.util.*;
class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
String S = scan.next();
int count = 0;
String[] split = S.split("");
for (int i = 0;i < N-2; i++) {
  if (split[i].equals("A")) {
    if (split[i+1].equals("B")) {
      if (split[i+2].equals("C")) {
        count += 1;
      }
    }
  }
}
System.out.println(count);
}
}


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

# define ll long long 
# define VI vector<int>
# define VL vector<ll>
# define PII pair<int,int> 
# define VII vector<PII>
# define mp make_pair
# define pb push_back
# define PI acos(-1)
# define ld long double
# define FOR(i,a,b) for(int i = a ; i < b ; ++i) 
const ll inf = 1e18 ; 
const int MxN = 200000 ; 
int n ,a,b,c,d;
string s ; 


bool dfs(int p1, int dest) {
	for(int i = p1 ; i < dest ; ++i) {
		if(s[i] == '#' && s[i+1] == '#')
			return false ;
	}
	return true ; 
}

void solve() {

	cin >> n >>a >> b >>c >> d ; 
	a--;b--;c--;d--;
	//string s ; 
	cin >> s ; 
	bool ans= dfs(a,c) && dfs(b,d) ; 
	if(c < d) {
		cout << (ans ? "Yes" : "No") ; 
	} else {
		bool ok = false  ; 
		int cnt = 0 ;
		for(int i = b  ; i < min(d+1, n-1 ) ; ++i) {
			if(s[i-1] == '.' && s[i] == '.' && s[i+1] == '.') {
				ok = true ; 
				break ; 
			}
		}
		if(ok) 
			cout << (ans ? "Yes" : "No" ); 
		else 
			cout << "No" ; 
	}
}

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



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

int main(){
	int n;
	while(cin >> n){
		if(n > 36){
			cout << "0" << endl;
		} else {
			int count = 0;
			for(int a = 0; a < 10; a++){
				if((n - a >= 0) && (n - a <= 27)){
					for(int b = 0; b < 10; b++){
						if((n - a - b >= 0) && (n - a - b <= 18)){
							for(int c = 0; c < 10; c++){
								if((n - a - b - c >= 0) && (n - a - b - c <= 9))
									count++;
							}
						}
					}
				}
			}
			cout << count << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 0
package main

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

// input scanner
var sc = bufio.NewScanner(os.Stdin)

const (
	initialBufSize = 10e4
	maxBufSize     = 10e6
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInt64() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

// util
func max(l []int) (int, int) {
	idx := 0
	ans := l[idx]
	for i, n := range l {
		if n > ans {
			idx = i
			ans = n
		}
	}
	return idx, ans
}

func min(l []int) (int, int) {
	idx := 0
	ans := l[idx]
	for i, n := range l {
		if n < ans {
			idx = i
			ans = n
		}
	}
	return idx, ans
}

func combi(n int, k int) int {
	a := 1
	b := 1
	for i := 0; i < k; i++ {
		a *= n - i
		b *= (k - i)
	}
	return a / b
}

func check(s string, k int) bool {
	l := len(s)
	var c int
	for i := 0; i < l; i++ {
		a, _ := strconv.Atoi(s[i : i+1])
		if a != 0 {
			c++
		}
		if c > k {
			return false
		}
	}
	if c == k {
		return true
	}
	return false
}

func run(s string, k int) int {
	l := len(s)
	dp := make([][]int, l)
	dpm := make([][]int, l)
	a := make([]int, l)
	for i := 0; i < l; i++ {
		a[i], _ = strconv.Atoi(s[i : i+1])
		dp[i] = make([]int, 3+1)
		dpm[i] = make([]int, 3+1)
	}
	// init
	dp[0][0] = 0
	dp[0][1] = a[0]
	dp[0][2] = 0
	dp[0][3] = 0

	for i := 1; i < l; i++ {
		for j := 1; j <= 3; j++ {
			if j == 1 {
				dp[i][j] = dp[i-1][j] + 9
			} else {
				if dp[i-1][j-1] == 0 {
					dp[i][j] = 0
				} else if check(s[0:i], j-1) {
					dp[i][j] = dp[i-1][j] + dp[i-1][j-1]*9 - (9 - a[i])
				} else {
					dp[i][j] = dp[i-1][j] + dp[i-1][j-1]*9
				}
			}
		}
	}
	return dp[l-1][k]
}

// main
func main() {
	buf := make([]byte, initialBufSize)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords)
	s := next()
	k := nextInt()
	fmt.Println(run(s, k))
}


Measured memory_bytes: 640
#include "bits/stdc++.h"
using namespace std;
typedef uint64_t ulong;
typedef int64_t slong;
typedef uint32_t uint;

int main() {
    //freopen("../input.txt", "r", stdin);
    //freopen("../output.txt", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    int n;
    cin >> n;
    int arr[2][n];
    int dp[2][n];
    for (int i = 0; i < 2; ++i) {
        for (int j = 0; j < n; ++j) {
            cin >> arr[i][j];
            int mx = 0;
            if (i) mx = max(mx, dp[i - 1][j]);
            if (j) mx = max(mx, dp[i][j - 1]);
            dp[i][j] = arr[i][j] + mx;
        }
    }
    //cout << dp[0][0] << '\n';
    cout << dp[1][n - 1];

    return 0;
}


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



int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    ll s=0;
    ll a;
    for(int i=1;i<=n;i++){
        cin>>a;
        if(a&1 && i&1)s++;
    }cout<<s;
}


Measured memory_bytes: 3576
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+5,maxm=2e5+5;
int fa[maxn],d[maxn],n,m,x,y,z;
inline int get(int u)
{
	if(u==fa[u])return u;
	int f=get(fa[u]);
	d[u]+=d[fa[u]];
	return fa[u]=f;
}

int main()
{
	while(~scanf("%d%d",&n,&m))
	{
		for(int i=1;i<=n;++i)fa[i]=i,d[i]=0;
		bool ok=1;
		for(int i=1;i<=m;++i)
		{
			scanf("%d%d%d",&x,&y,&z);
			if(!ok)continue;
			int fx=get(x),fy=get(y);
			if(fx==fy)
			{
				if(d[y]-d[x]!=z)ok=0;
			}
			else
			{
				fa[fy]=fx;
				d[fy]=d[x]+z-d[y];
			}
		}
		printf("%s\n",ok?"Yes":"No");
	}
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()
// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return;std::cout << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class X> void DEBUG(X d, T e){if(DEBUG_OUT == false)return;std::cout <<d<<" ";DEBUG(e);};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }


//FUNCTION  


void solve(void)
{
  int N;
  cin>>N;
  int XOR = 0;
  for (int i = 0; i < N; i++)
  {
    int A;
    cin>>A;
    XOR ^= A;
  }
  if(XOR == 0)
  {
    cout<<"Yes"<<endl;
  }
  else
  {
    cout<<"No"<<endl;
  }
  
  
  
  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


Measured memory_bytes: 256
<?php

class Operator
{
    private $operations;
    private $operations_count;

    public function doOperations()
    {
        fscanf(STDIN, '%d', $this->operations_count);
        $this->operations = new \SplDoublyLinkedList();
        for (;$this->operations_count > 0;$this->operations_count -= 1) {
            $word = trim(fgets(STDIN));
            if ($word[0] === 'i') {
                $this->operations->unshift(substr($word, 7));
            } elseif ($word[6] === 'F') {
                $this->operations->shift();
            } elseif ($word[6] === 'L') {
                $this->operations->pop();
            } else {
                foreach ($this->operations as $key => $element) {
                    if ($element === substr($word, 7)) {
                        $this->operations->offsetUnset($key);
                        break;
                    }
                }
            }
            // $this->operations_count -= 1;
        }
    }

    public function getAnswer()
    {
        while (1) {
            if (count($this->operations) > 0) {
                $keys_operated[] = $this->operations->shift();
            } else {
                break;
            }
        }
        echo implode(' ', $keys_operated), PHP_EOL;
    }
}

$operator = new Operator();
$operator->doOperations();
$operator->getAnswer();



Measured memory_bytes: 136152
#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>



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

  int n;
  cin>>n;
  vi b(n-1);
  rep(i,n-1){
    cin>>b[i];
  }

  vi a(n,-inf);
  a[0]=b[0];
  a[1]=b[0];

  FOR(i,1,n-1){
    if(a[i]>b[i]) a[i]=b[i];
    a[i+1]=b[i];
  }

  int ans=0;
  rep(i,n){
    ans+=a[i];
  }

  cout<<ans<<endl;


}

Measured memory_bytes: 256
n, l = map(int, input().split())
c = []
t = []

for i in range(n):
    p = input().split()
    c.append(int(p[0]))
    t.append(int(p[1]))

args = []
for i in range(n):
    if t[i] <= l:
        args.append(i)

possibleTimes = []
for i in args:
    possibleTimes.append(c[i])

print("TLE" if possibleTimes == [] else min(possibleTimes))


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

#define ll long long
#define ld double
#define vl vector<ll>
#define vb vector<bool>
#define vs vector<string>
#define pb push_back
#define mp make_pair
#define sc(a) scanf("%lld",&a);
#define sd(a) scanf("%lf",&a);
#define test() ll tt;cin>>tt;for(ll testcase=1;testcase<=tt;testcase++)
#define all(v) v.begin(),v.end()
#define vivek_ghosh ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX 1000055
#define mod 1000000007
#define ff first
#define ss second
const int INF=0x3f3f3f3f;

ll power(ll x,ll n,ll M)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)
        return power((x*x)%M,n/2,M);
    else
        return (x*power((x*x)%M,(n-1)/2,M))%M;
}

ll modinv(ll a,ll m)
{
    ll g =__gcd(a, m);
    ll res=power(a, m-2, m);
    return res;
}

vb prime(MAX,true);
vl prm;
void sieve()
{
	prime[0] = prime[1] = false;
	for(ll p=2;p*p<MAX;p++)
	{
		if(prime[p])
		{
			for(ll i=p*p;i<MAX;i+=p)
				prime[i] = false;
		}
	}
	for(ll p=2;p<MAX;p++)
	{
		if(prime[p])
			prm.pb(p);
	}
}

ll n,m,t,i,j,k,q,x,y,ans=0,cnt=0,sum=0,mx=-1,mn=INT_MAX;
string s;


int main()
{
	vivek_ghosh;
	
	cin>>s;
	ll len=s.size();
	for(i=0;i<len-1;i++)
	{
		if(s[i]==s[i+1])
		{
			cout<<"Bad"<<endl;
			return 0;
		}
	}
	cout<<"Good"<<endl;
	
	
	
	
	
	
	
	
	
	
	return 0;
}




Measured memory_bytes: 384
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;

import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;


public class Main {
	
	public static void main(String[] args) throws IOException {	
		try(final Scanner sc = new Scanner(System.in)){
			final int TYPES = 26;
			final int D = sc.nextInt();
			
			int[] cs = new int[TYPES];
			for(int i = 0; i < TYPES; i++) {
				cs[i] = sc.nextInt();
			}
			
			int[][] ss = new int[D][TYPES]; 
			for(int i = 0; i < D; i++) {
				for(int j = 0; j < TYPES; j++) {
					ss[i][j] = sc.nextInt();
				}
			}
			
			for(int i = 0; i < D; i++) {
				System.out.println((i % TYPES) + 1);
			}
			
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

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

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

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

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}


Measured memory_bytes: 36792
import sys
sys.setrecursionlimit(100000)

N, M = [int(x) for x in input().split()]

# Union Find
# N = 100
PARENT = list(range(N))

def root(n):
    if PARENT[n] == n:
        return n
    else:
        ret = root(PARENT[n])
        PARENT[n] = ret
        return ret

def same(n1, n2):
    return root(n1) == root(n2)

def unite(n1, n2):
    n1 = root(n1)
    n2 = root(n2)
    if n1 == n2:
        return
    PARENT[n1] = n2

used = set()

for i in range(M):
    x, y, z = [int(x) for x in input().split()]
    x -= 1
    y -= 1
    unite(x, y)

cnt = 0
for i,p in enumerate(PARENT):
    if root(p) == i:
        cnt += 1
print(cnt)


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

class Program
{
	static void Main(string[] args)
	{
		int N,n;
		string s,S1 = "",S2 = "";
		N = int.Parse(Console.ReadLine());
		s = Console.ReadLine();
		if(N % 2 == 1)
		{
			Console.Write("No");
		}
		else
		{
			n = (N / 2) - 1;
			for(int i = 0;i <= n;i++)
			{
				S1 = S1 + s[i];
				S2 = S2 + s[i + (n + 1)];
            }
			if (S1 == S2) Console.Write("Yes");
			else Console.Write("No");
		}
		Console.ReadKey();
	}
}



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

#define f first
#define s second
using namespace std;
typedef long long ll;
const ll minn=-1e9;
const ll limit = 1e6+2;
pair <ll,ll> a[limit];
pair <ll,ll> b[limit];
long long t,n,k,temp=0,m,res=0,tp,mp,op,check=1,lp,d=0,s,w;

int main()
{
    cin>>s>>w;
    if(s>w) cout<<"safe";else cout<<"unsafe";
}


Measured memory_bytes: 3596
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;



int main(){
  int n;
  vector<int> vals;
  int res = 0;
  cin >> n;
  for (int i=0; i < n; i++){
    int j;
    cin >> j;
    vals.push_back(j);
  }

  for(int i=0; i<vals.size(); i++){
    for(int j=i+1; j<vals.size(); j++){
      res += vals[i]* vals[j];
    }
  }

  cout<<res<<endl;

  return 0;
}

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

const int INF = 1e9;

int main() {
  int n;
  cin>>n;
  string s[n];
  for(int i=0;i<n;i++)cin>>s[i];
  long long a[5];
  for(int i=0;i<5;i++)a[i]=0;
  for(int i=0;i<n;i++){
    if(s[i][0]=='M'){
      a[0]+=1;
    }
    if(s[i][0]=='A'){
      a[1]+=1;
    }
    if(s[i][0]=='R'){
      a[2]+=1;
    }
    if(s[i][0]=='C'){
      a[3]+=1;
    }
    if(s[i][0]=='H'){
      a[4]+=1;
    }
  }

  long long sum=a[0]+a[1]+a[2]+a[3]+a[4];
  if(sum<3){
    cout<<"0"<<endl;
    return 0;
  }
  long long ans = sum*(sum-1)*(sum-2)/6;
  for(int i=0;i<5;i++){
    if(a[i]>1){
      ans = ans - a[i]*(a[i]-1)*(sum-a[i])/2;
    }
    if(a[i]>2){
      ans = ans - a[i]*(a[i]-1)*(a[i]-2)/6;
    }
  }
  cout<<ans<<endl;

}

Measured memory_bytes: 6144
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(){
    int N, D, X;
    cin >> N >> D >> X;
    int A[N];
    int count = 0;
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }
    for(int i = 0; i < N; i++){
        for(int j = 1; j <= D; j+=A[i]){
            count++;
        }
    }
    cout << count + X << endl;
    return 0;
}

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

using namespace std;

#define ll long long

int main()
{
	const int N = 100000;
	int n;
	string s;
	//string t;
	//string j;
	char first[4][3] = {"SS", "SW", "WS", "WW"};

	cin >> n;
	cin >> s;

	string t(n, 'a');
	string j(n, 'a');
	// 最初の2匹を決めれば、他の配置は自ずと決まる
	for (int k = 0; k < 4; k++) {
		t[0] = first[k][0];
		t[1] = first[k][1];
		for (int i = 1; i < n - 1; i++) {
			j[i] = s[i];
			if (t[i] == 'S') {
				if (j[i] == 'o') {
					t[i + 1] = t[i - 1];
				} else {
					if (t[i - 1] == 'S') t[i + 1] = 'W';
					else t[i + 1] = 'S';
				}
			} else {
				if (j[i] == 'x') {
					t[i + 1] = t[i - 1];
				} else {
					if (t[i - 1] == 'S') t[i + 1] = 'W';
					else t[i + 1] = 'S';
				}
			}
		}
		if (t[n - 1] == 'S') {
			if (t[n - 2] == t[0]) j[n - 1] = 'o';
			else j[n - 1] = 'x';
		} else {
			if (t[n - 2] == t[0]) j[n - 1] = 'x';
			else j[n - 1] = 'o';
		}
		if (t[0] == 'S') {
			if (t[n - 1] == t[1]) j[0] = 'o';
			else j[0] = 'x';
		} else {
			if (t[n - 1] == t[1]) j[0] = 'x';
			else j[0] = 'o';
		}
		//cout << j << endl;
		if (j == s) {
			cout << t << endl;
			//printf("%s\n", t);
			return (0);
		}
	}
	cout << "-1" << endl;

	return (0);
}

Measured memory_bytes: 640
s=input()
from collections import deque
ans=0
d=deque()
d.append(s[0])
for i in range(len(s)-1): 
    for j in range(len(d)):
        tmp=d.popleft()
        d.append(tmp+"+"+s[i+1])
        d.append(tmp+s[i+1])
for i in range(len(d)):
    tmp=d.popleft()
    ans+=sum(list(map(int, tmp.split("+"))))
    # print(tmp.split("+"))
print(ans)

Measured memory_bytes: 38896
#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 repr(i,n) for(int i=(n);i>=0;--i)
#define int long long
#define itn int
#define pb push_back
#define m_p make_pair
#define m_t make_tuple
#define p_p(a,b) pb(m_p(a,b))
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(all(a));reverse(all(a))
#define UNIQUE(a) a.erase(unique(all(a)),a.end())
#define SZ(a) a.size()
#define ENDL cout<<endl
#define debg(a) cout<<#a<<" "<<a<<endl
#define debgp(a) cout<<#a<<" "<<a.fi<<" "<<a,se<<endl
#define call(a) for(auto i:a)cout<<i<<" ";cout<<endl
#define show(a) for(const auto&y:a){for(const auto&x:y)cout<<x<<" ";cout<<endl;}
#define out(a) cout<<(a)<<endl
#define fi first
#define se second
#define Vec vector
#define P pair
typedef long long ll;
typedef string str;
typedef vector<ll> V;
typedef vector<vector<ll>> VV;
typedef pair<ll,ll> Pi;
typedef vector<Pi> VP;
typedef tuple<ll,ll,ll,ll> Tuple;
const long long INF = 1LL<<60;
const long long MOD = 1e9+7;
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;}
void Yes(){cout<<"Yes"<<endl;}
void No(){cout<<"No"<<endl;}
void YN(bool b){cout<<(b?"Yes":"No")<<endl;}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int H,W;
  cin>>H>>W;
  VV a(H,V(W));
  rep(i,H)rep(j,W)cin>>a[i][j];

  vector<Tuple> ans;
  rep(i,H){
    rep(j,W-1){
      if(a[i][j]&1){
        a[i][j]--;
        a[i][j+1]++;
        ans.pb(m_t(i,j,i,j+1));
      }
    }
  }
  rep(i,H-1){
    if(a[i][W-1]&1){
      a[i][W-1]--;
      a[i+1][W-1]++;
      ans.pb(m_t(i,W-1,i+1,W-1));
    }
  }
  //show(a);
  cout<<(ll)ans.size()<<endl;
  for(auto&t:ans){
    ll a,b,c,d;
    tie(a,b,c,d)=t;
    a++;b++;c++;d++;
    printf("%lld %lld %lld %lld\n",a,b,c,d);
  }
  
  
  
  return 0;
}


Measured memory_bytes: 8432
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author NikuKyabe
 */

#include "bits/stdc++.h"
using namespace std;


class ALphabet {
public:
	void solve(std::istream& in, std::ostream& out) {
    char a;
    in >> a;
    if(a >= 'a'){
      out << "a" << endl;
    }
    else{
      out << "A" << endl;
    }
	}
};


signed main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cout << fixed;
	ALphabet solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3596
#!/usr/bin/env python3
import sys

MOD = 998244353  # type: int


class ModOperator:
    def __init__(self, MOD: int = 10 ** 9 + 7):
        self.MOD = MOD
        self.factorials = [1, 1]

    # x^n % MOD
    def mod_pow(self, x: int, n: int):
        bi = str(format(n, "b"))
        res = 1
        a = x
        for i in range(len(bi)):
            if n >> i & 1:
                res = (res * a) % self.MOD
            a = (a * a) % self.MOD
        return res
    
    # x! % MOD
    def mod_fact(self, x: int):
        if x < len(self.factorials):
            return self.factorials[x]
        else:
            res = self.factorials[-1]
            for i in range(len(self.factorials), x + 1):
                res = res * i % self.MOD
                self.factorials.append(res)
        return res % self.MOD

    # inverse of a number
    def mod_inv(self, x: int):
        return self.mod_pow(x, self.MOD - 2)
    
    # conmination nCk
    def mod_comb(self, n: int, k: int):
        numerator = self.mod_fact(n)
        denomintator1 = self.mod_fact(k)
        denomintator2 = self.mod_fact(n - k)
        denomintator = denomintator1 * denomintator2 % self.MOD
        return numerator * self.mod_inv(denomintator) % self.MOD

def main():
    N, M, K = map(int, input().split())

    op = ModOperator(MOD)
    sum = 0
    for i in range(K + 1):
        sum += M * op.mod_pow(M - 1, N - 1 - i) * op.mod_comb(N - 1, i)
    print(sum % MOD)


if __name__ == '__main__':
    main()


Measured memory_bytes: 80904
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

//binary search

int main(){
  ios::sync_with_stdio(false);
  int M, N;
  vector<int> u, v;

  //input
  cin >> M;
  for(int i = 0; i < M; ++i){
    int m;
    cin >> m;
    u.push_back(m);
  }

  cin >> N;
  for(int i = 0; i < N; ++i){
    int n;
    cin >> n;
    v.push_back(n);
  }

  //calc
  int res = 0;

  // vector<int>& l = (M >= N ? u : v);
  // vector<int>& s = (M >= N ? v : u);  
  vector<int>& l = u;
  vector<int>& s = v;

  for(auto x : s){
    // if(find(l.begin(), l.end(), x) != l.end()){
    //   ++res;
    // }
    bool found_flg = false;
    int bgn = 0;
    int end = l.size();
    while(bgn < end){
      int mid = (bgn+end)/2;
      if (l[mid] > x){
	end = mid;
      }
      else if (l[mid] < x){
	bgn = mid + 1;
      }
      else{ // l[mid] == x
	found_flg = true;
	break;
      }
    }
    if(found_flg) ++res;
  }
  
  cout << res << endl;
}

Measured memory_bytes: 1812
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

n = int(input())
# print(f"{n}")

ans = 0
for i in range(1, n + 1):
    if i % 2 == 0:
        continue
    
    # d_count = sympy.divisor_count(i)
    a = make_divisors(i)
    # print(f"{i} {a}")
    d_count = len(a)
    # print(f"{i} {d_count}")
    if d_count == 8:
        ans += 1
print(ans)

Measured memory_bytes: 9324
a,b=gets.split.map &:to_i
require 'prime'
aps=a.prime_division
a_prime=Array.new
a_prime << 1
aps.each do |ap|
    a_prime << ap[0]
end
bps=b.prime_division
b_prime=Array.new
b_prime << 1
bps.each do |bp|
    b_prime << bp[0]
end

com=Array.new
a_prime.each do |i|
    if b_prime.include?(i)
        com << i
    end
end

puts com.size

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

int main() {
  string S;
  cin >> S;
  
  if(S=="SUN")
    cout << 7 << endl;
  if(S=="MON")
    cout << 6 << endl;
  if(S=="TUE")
    cout << 5 << endl; 
  if(S=="WED")
    cout << 4 << endl;
  if(S=="THU")
    cout << 3 << endl;
  if(S=="FRI")
    cout << 2 << endl;
  if(S=="SAT")
    cout << 1 << endl;
}


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

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int Q=in();
	set<int> S;
	int num=0;
	REP(i,Q){
		int q=in();
		if(q==1){
			out(S.find(in())==S.end()?0:1);
		}
		else{
			auto res = S.insert(in());
			if(res.second) num++;
			out(num);
		}
	}
	return 0;
}


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

namespace abc090_b
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            int a = int.Parse(str[0]);
            int b = int.Parse(str[1]);
            int sum = 0;
            for(int i = a; i <= b; i++)
            {
                string word = i.ToString();
                if (word.Substring(0,1)==word.Substring(4,1)&&word.Substring(1,1)==word.Substring(3,1))
                {
                    sum++;
                }
            }
            Console.WriteLine(sum);
        }
    }
}


Measured memory_bytes: 34832
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <stack>
#include <map>
const int MOD = 1e9+7;
#define PI 3.14159265359
typedef long long ll;
using namespace std;

ll fact[100001];

ll modpow(ll a, ll n){
	ll res = 1;
	while (n > 0){
		if (n & 1) res = res * a % MOD;
		a = a * a % MOD;
		n >>= 1;
	}
	return res;
}

ll modinv(ll a){
	return modpow(a, MOD-2);
}

ll nCr(ll n , ll r){
	return ((fact[n]*modinv(fact[n-r]))%MOD*modinv(fact[r]))%MOD;
}

int main(){
	ll n, k;
	cin >> n >> k;
	fact[0] = 1;
	for (int i = 1; i <= 100000; i++){
		fact[i] = fact[i-1]*i%MOD;
	}
	for (int i = 1; i <= k; i++){
		if (n - k < i - 1){
			cout << 0 << endl;
		}else{
			ll hoge = nCr(k-1, i-1);
			hoge *= (fact[n-k-(i-1)+i]*modinv(fact[n-k-(i-1)])%MOD)*modinv(fact[i])%MOD;
			hoge %= MOD;
			cout << hoge << endl;
		}
	}
	return  0;
}

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

int main(void){
    int n;
    cin >> n;
    int q[n];
    string s[n];
    int p[n];
    for(int i=0; i < n; i++) q[i] = i+1;
    for(int i=0; i < n; i++) cin >> s[i] >> p[i];
    
    for(int i=0; i < n-1; i++){
        for(int j=i+1; j < n; j++){
            int temp;
            string temp2;
            if(s[i] > s[j]){
                temp = q[i];
                q[i] = q[j];
                q[j] = temp;
                temp2 = s[i];
                s[i] = s[j];
                s[j] = temp2;
                temp = p[i];
                p[i] = p[j];
                p[j] = temp;
            }
        }
    }
    for(int i=0; i < n-1; i++){
        for(int j=i+1; j < n; j++){
            int temp;
            string temp2;
            if(s[i] == s[j]){
                if(p[i] < p[j]){
                    temp = q[i];
                    q[i] = q[j];
                    q[j] = temp;
                    temp2 = s[i];
                    s[i] = s[j];
                    s[j] = temp2;
                    temp = p[i];
                    p[i] = p[j];
                    p[j] = temp;
                }
            }
        }
    }

    for(int i=0; i < n; i++) cout << q[i] << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}



int main(){
  int a,b;
  cin >> a >> b ;
  if(a==1 && b==1){
    cout << 1000000 << endl;
    return 0;
  }
  else{
    int sum=0;
    if(a==1) sum+=300000;
    if(a==2) sum+=200000;
    if(a==3) sum+=100000;
    if(b==1) sum+=300000;
    if(b==2) sum+=200000;
    if(b==3) sum+=100000;
    cout << sum << endl;
  }
 
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for(ll i = 0; i < n; i++)
using namespace std;
int dy[4] = { 1, 0, -1, 0 }, dx[4] = { 0, 1, 0, -1 };
const ll MOD = 1e9 + 7;
const ll INF = 1e9;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int x, a;
  cin >> x >> a;
  if (x < a) cout << 0 << endl;
  else cout << 10 << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll n,k;
    cin>>n>>k;
    vector<ll> a(n);
    for(int i=0;i<n;i++)cin>>a.at(i);
    ll cnt=0;
    while((ll)(1LL<<cnt)<=k)cnt++;
    cnt--;
    ll res=0;
    for(int i=cnt;i>=0;i--){
        if(res+(1LL<<i)>k)continue;
        ll mask1=0,mask0=0;
        for(int j=0;j<n;j++){
            if(a.at(j)&(1LL<<i))mask1++;
            else mask0++;
        }
        if(mask1<mask0)res+=(ll)(1LL<<i);
    }
    ll ans=0;
    for(int i=0;i<n;i++)ans+=(a.at(i)^res);
    cout<<ans<<endl;
}


Measured memory_bytes: 1024
#include <iostream>
#define N 123457*2

using namespace std;

int main(void){
	int n,i,j,f,first,last;
	int prime[N]={0};
	prime[0]=2;
	for (i=3;i<=N;i++){
		for(j=0;prime[j];j++) if(i%prime[j] == 0) break;
		if(!prime[j])prime[j]=i;
	}
	while(cin>>n,n){
		for(j=0;;j++) if(n < prime[j]){first=j; break;}
	        for(j--;;j++) if(2*n < prime[j]){last=j; break;}
	      	cout<<last-first<<endl;
	}
	return 0;
}

Measured memory_bytes: 1716
import java.util.*

fun main(args: Array<String>) {
	val scanner = Scanner(System.`in`)
	val n = scanner.nextLong()
	val xyhList = mutableListOf<Triple<Long, Long, Long>>().apply {
		for (i in 1..n)
			add(Triple(scanner.nextLong(), scanner.nextLong(), scanner.nextLong()))
	}.toList()
	mutableListOf<Triple<Long, Long, Long>>().apply {
		for (ifcx in 0L..100L)
			for (ifcy in 0L..100L) {
				val firstxyh = xyhList.first { it.third != 0L }
				val maybeh: Long = Math.abs(ifcx - firstxyh.first) + Math.abs(ifcy - firstxyh.second) + firstxyh.third
				if (xyhList.all { xyh ->
							xyh.third == Math.max(maybeh - Math.abs(ifcx - xyh.first) - Math.abs(ifcy - xyh.second), 0)
						})
					add(Triple(ifcx, ifcy, maybeh))
			}
	}.minBy { it.third }!!
			.let { println("${it.first} ${it.second} ${it.third}") }
}

Measured memory_bytes: 33324
#include<stdio.h>
#include <stdlib.h>
int main(void){
int a,b,c,d;
int d1,d2,d3;
//aはAさんがいる位置
//ｂはBさんがいる位置
//ｃはCさんがいる位置
//c-aがー２ｄ以上２ｄ以下の時に会話できる
scanf ("%d %d %d %d",&a,&b,&c,&d);
d1 = a-b;
d2 = b-c;
d3 = c-a;
if (abs(d3) <= d){
    printf("Yes\n");
 }
else if (abs(d3) > d && abs(d2) <= d && abs(d1) <= d){
    printf("Yes\n");
 }
else {
    printf ("No\n");
}

 return 0;
}

Measured memory_bytes: 128
N,X,Y=map(int,input().split())
A=[]
for i in range(N-1):
    A.append([-1]*(N-1-i))

Ndmin=[0]*(N-1)
for i in range(N-1):
    for j in range(i+1,N):
        Ndmin[min(j-i,abs(X-i-1)+1+abs(Y-j-1),abs(X-j-1)+1+abs(Y-i-1))-1]+=1

for k in range(N-1):
    print(Ndmin[k])

Measured memory_bytes: 62684
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
 
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

    int A, B, K; cin >> A >> B >> K;
    int cnt = 0;
    rep1(i,__gcd(A, B) + 1) {
        if(__gcd(A,B) % i == 0) cnt++;
        if (cnt == K) {
            cout << __gcd(A,B) / i << endl;
            break;
        }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
const ll mod=1000000007;
const ll INF=1e18;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define U_ERASE(V) V.erase(unique(ALL(V)), V.end());
#define pb push_back
#define mp make_pair
typedef pair<ll,ll> P;
vec dx={1,0,-1,0};
vec dy={0,1,0,-1};


int main(){
    ll N,K; cin>>N>>K;
    ll zero=0;
    vec sei,fu;
    rep(i,N){
        ll x; cin>>x;
        if(x<0) fu.pb(-x);
        if(x==0) zero++;
        if(x>0) sei.pb(x);
    }
    sort(ALL(sei));
    sort(ALL(fu));

    ll S=sei.size(), F=fu.size();
    if(K<=S*F){
        ll mK=S*F-K+1;
        ll OK=INF, NG=0;
        while(OK>NG+1){
            ll MID=(OK+NG)/2;
            ll kari=0;
            rep(i,S){
                ll A=MID/sei.at(i);
                kari+=(upper_bound(ALL(fu),A)-fu.begin());
            }
            if(kari>=mK) OK=MID;
            else NG=MID;
        }
        cout<<-OK<<endl;
    }

    else if(K<=(S*F)+(S+F)*zero+((zero-1)*zero)/2) cout<<0<<endl;
    else{
        K-=((S*F)+(S+F)*zero+((zero-1)*zero)/2);
        //cout<<K<<endl;
        ll OK=INF, NG=0;
        while(OK>NG+1){
            ll MID=(OK+NG)/2;
            ll kari=0;
            rep(i,S){
                if(sei.at(i)*sei.at(i)>=MID) break;
                ll A=MID/sei.at(i);
                
                kari+=((upper_bound(ALL(sei),A)-sei.begin())-(1+i));
            }
            rep(i,F){
                if(fu.at(i)*fu.at(i)>=MID) break;
                ll A=MID/fu.at(i);
                
                kari+=((upper_bound(ALL(fu),A)-fu.begin())-(1+i));
            }
            //cout<<kari<<' '<<MID<<endl;

            if(kari>=K) OK=MID;
            else NG=MID;
        }
        cout<<OK<<endl;
    }

}

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

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

  vector<int> d(n);
  for (auto &i : d) cin >> i;

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

  cout << d.size() << endl;
}


Measured memory_bytes: 256