akhauriyash/Code-Regression huggingface dataset:
#[allow(unused_imports)]
use std::io::{stdout, Write, BufWriter};
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
//#[allow(unused_imports)]
//use proconio::marker::{Isize1, Usize1, Bytes, Chars};

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}
 
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
 
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}
 
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
 
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
 
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
 
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
 
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
//#[proconio::fastout]
fn main() {
    input!{
        n: usize,
        h: [u64; n],
    }
    let mut ans = 0;
    let mut tmp = 0;
    for i in 0..(n - 1) {
        if h[i] >= h[i + 1] {
            tmp += 1;
            if i == n - 2 { ans = max(ans, tmp); }
        } else {
            ans = max(ans, tmp);
            tmp = 0;
        }
    }
    println!("{}", ans);
}


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

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	if (a == b &&a== c&&b==c)
		cout << 1;
	else if (a == b && a != c || a == c && a != b || b == c && b != a)
		cout << 2;
	else
		cout << 3;

}

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

S = 0
S_min = 100000000000000

for i in range(101):
    for j in X:
        S += (j - i)**2
        
    if S < S_min:
        S_min = S
        S = 0
    else:
        S = 0
print(S_min)

Measured memory_bytes: 3060
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

namespace AtCoderABC114
{
    class Program
    {
        public static List<long> GetL(long x)
        {
            if (x > 100000000) return new List<long>();
            List<long> l1 = new List<long>();
            List<long> l2 = new List<long>();
            List<long> l3 = new List<long>();
            l1.Add(10 * x + 3);
            l1 = l1.Concat(GetL(10 * x + 3)).ToList();
            l2.Add(10 * x + 5);
            l2 = l2.Concat(GetL(10 * x + 5)).ToList();
            l3.Add(10 * x + 7);
            l3 = l3.Concat(GetL(10 * x + 7)).ToList();
            return l1.Concat(l2).Concat(l3).ToList();
        }

        public static bool Judge(long x)
        {
            string s = Convert.ToString(x, 10);
            return s.Contains("7") && s.Contains("5") && s.Contains("3");
        }

        public static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());
            List<long> l = GetL(0).OrderBy(x => x).ToList();
            long res = 0;
            for (int i = 0; i < l.Count && l[i] <= N; i++)
            {
                if (Judge(l[i])) res++;
            }
            Console.WriteLine(res);
        }
    }
}

Measured memory_bytes: 23628
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        if(x == 3 || x == 5 || x == 7){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }
}

Measured memory_bytes: 21844
#include <iostream>
#include <cstdio>

using namespace std;

int main() {
  int x = 0;
  int max = 0;
  char s[101];
  int n;
  cin >> n >> s;

  for (int i = 0; i < n; i++) {
    if (s[i] == 'I') {
      x++;
      if (x > max)
        max = x;
    } else {
      x--;
    }
  }

  cout << max << "\n";

  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <cmath>
#include <tuple>
#include <map>
#include <unordered_map>
#include <deque>
#include <queue>
using namespace std;
typedef long long ll;

int main(int argc, char *argv[])
{
	ll i;
	ll n, k;
	cin >> n >> k;
	vector<ll> dest(n);
	int curr;
	ll loopsize = -1;
	unordered_map<int, ll> visited;
	for (i = 0; i < n; i++) {
		cin >> dest[i];
		dest[i]--;
	}

	curr = 0;
	visited[curr] = 0;
	for (i = 1; i <= k; i++) {
		// cout << curr << "->" << dest[curr] << endl;
		curr = dest[curr];
		if (loopsize == -1) { 
			if (visited.find(curr) == visited.end())
				visited[curr] = i;
			else {
				loopsize = i - visited[curr];
				i = k - (k - i) % loopsize;
			}
		}
	}	

	cout << curr + 1 << endl;
	return 0;
}


Measured memory_bytes: 11912
class TreeNode:
    def __init__(self, val):
        self.val = val
        self.left = None
        self.right = None


class BinarySearchTree:
    def __init__(self):
        self.root = None

    def insert(self, val):
        if not self.root:
            self.root = TreeNode(val)
        else:
            parent = None
            cur = self.root
            while cur:
                parent = cur
                if val < cur.val:
                    cur = cur.left
                elif cur.val < val:
                    cur = cur.right

            if val < parent.val:
                parent.left = TreeNode(val)
            elif parent.val < val:
                parent.right = TreeNode(val)

    def remove(self, val):
        self._remove(self.root, val, None)

    def _remove(self, node, val, parent):
        if not node:
            return
        elif val < node.val:
            self._remove(node.left, val, node)
        elif node.val < val:
            self._remove(node.right, val, node)
        else:
            if node.left and node.right:
                # Find min value from right sub-tree
                cur = node.right
                while cur.left:
                    cur = cur.left
                node.val = cur.val
                self._remove(node.right, cur.val, node)
            elif node.left:
                if parent.left == node:
                    parent.left = node.left
                elif parent.right == node:
                    parent.right = node.left
            elif node.right:
                if parent.left == node:
                    parent.left = node.right
                elif parent.right == node:
                    parent.right = node.right
            else:
                if parent.left == node:
                    parent.left = None
                elif parent.right == node:
                    parent.right = None


def inorder(node):
    if node:
        res = []
        res += inorder(node.left)
        res.append(node.val)
        res += inorder(node.right)
        return res
    else:
        return []


def preorder(node):
    if node:
        res = [node.val]
        res += preorder(node.left)
        res += preorder(node.right)
        return res
    else:
        return []


if __name__ == '__main__':
    n = int(input())
    bst = BinarySearchTree()
    for _ in range(n):
        op = input().split()
        if len(op) == 2:
            bst.insert(int(op[1]))
        else:
            for x in inorder(bst.root):
                print(f' {x}', end='')
            print()
            for x in preorder(bst.root):
                print(f' {x}', end='')
            print()


Measured memory_bytes: 115396
M = 1000000007

N, K = [int(s) for s in input().split()]

A = [0] + [0 for _ in range(1, K+1)]
for k in range(K, 0, -1):
    if k * 2 > K:
        A[k] = 1
    else:
        A[k] = pow(K // k, N, M)
        i = 2
        while k * i <= K:
            A[k] -= A[k * i]
            i += 1

S = 0
for k in range(1, K+1):
    S = (S + A[k] * k) % M

print(S)


Measured memory_bytes: 11276
#include<iostream>
#include<stdio.h>
using namespace std;

int main() {
	int paper[14][14] = {0};
	int x,y,size;
	
	while ( scanf("%d,%d,%d",&x,&y,&size) != EOF ) {
		for ( int i = -2; i <= 2; i++ ) {
			for ( int j = -2; j <= 2; j++ ) {
				if ( i*i + j*j > 4 &&(  y != 0 ||  x != 0)){
					continue;
				}
				if ( size < 3 ) {
					if ( size < 2 && i*i + j*j > 1 ){
						continue;
					}
					if ( i * i > 1 || j * j > 1 ){
						continue;
					}
				}
				paper[x+2+i][y+2+j]++;
			}
		}
	}
	
	int zero=0,max=0;
	for ( int i = 2; i < 12; i++ ) {
		for ( int j = 2; j < 12; j++ ) {
			if ( paper[i][j] == 0 )	zero++;
			if ( max < paper[i][j] )	max = paper[i][j];
		}
	}
	cout << zero << endl << max << endl;
	
	return 0;
}

Measured memory_bytes: 1208
#include <stdio.h>

int main() {
    int wide, high;
    int x, y, r;
    
    scanf("%d %d %d %d %d", &wide, &high, &x, &y, &r);
    
    if(x - r < 0 || x + r > wide) {
        printf("No\n");
    }
    else if(y - r < 0 || y + r > high) {
        printf("No\n");
    }
    else{
        printf("Yes\n");
    }
    
    return 0;
}


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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    REP(i, n) cin >> a[i];
    a.erase(unique(a.begin(), a.end()), a.end());
    int i = 1;
    int ans = 1;
    while(i < a.size() - 1) {
        if(a[i] < min(a[i - 1], a[i + 1]) || a[i] > max(a[i - 1], a[i + 1])) {
            ans++;
            i++;
        }
        i++;
    }
    cout << ans << endl;
}


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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define PI 3.14159265358979
#define MOD 1000000007 // = 10^9 + 7

using namespace std;
using ll = long long;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
} C(200010);

void solve()
{
	int n, m, k;
  cin >> n >> m >> k;
  mint ans = 0;

  for(int i = 0; i <= k; ++i)
  {
    mint ans_tmp = m;
    mint m1 = m - 1;
    ans_tmp *= m1.pow(n - i - 1);
    ans_tmp *= C(n - 1, n - i - 1);

    ans += ans_tmp;
  }

  // n=4 i=1 321 : 3321 3221 3211
  // n=5 i=2 321 : 33221 33211 32211 + 33321 32221 32111
  // 321 -> 3321 -> 33321 33221 33211
  // 321 -> 3221 -> 33221 32221 32211
  // 321 -> 3211 -> 33211 32211 32111
  // n=6 i=3 321 : 332211 333321 322221 321111
  cout << ans;

}

int main()
{
	fastio;
	solve();

	return 0;
}

Measured memory_bytes: 6232
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Spandan Mishra
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        GoldenCoins solver = new GoldenCoins();
        solver.solve(1, in, out);
        out.close();
    }

    static class GoldenCoins {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int x = in.readInt();
            System.out.println(x / 500 * 1000 + (x % 500) / 5 * 5);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new RuntimeException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new RuntimeException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}



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

using namespace std;

int main()
{
  vector<int> v;
  bool positive = false, negative = false, zero = false;
  int n,l,j=0,sum = 0;
 	
  cin>>n>>l;
  for(int i=1;i<=n;i++)
  {
    int k = l+i-1;
    if(k>0)
      positive = true;
    else if(k<0)
      negative = true;
    else
      zero = true;
    sum += k;
  	v.push_back(k); 
  }
  if((positive && negative) || zero)
    cout<<sum<<endl;
  else if(positive)
  {
    int min = 9999;
    for(int i=0;i<n;i++)
    {
      if(v[i] < min)
        min = v[i];
    }
    cout<<sum-min<<endl;
  }
  else
  {
    int max = -9999;
    for(int i=0;i<n;i++)
    {
      if(v[i]>max)
        max = v[i];
    }
    cout<<sum-max<<endl;
  }
    
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define endl '\n'
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const ll mod = 1000000007;
const double PI = 3.141592653589793238463;
const int N=1e5+1;
int main()
{
    FASTINOUT;
    int x,y;
    ll c=0;
    cin>>x>>y;
    for (int i=1;i<=y-x;i++)
        c+=i;
    cout<<c-y<<endl;
    return 0;
}


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

using namespace std;
using ll = long long;

//cout << std::fixed << std::setprecision(15) << y << endl;

int main() {
    int n = 0;
    string s = "";
    cin >> n >> s;
     vector<char> v(n);
    for(int i = 0;i < n;i++){
        v[i] = s[i];
    }
    v.erase(unique(v.begin(),v.end()),v.end());
    cout << v.size() << endl;
    return 0;
}

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

using namespace std;

typedef long long int ll;

#define mod (int ) (1e9+7)



ll gcd(ll a, ll b){
	
	if(b==0){
		return a;
	}
	
	return gcd(b, a%b);
	
}


 
 ll ncr(ll x, ll y){
 	ll ans=1;
 	
 	y=(y > x-y? x-y: y);
 	
 	for(ll i=0; i<y; i++){
 		ans=ans*(x-i);
 		ans=ans/(i+1);
 		ans=ans%mod;
 	}
 
 	
 	return ans;
 }

ll power(ll x, ll y){
    ll ans=1;
    while(y){
        if(y&1){
            ans=ans*x;
            ans=ans%mod;
        }
        
        x=x*x;
        x=x%mod;
        y=y>>1;
    }
    
    return ans;
    
}
 
void solve(){
	
   ll n; cin>>n;
   
   ll arr[n],dup[n],m,ans=0;
   
   for(int i=0; i<n; i++){
   	  cin>>arr[i];
   }
   
   dup[0]=arr[0];
   
   m=arr[0];
   
   for(int i=1; i<n; i++){
   	  m=max(m,arr[i]);
   	  dup[i]=m;
   	 // cout<<dup[i]-arr[i]<<"\n";
   	  ans+=dup[i]-arr[i];
   }
   
   cout<<ans<<"\n";
  
   return ;
	
}

int main(){
    ios_base::sync_with_stdio(0);
    
    cin.tie(0);
    
    int t=1,h=0; //cin>>t;
    
    
    // clock_t begin, end;
    
    // double time_spent;
    
    // begin = clock(); // Time taken till now.
    
    
    while(t--){
    
	  solve();
        
    }
   
   //end= clock(); // Total  Time taken till now.
   
   //time_spent= (end- begin) / CLOCKS_PER_SEC;
   
   //cout<<time_spent<<"\n";
	
	return 0;
}

Measured memory_bytes: 6732
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<math.h>
using namespace std;
#define N (1000000000+7)
#define INF 1e16
typedef pair<int,int> P;
typedef long long ll;

ll sum[100010];

int main(void){
    ll n;
    cin>>n;
    vector<ll>a(n+1);
    for(int i=0;i<n;i++)cin>>a[i+1];
    sum[0]=0;
    a[0]=0;
    sort(a.begin(),a.end());
    for(int i=0;i<n;i++){
        sum[i+1]=sum[i]+a[i+1];
    }
    ll ans=1;
    for(int i=n-1;i>=1;i--){
        //cout<<sum[i]<<" "<<a[i+1]<<endl;
        if(2*sum[i]>=a[i+1])ans++;
        else break;
    }
    cout<<ans<<endl;
    return 0;
}

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

int k[2020],f[2000005],a[2000005],g[2000005];
ll sum;

int main()
{
	string s;
	cin>>s;
	int n=s.size();
	for(int i=0; i<n; i++)
		a[i+1]=s[i]-48;
	
	int l=1;
	for(int i=n; i>=1; i--)
	{
		g[i]=l;
		l*=10;
		l%=2019;
	}
	
	for(int i=n; i>=1; i--)
	{
		f[i]=(f[i+1]+a[i]*g[i])%2019;
		k[f[i]]++;
	}
	
	sum=k[0];
	sum+=(k[0]*(k[0]-1)/2);
	
	for(int i=1; i<=2018; i++)
		sum+=(k[i]*(k[i]-1)/2);
	
	cout<<sum<< endl;
	return 0;
}


Measured memory_bytes: 6076
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define brep(index,num) for(int index=num-1;index>=0;index--)
#define brep1(index,num) for(int index=num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int N;
	scan(N);
	rep1(i,9){
		rep1(j,9){
			if(i*j==N){
				prin("Yes");
				return 0;
			}
		}
	}
	prin("No");
	return 0;
}


Measured memory_bytes: 256
/*
    ##############################
    #  Author: Pratyush Gaurav   #
    #  College: NIT ROURKELA     #
    ##############################
*/
#include <bits/stdc++.h>

using namespace std;

typedef long long lli;
typedef long double ld;
typedef pair<lli, lli > plli;
typedef vector<lli> vlli;
typedef vector<plli > vplli;

#define IOS ios_base::sync_with_stdio(false);
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a * b) / gcd(a, b))
#define sqr(x) (x)*(x)
#define all(a) a.begin(),a.end()
#define UN(v) sort(all(v)), v.resize(unique(all(v))-v.begin())

#define endl '\n'

const long long INF = 100000000000000000;
const long long MOD = 1000000007;
const long long MAXN = 100005;

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

lli n;
lli a[MAXN], dp[MAXN];

lli f(lli x) {
    if (x > n) return INF;
    if (x == n) return 0;
    if (dp[x] != -1) return dp[x];

    lli ans = INF;
    for (int i = 1; i <= 2; ++i) {
        ans = min(ans, abs(a[x] - a[x + i]) + f(x + i));
    }
    return dp[x] = ans;
}
void solve() {
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
    }
    memset(dp, -1, sizeof(dp));
    lli ans = f(1);
    cout << ans << endl;
}

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

    solve();

    return 0;
}

Measured memory_bytes: 4992
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<vector>
#include<deque>
#include<queue>

using std::cout;
using std::cin;
using std::setw;
using std::setfill;
using std::string;
using std::pair;
using std::make_pair;
using std::vector;
using std::queue;
using std::deque;
using std::priority_queue;
using std::next_permutation;
//using std::iota;
using std::sort;
using std::greater;
using std::max;
using std::min;

using lli = long long int;
using ulli = unsigned long long int;

#define INF 999999999;

#define EVEL 1

#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";
#else
#define dbug(X) {}
#define dbugf(s) {}
#define dbugln {}
#endif

ulli N;
vector<ulli> A;
ulli ins;
ulli valm = 0, val=0;
ulli preval=0, valn = 0;
ulli m, n;

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

	cin >> N;
	for(ulli i = 0; i < N; i++){
		cin >> ins;
		A.push_back(ins);
	}
	sort(A.begin(), A.end(), greater<ulli>());
	m = A[0];n=A[1];
	for(ulli i = 0; i < N-1; i++){
		for(ulli j = i+1; j < N; j++){
			dbug(A[i])dbug(A[j])dbugln;
			valn = min(A[j], A[i]-A[j]);
			val = max(val, valn);
			dbug(valn)dbugln;
			if(val > preval) preval = val;
			else break;

			if(valm >= A[i]) break;

			if(val > valm){
				m = A[i];n = A[j];
				valm = val;
				dbug(m)dbug(n)dbugln;
			}else if((val = valm) && (m < A[i])){
				m = A[i];n = A[j];
				dbug(m)dbug(n)dbugln;
			}
		}
		preval = 0;
	}

	cout << m << " " << n << "\n";

	return 0;
}


Measured memory_bytes: 1400
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,sum=0;
    cin>>a;
    b=a;
    while(a!=0)
    {
        sum=sum+(a%10);
        a=a/10;
    }
    if(b%sum==0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}



Measured memory_bytes: 256
import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
    }
    
    Scanner sc;
    BigInteger A;
    BigInteger B;
    String answer = null;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        A = sc.nextBigInteger();
        B = sc.nextBigInteger();
    }
    
    //解答処理
    String solve() {
        if (A.compareTo(B) > 0){    //AがBより多い場合は正の値
            answer = "GREATER";
        } else if (A.compareTo(B) < 0){    //AがBより多い場合は負の値
            answer = "LESS";
        } else {
            answer = "EQUAL";
        }

        return answer;
    }
    
    //出力
    void show(String answer) {
        System.out.println(answer);
    }
}

Measured memory_bytes: 36028
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;++i)
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
typedef pair<ll,ll> P;

int main(){
    int n; cin >>n;
    int a,b; cin >> a >> b;
    cout<< min(n*a,b);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define INF 1000000000
#define LLINF 10000000000000000ll
#define MOD 1000000007

bool dbgflag = false; //debug

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

  int h, w;
  cin >> h >> w;
  vector<vector<int>> adjlist(10, vector<int>(10));

  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      cin >> adjlist[i][j];
    }
  }

  for (int k = 0; k < 10; k++) {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < 10; j++) {
        adjlist[i][j] = min(adjlist[i][j], adjlist[i][k] + adjlist[k][j]);
      }
    }
  }
  if (dbgflag) cout << "warshallfloyd" << endl;

  int cost = 0;
  //vector<vector<int>> wall(h, vector<int>(w));
  /*for (int i = 0; i < w*h; i++) {
    int a;
    cin >> a;
    cost += adjlist[a][1];
  }*/
  if (dbgflag) cout << h << " " << w << endl;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      int a;
      cin >> a;
      if (a == -1) continue;
      cost += adjlist[a][1];
    }
  }

  cout << cost << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <algorithm>
using namespace std;

int main()
{
  set<string> words;

  int n;
  cin >> n;

  vector<string> blue;
  for(int i = 0; i < n; ++i) {
    string tmp;
    cin >> tmp;
    blue.push_back(tmp);
    words.insert(tmp);
  }

  int m;
  cin >> m;

  vector<string> red;
  for(int i = 0; i < m; ++i) {
    string tmp;
    cin >> tmp;
    red.push_back(tmp);
    words.insert(tmp);
  }

  int max = 0;
  for(auto it = cbegin(words); it != cend(words); ++it) {
    int money = 0;
    money += count(cbegin(blue), cend(blue), *it);
    money -= count(cbegin(red), cend(red), *it);

    if(money > max) {
      max = money;
    }
  }

  cout << max << endl;
}


Measured memory_bytes: 256
import sys

n, k = map(int, raw_input().split(" "))
h = sorted(map(int, raw_input().split(" ")), reverse=True)

l = 0
r = len(h)-1
i = -1
while l<=r:
    i = (l+r)/2
    if k > h[i]:
        r = i-1
    elif k < h[i]:
        l = i+1
    else:
        break

while i<len(h) and h[i] >= k:
    i += 1

print i


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

void read(int &x) {
    x=0;int f=1;char ch=getchar();
    for(;!isdigit(ch);ch=getchar()) if(ch=='-') f=-f;
    for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';x*=f;
}

void print(int x) {
    if(x<0) putchar('-'),x=-x;
    if(!x) return ;print(x/10),putchar(x%10+48);
}
void write(int x) {if(!x) putchar('0');else print(x);putchar('\n');}

#define lf double
#define ll long long 

#define pii pair<int,int >
#define vec vector<int >

#define pb push_back
#define mp make_pair
#define fr first
#define sc second

#define data asd09123jdf02i3h

#define FOR(i,l,r) for(int i=l,i##_r=r;i<=i##_r;i++)

const int maxn = 5e3+10;
const int inf = 1e9;
const lf eps = 1e-8;
const int mod = 1e9+7;

int f[maxn][maxn],n;

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

int vis[maxn][maxn];

void del(int i,int j) {
    queue<pii > q;vis[i][j]=0,q.push(mp(i,j));
    while(!q.empty()) {
        int i=q.front().fr,j=q.front().sc;q.pop();
        if(i<1||i>n||j<1||j>n) continue;
        for(int t=0;t<4;t++)
            if(f[i][j]+vis[i][j]<f[i+dx[t]][j+dy[t]]) {
                q.push(mp(i+dx[t],j+dy[t]));
                f[i+dx[t]][j+dy[t]]=f[i][j]+vis[i][j];
            }
    }
}

int main() {
    read(n);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++) f[i][j]=min(min(i-1,j-1),min(n-i,n-j)),vis[i][j]=1;
    int ans=0;
    for(int t=1;t<=n*n;t++) {
        int x;read(x);
        int i=(x-1)/n+1,j=(x-1)%n+1;
        ans+=f[i][j],del(i,j);
    }
    write(ans);
    return 0;
}


Measured memory_bytes: 9596
<?php

$s = rtrim(fgets(STDIN));
$s = explode(' ', $s);

$hash = array();
$max = '';
$mode = $s[0];
foreach ($s as $w) {
    if (!isset($hash[$w])) {
        $hash[$w] = 0;
    }
    $hash[$w]++;
    if ($hash[$w] > $hash[$mode]) {
        $mode = $w;
    }
    if (strlen($w) > strlen($max)) {
        $max = $w;
    }
}

echo sprintf('%s %s', $mode, $max);
echo PHP_EOL;

Measured memory_bytes: 6632
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define pb(x) push_back(x)
#define eb(x,y) emplace_back(x,y)
#define MOD 1000000007
#define MAX 1000000001
#define INF 1410065408
#define EPS 1e-9
#define DEBUG 0
 
using namespace std;
typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> Pii;
struct edge{int from, to; ll cost;};

//'z' - 'A'で57

vector<int> a[58];

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

    int n;
    cin >> n;
    string s[2];
    cin >> s[0] >> s[1];
    /*
    repp(j, n){
        if(s[0][j] == s[1][j]) continue;
        a[(int)(s[0][j] - 'A')].pb((int)(s[1][j] - 'A'));
        a[(int)(s[1][j] - 'A')].pb((int)(s[0][j] - 'A'));
    }
    rep(2){
        repp(j, n-1){
            if(s[i][j] != s[i][j+1]){
                a[(int)(s[i][j] - 'A')].pb((int)(s[i][j+1] - 'A'));
            }
        }
    }*/


    ll ans;
    int i;
    if(s[0][0] == s[1][0]){
        ans = 3;
        i = 1;
    }else{
        ans = 6;
        i = 2;
    }
    while(i < n){
        if(s[0][i] == s[1][i]){
            if(s[0][i-1] == s[1][i-1]){
                ans *= 2;
            }else{
                ans *= 1;
            }
            i += 1;
        }else{
            if(s[0][i-1] == s[1][i-1]){
                ans *= 2;
            }else{
                ans *= 3;
            }
            i += 2;
        }
        ans %= MOD;
    }

    cout << ans;
  
}


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

#ifdef __WIN32
#define LLFORMAT "I64"
#else
#define LLFORMAT "ll"
#endif

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<int> x(n), y(n), a(n);
	for (int i = 0; i < n; ++i) cin >> x[i] >> y[i] >> a[i];
	int N = 1 << n;
	vector<double> dp(N, 0.);
	for (int s = 1; s < N; ++s) {
		double tot = 0;
		int cnt = 0;
		vector<pair<double, pair<int, int> > > E;
		vector<int> par(n);
		for (int u = 0; u < n; ++u) if((s >> u) & 1) {
			++cnt;
			par[u] = u;
			tot += a[u];
			for (int v = 0; v < u; ++v) if((s >> v) & 1) E.push_back(make_pair(hypot(x[u] - x[v], y[u] - y[v]), make_pair(u, v)));
		}
		function<int(int)> F = [&](int u) { return par[u] == u ? u : par[u] = F(par[u]); };
		sort(E.begin(), E.end());
		for (auto e: E) {
			int u = e.second.first, v = e.second.second;
			if(F(u) != F(v)) {
				par[F(u)] = F(v);
				tot -= e.first;
			}
		}
		dp[s] = tot / (double) cnt;
		for (int t = (s - 1 & s); t; t = (t - 1 & s)) dp[s] = max(dp[s], min(dp[t], dp[s ^ t]));
	}
	cout << setiosflags(ios::fixed) << setprecision(12) << dp[N - 1] << endl;
	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
//using namespace __gnu_pbds;
#define rep(i,a,b) for(i=(a);i<=(b);i++)
#define ll long long
#define pll pair<ll, ll>
#define pii pair<int,int>
#define pb push_back
#define F first
#define S second
#define mod 1000000007
#define maxn 100005
#define inf 1e18
#define boost ios::sync_with_stdio(false);cin.tie(0)
#define fr freopen("source.txt","r",stdin),freopen("output.txt","w",stdout)
#define SET(a,b) memset(a,b,sizeof(a))
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) x.begin(), x.end()
#define ps(x,y) fixed<<setprecision(y)<<x
//template<typename T>
//using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
template<class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a) {
	return out <<  "(" << a.F << ", " << a.S << ")";
}
 
template<class A> ostream& operator << (ostream& out, const vector<A> &a) {
	out << "[";
	for (auto it = a.begin(); it != a.end(); ++it) {
		if (it != a.begin())
			out << ", ";
		out << *it;
	}
	return out << "]";
}
int main()
{
    boost;
    ll n,i,j,x,t,y,m,k;
	cin>>n>>m>>k;
	ll a[n][m],sum=0;
	string s[n];
	for(i=0;i<n;i++) cin>>s[i];
	for(i=0;i<n;i++){
		for(j=0;j<m;j++) {
			a[i][j]=s[i][j]-'0';
			sum+=a[i][j];
		}
	}
	if(sum<=k){
		cout<<0;
		return 0;
	}
	ll ans=inf;
	for(i=0;i<(1<<n);i++){
		vector<ll>v;
		ll temp=0;
		for(j=0;j<n;j++){
			if(i&(1<<j)) v.pb(j);
		}
		if(v.empty()) continue;
		//sort(all(v));
		if(v.back()==n-1) v.pop_back();
		temp+=v.size();
		ll start=0;
		v.pb(n-1);
		vector<ll>cnt(v.size(),0);
		bool ok=1;
		for(j=0;j<m;j++){
			vector<ll>vv;
			for(ll c=0;c<v.size();c++){
				ll cur=0;
				ll start,end;
				if(c==0) start=0;
				else start=v[c-1]+1;
				end=v[c];
				for(ll r=start;r<=end;r++){
					cur+=a[r][j];
				}
				if(cur>k) {
					ok=0;
					break;
				}
				vv.pb(cur);
			}
			if(!ok) break;
			for(ll c=0;c<v.size();c++){
				if(cnt[c]+vv[c]>k){
					temp++;
					cnt=vv;
					break;
				}
				else cnt[c]+=vv[c];
			}
		}
		if(ok) ans=min(ans,temp);
	}
	cout<<ans;
}

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

int main() {
	int N;
	cin >> N;
	int *a = new int[N];
	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}
	int j = 1;
	for (int i = 1; i <= N; i++) {
		j = a[j-1];
		if (j == 2) {
			cout << i << endl;
			return 0;
		}
	}
	cout << -1 << endl;
	return 0;
}


Measured memory_bytes: 640
#include <atcoder/all>
#include <bits/stdc++.h>
typedef long long int lld;
typedef unsigned long long int llu;
#define INF (lld)(9223372036854775807)
#define IINF (int)(2147483647)

using namespace std;
using namespace atcoder;

lld maxl(lld a, lld b) {
  return a >= b ? a : b;
}

lld e() {
  return 0;
}

int main(void) {
  lld n, k;
  cin >> n >> k;
  segtree<lld, maxl, e> s(300002);
  for (lld i = 0; i < n; i++) {
    lld a;
    cin >> a;
    lld m = s.prod(max(a - k, 0ll), min(a + k + 1, 300001ll)) + 1;
    lld c = s.get(a);
    if (m > c) {
      s.set(a, m);
    }
  }
  cout << s.all_prod() << "\n";
}

Measured memory_bytes: 13780
// tsukasa_diary's programing contest code template
#include <bits/stdc++.h>
using namespace std;
// define
#define for_(i,a,b) for(int i=a;i<b;++i)
#define for_rev(i,a,b) for(int i=a;i>=b;--i)
#define allof(a) a.begin(),a.end()
#define minit(a,b) memset(a,b,sizeof(a))
#define size_of(a) (int)a.size()
// typedef
typedef long long lint;
typedef double Double;
typedef pair<int, int> pii;
//
typedef vector< int > Array;
typedef vector< Array > Matrix;
typedef vector< Double > DArray;
typedef vector< DArray > DMatrix;
typedef vector< string > SArray;
typedef vector< pii > PArray;
// popcount
inline int POPCNT(int _x) { return __builtin_popcount(_x); }
inline int POPCNT(lint _x) { return __builtin_popcountll(_x); }
// inf
const int iINF = 1L << 30;
const lint lINF = 1LL << 60;
// eps
Double EPS = 1e-9;
// in range
inline bool in_range(int _v, int _mx, int _mi) { return _mi <= _v && _v < _mx; }
inline bool in_range(Double _v, Double _mi, Double _mx) { return -EPS < _v - _mi && _v - _mx < EPS; }
inline bool in_range(int _x, int _y, int _W, int _H) { return 0 <= _x && _x < _W && 0 <= _y && _y < _H; }
// neighbor clockwise
const int DX[4] = {0,1,0,-1}, DY[4] = {-1,0,1,0};
const int DX_[8] = {0,1,1,1,0,-1,-1,-1}, DY_[8] = {-1,-1,0,1,1,1,0,-1};
// variable update
inline void modAdd(int& _a, int _b, int _m) { _a = (_a + _b) % _m; }
inline void modAdd(lint& _a, lint _b, lint _m) { _a = (_a + _b) % _m; }
inline void minUpdate(int& _a, int _b) { _a = min(_a, _b); }
inline void minUpdate(lint& _a, lint _b) { _a = min(_a, _b); }
inline void maxUpdate(int& _a, int _b) { _a = max(_a, _b); }
inline void maxUpdate(lint& _a, lint _b) { _a = max(_a, _b); }

int n;

void rec(Array& v, int sum) {
	if (sum > n) return;
	
	int len = size_of(v);
	
	if (sum == n) {
		for_(i,0,len) {
			if (i < len - 1) cout << v[i] << " ";
			else cout << v[i] << endl;
		}
		return;
	}

	for_rev(i,n,1) {
		if (len > 0 && v[len - 1] < i) continue;
		v.push_back(i);
		rec(v, sum + i);
		v.pop_back();
	}
}

void solve() {
	Array v;
	rec(v, 0);
}

int main() {
	while (cin >> n, n) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 1220
#pragma region
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue> 
#include <stack>
#include <set>
#include <list>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define all(x) x.begin(),x.end()
#pragma endregion


int main()
{
	int n; cin >> n;
	int x = 800 * n;
	int y = (n / 15) * 200;
	cout << x - y << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i,n) for(ll i = 0;i < n;++i)
    map<string,int> memo;
int main(){
    int n,k;
    cin >> n >> k;
    map<int,int> a;
    rep(i,k){
        int d;
        cin >> d;
        rep(i,d){
            int x;
            cin >> x;
            a[x] = 1;
        }
    }
    int ans = 0;
    rep(i,n){
        if(!a.count(i+1)){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define REP(i, a, n) for (long long i = (a); i < (long long)(n); ++i)
#define REPC(i, a, n) for (long long i = (a); i <= (long long)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define MATINIT(type, row, col, init)                                          \
  vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout << (cond ? "Yes" : "No") << endl;
#define YES(cond) cout << (cond ? "YES" : "NO") << endl;
using namespace std;
using LL = long long;
using ULL = unsigned long long;
template <class T> using VEC = std::vector<T>;
template <class T> using MAT = std::vector<std::vector<T>>;
void DUMP() { cerr << endl; }
template <class Head, class... Tail> void DUMP(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  DUMP(std::move(tail)...);
}
template <typename T> ostream &operator<<(ostream &os, vector<T> &vec) {
  os << "{";
  for (auto v : vec)
    os << v << ",";
  os << "}";
  return os;
}
template <typename T> ostream &operator<<(ostream &os, set<T> &s) {
  os << "{";
  for (auto p : s)
    os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, map<T1, T2> &m) {
  os << "{";
  for (auto p : m)
    os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
  os << "[" << p.first << " " << p.second << "]";
  return os;
}

int main() {
  int N;
  cin>>N;
  VEC<LL>B(N,0);
  VEC<LL>A(N);
  REP(i,0,N-1){cin>>B[i];}
  A[0]=B[0];
  REP(i,1,N-1){
    A[i]=min(B[i],B[i-1]);
  }
  A[N-1]=B[N-2];
  // DUMP(A);
  LL sum =0;
  REP(i,0,N){sum+=A[i];}
  cout<<sum<<endl;

  return 0;
}


Measured memory_bytes: 256
N = int(input())
l = sorted(map(int, input().split()))
j, K = -1, 0

for i in range(N):
    if j != l[i]:
        j = l[i]
        a, b = i, N-i
        
        if a == b:
            K += 1
            
            if i:
                K += l[i]-l[i-1]-1

print(K)

Measured memory_bytes: 14396
#include<iostream>
using namespace std;
#define rep(i, n) for ( int i = 0; i < n; i++)
#define MAX 13

int G[MAX][MAX], N, C;
bool V[MAX][MAX];
static int di[6] = {0, -1, -1, 0, 1, 1};
static int dj[6] = {1, 1, 0, -1, -1, 0};
int cnt;
bool hasZero;

void dfs( int i, int j, int id ){
    V[i][j] = true;
    int ni, nj;
    cnt++;
    rep(r, 6){
	if (G[i+di[r]][j+dj[r]] == 0 ) hasZero = true;
    }
    rep(r, 6){
	ni = i+di[r];
	nj = j+dj[r];
	if ( G[ni][nj] == id && !V[ni][nj] ) dfs(ni, nj, id);
    }
}

int getScore(){
    rep(i, N+2) rep(j, N+2) V[i][j] = false;
    int score = 0;
    for ( int i = 1; i <= N; i++ ){
	for ( int j = 1; j <= N-i+1; j++ ) {
	    if ( G[i][j] > 0 && !V[i][j] ){
		hasZero = false;
		cnt = 0;
		dfs(i, j, G[i][j]);
		if ( !hasZero){
		    if ( G[i][j] == C ) score -= cnt;
		    else score += cnt;
		}
	    }
	}
    }
    return score;
}

void compute(){
    int ans = -1000;
    for ( int i = 1; i <= N; i++ ){
	for ( int j = 1; j <= N-i+1; j++ ) {
	    if ( G[i][j] == 0 ){
		G[i][j] = C;
		ans = max(ans, getScore());
		G[i][j] = 0;
	    }
	}
    }
    cout << ans << endl;
}

main(){
    while( cin >> N >> C && N && C ){
	rep(i, N+3) rep(j, N+3)G[i][j] = 10;
	for ( int i = 1; i <= N; i++ ){
	    for ( int j = 1; j <= i; j++ ){
		cin >> G[i-j+1][j];
	    }
	}
	
	compute();
    }
}

Measured memory_bytes: 0
#include <stdio.h>
int main(){
  int a,b,c,d,r=-1;
  scanf("%d%d%d%d",&a,&b,&c,&d);
  for(int i=0;i<=100;i++)if(a<=i&&i<=b&&c<=i&&i<=d)r++;
  if(r==-1)r=0;
  printf("%d",r);
  return 0;
}

Measured memory_bytes: 128
//小数点以下　cout << fixed << setprecision(10) << num << endl;
//桁数はlog10(mid)でやれ　log(mid)/log(10)はWA
//long*long<0で判定するな
//開区間と閉区間
//アルファベットが何番目かは x=s[i]-'a'
//bfsはmain()内で　rep(i,h)rep(j,w)rep(i,4)でバグ
//切り上げ：(a+(b-1))/b
//32bit以上は 1ull<<j
// map 初期値0 for(auto itr=mp.begin();itr!=mp.end();++itr) itr->fi itr->se で全探索
// for(auto u:mp) u.fi u.se も可能
//n個のgcd,lcmは一つずつみて更新していく
//大きな数を扱うときは素因数分解した形で持っておく
// (l/a[i]) = l*powmod(a[i],MOD-2)%MOD;
//auto itr=lower_bound(ALL(a),key) a[itr-a.begin()]
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional> //operator[]
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
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;}
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;

signed main(){
    int a,b,c; cin >> a >> b >> c;
    if(a<=c&&c<=b) cout << "Yes";
    else cout << "No";
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <set>
#define mm(i,v) memset(i,v,sizeof i);
using namespace std;
typedef long long ll;
const int mod=1e9+7;
int w,a,b;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int ans;
	cin>>w>>a>>b;
	if(b+w<a)
		ans=a-(b+w);
	if(a+w<b)
		ans=b-a-w;
	cout<<ans<<"\n";
	return 0;
}



Measured memory_bytes: 256
x,n = input().split()
x=int(x)
n=int(n)
list=input().split()
for i in range(0, len(list)):
    list[i] = int(list[i])
diff = 200
for i in range(-1, 102):
    if i not in list and abs(i-x) < diff:
        diff = abs(i-x)
        ans = i
print(ans)

Measured memory_bytes: 9148
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.lang.Math;

public class Main {
    public static void main(String[] args) {
        FS reader = new FS();
        // write reader
        int A = reader.nextInt();
        int B = reader.nextInt();

        int ans = 0;
        int tmp = 1;
        while (tmp < B) {
            tmp += A-1;
            ans++;
        }
        System.out.println(ans);
    }
    
    public static void solver() {
        // write logic
    }
    
    // Read Class
    static class FS {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
    
        private int readByte() { return hasNextByte() ? buffer[ptr++] : -1;}
        private boolean isPrintableChar(int c) {return 33 <= c && c <= 126;}
        private void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public int nextInt() {
            return (int)nextLong();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while(true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if(b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }
    }
}



Measured memory_bytes: 22864
def Stack(order_list):
    cal_list = []
    for content in order_list:
        if content == "+":
            b = cal_list.pop()
            a = cal_list.pop()
            cal_list.append(a+b)
        elif content == "-":
            b = cal_list.pop()
            a = cal_list.pop()
            cal_list.append(a-b)
        elif content == "*":
            b = cal_list.pop()
            a = cal_list.pop()
            cal_list.append(a*b)
        else:
            cal_list.append(int(content))
            
    return cal_list[0]
    
order_list = input().split()
ans = Stack(order_list)
print(ans)


Measured memory_bytes: 5600
n,m = map(int,input().split())
ac = [0] * n
wrong = [0] * n
seitou = 0
pena = 0
for i in range(m):
         p,s = input().split()
         p = int(p)
         if ac[p-1] == 0:
                  if s == "AC":
                           ac[p-1] = 1
                  else:
                           wrong[p-1] += 1
seitou = sum(ac)
for i in range(n):
         if ac[i] == 1:
                  pena += wrong[i]
print(seitou,pena)


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

#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define deb(x)	cout << #x << " " << x << endl;

typedef long long int ll;

int main() {

	IOS

	string s, t;
	cin >> s >> t;

	int mn = INT_MAX, c;

	for (int i = 0; i < s.size() - t.size() + 1; i++) {
		c = 0;

		for (int j = 0; j < t.size(); j++) {
			if (s[i + j] != t[j])
				c++;
		}

		mn = min(mn, c);
	}

	cout << mn;

	return 0;
}

Measured memory_bytes: 3652
using System;
namespace aizu
{
    class OnlineJudge
    {
        static readonly int MaxSize = 10;
        static void Main()
        {
            string input;
            System.Collections.Generic.Stack<int> stack = new System.Collections.Generic.Stack<int>(MaxSize);
            while((input = Console.ReadLine()) != null){
                int number;
                if(int.TryParse(input, out number) == false){
                    continue;
                }
                if(number == 0){
                    Console.WriteLine(stack.Pop());
                }
                else{
                    stack.Push(number);
                }
            }
        }
    }
}

Measured memory_bytes: 5904