akhauriyash/Code-Regression huggingface dataset:
/*
██████╗  ███████╗  
██╔══██╗ ██╔════╝ 
██████╔╝ ███████╗ 
██╔══██╗ ╚════██║  
██║  ██║ ███████║      
╚═╝  ╚═╝ ╚══════╝                                                                                                             
*/

#include<bits/stdc++.h>
using namespace std;
 
#define ll long long int
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define haha(j,a,n) for(int j=a;j<n;j++)
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define endl "\n"
#define bc(v) v.begin(),v.end()
#define vl vector<ll>
#define vi vector<int>
#define mod 1000000007
#define NUM 100005
#define F first
#define S second
#define bhar(a) rep(i,a.size()) cin>>a[i];
#define show(a) rep(i,a.size()) cout<<a[i]<<" ";
#define sott(a) sort(bc(a))
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define mapp map<ll,ll>
#define dkac cout<<fixed<<setprecision(15);
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define yeah(n) while(n--)
ll gcd(int a, int b){if(b==0) return a; else return gcd(b,a%b);}
ll bitfun(ll x){
  return (x&(-x));
}
void solve(){
  long double x; cin>>x;
  ll p=100,t=100;
  ll ans=1;
  while(p< x){
    ll z= p*(0.01);
    p+=z;
    ans++;
  }
  cout<<ans-1;
}
int main(){
    ios
    int t=1; 
    //cin>>t;
    yeah(t){
      solve();
    }
}

Measured memory_bytes: 3744
n = int(input())
h = list(map(int, input().split()))
cnt = 0
  
for i in range(n-1):
  if h[i] - h[i+1] >= 2:
    print('No')
    exit()
  elif h[i] - h[i+1] == 1:
    cnt += -1
  elif h[i] - h[i+1] <= -1:
    cnt = 0
  if cnt == -2:
    print('No')
    exit()
    
    
print('Yes')





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

using namespace std;

int main() {
	double a, b, c, d, e, f;
	double x, y;
	while (cin >> a >> b >> c >> d >> e >> f) {
		x = (c * e - b * f) / (a * e - b * d);
		y = (c - a * x) / b;
		printf("%.3lf %.3lf\n", (x == -0)?0:x, (y == -0)?0:y);
	}
	return 0;
}

Measured memory_bytes: 1224
//μ's forever
#include <bits/stdc++.h>
#define N 200005
#define mod 924844033
#define G 5
#define getchar nc
using namespace std;
inline char nc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
inline int read()
{
    register int x=0,f=1;register char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
    return x*f;
}
inline void write(register int x)
{
    if(!x)putchar('0');if(x<0)x=-x,putchar('-');
    static int sta[20];register int tot=0;
    while(x)sta[tot++]=x%10,x/=10;
    while(tot)putchar(sta[--tot]+48);
}
int n;
struct node{
    int to,nxt;
}e[N<<1];
int head[N],ecnt;
inline void add(register int u,register int v)
{
    e[++ecnt]=(node){v,head[u]};
    head[u]=ecnt;
}
inline int power(register int a,register int b)
{
    int res=1;
    while(b)
    {
        if(b&1)
            res=1ll*res*a%mod;
        a=1ll*a*a%mod;
        b>>=1;
    }
    return res;
}
int cnt[N],siz[N];
inline void dfs(register int x,register int fa)
{
    siz[x]=1;
    for(register int i=head[x];i;i=e[i].nxt)
    {
        int v=e[i].to;
        if(v==fa)
            continue;
        dfs(v,x);
        siz[x]+=siz[v];
        ++cnt[siz[v]];
    }
    ++cnt[n-siz[x]];
}
int fac[N],invf[N];
inline int C(register int n,register int m)
{
    return 1ll*fac[n]*invf[m]%mod*invf[n-m]%mod;
}
int f[N<<2],g[N<<2],r[N<<2];
inline void NTT(register int *a,register int len,register int f)
{
    for(register int i=0;i<len;++i)
        if(i<r[i])
            swap(a[i],a[r[i]]);
    for(register int i=1;i<len;i<<=1)
    {
        int T=power(G,(mod-1)/(i<<1));
        if(f==-1)
            T=power(T,mod-2);
        for(register int j=0;j<len;j+=(i<<1))
        {
            int t=1;
            for(register int k=0;k<i;++k,t=1ll*t*T%mod)
            {
                int Nx=a[j+k],Ny=1ll*t*a[i+j+k]%mod;
                a[j+k]=(0ll+Nx+Ny)%mod;
                a[i+j+k]=(0ll+Nx-Ny+mod)%mod;
            }
        }
    }
    if(f==-1)
    {
        int inv=power(len,mod-2);
        for(register int i=0;i<len;++i)
            a[i]=1ll*a[i]*inv%mod;
    }
}
int main()
{
    n=read();
    for(register int i=1;i<n;++i)
    {
        int u=read(),v=read();
        add(u,v),add(v,u);
    }
    dfs(1,0);
    fac[0]=1;
    for(register int i=1;i<=n;++i)
        fac[i]=1ll*fac[i-1]*i%mod;
    invf[n]=power(fac[n],mod-2);
    for(register int i=n-1;i>=0;--i)
        invf[i]=1ll*invf[i+1]*(i+1)%mod;
    for(register int i=0;i<=n;++i)
        f[i]=1ll*cnt[n-i]*fac[n-i]%mod,g[i]=invf[i];
    int lim=1,ct=0;
    while(lim<=n<<1)
        lim<<=1,++ct;
    for(register int i=0;i<lim;++i)
        r[i]=(r[i>>1]>>1)|((i&1)<<(ct-1));
    NTT(f,lim,1),NTT(g,lim,1);
    for(register int i=0;i<lim;++i)
        f[i]=1ll*f[i]*g[i]%mod;
    NTT(f,lim,-1);
    for(register int i=1;i<=n;++i)
    {
        int ans=(0ll+1ll*n*C(n,i)%mod-1ll*invf[i]*f[n-i]%mod+mod)%mod;
        write(ans),puts("");
    }
	return 0;
}


Measured memory_bytes: 22784
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] dp = new int[n];
		int[] frog = new int[n];
		for(int i=0; i<n; i++) {
			frog[i] = sc.nextInt();
		}
		for(int i=1; i<n; i++) {
			dp[i] = Integer.MAX_VALUE;
		}
		for(int i=0; i<n; i++) {
			for(int j=i+1; j<i+3; j++) {
				if(j<n) dp[j] = Math.min(dp[j],dp[i]+ Math.abs(frog[i]-frog[j]));
			}
		}
		System.out.println(dp[n-1]);

	}

}


Measured memory_bytes: 50420
#include <iostream>
#include <queue>

using namespace std;

const int N = 100;
const int Inf = 1e9;

int m[N][N];
int d[N];
int n;

void bfs(int);

int main(int argc, char const *argv[]) {
  cin >> n;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      m[i][j] = 0;
    }
    d[i] = -1;
  }

  for (int i = 0; i < n; ++i) {
    int u, k;  cin >> u >> k;
    for (int j = 0; j < k; ++j) {
      int v;  cin >> v;
      m[u - 1][v - 1] = 1;
    }
  }
  bfs(0);

  return 0;
}

void bfs(int s) {
  queue<int> q;
  q.push(s);
  d[s] = 0;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = 0; i < n; ++i) {
      if (m[u][i] == 0 || d[i] != -1) {
        continue;
      }
      d[i] = d[u] + 1;
      q.push(i);
    }
  }
  for (int i = 0; i < n; ++i) {
    cout << i + 1 << " " << d[i] << '\n';
  }
}



Measured memory_bytes: 3140
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static string[] s_rd;
T RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
T[] ARR(T = long)(in string str, T fix = 0) { auto r = str.split.to!(T[]); r[] += fix; return r; }
size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
long lcm(long x, long y) { return x * y / gcd(x, y); }

long mod = 10^^9 + 7;
//long mod = 998244353;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }

void main()
{
	auto A = RD;
	auto B = RD;

	writeln(A >= 13 ? B : A >= 6 ? B/2 : 0);
	stdout.flush();
	debug readln();
}

Measured memory_bytes: 256
#include <stdio.h>
                                                                                                
  
int main(void){
                                                                                                
   
    int n, k, i, j, t;
   
    int d[10];

    int a = 0;

    int s = 0;
   
      
    scanf("%d %d", &n, &k );
   
    for( i = 0 ; i < k ; i = i + 1 ){

         scanf("%d", &d[i] );

         }


    for( i = n ; i <= 10 * n ; i = i + 1 ){

         t = i;

         while( t > 0 ){

                for( j = 0 ; j < k ; j = j + 1 ){

                     if( t % 10 == d[j] ){

                         s = 1;

                         break;

                         }

                     }

                t = t / 10;

                }

         if( s == 0 ){

             a = i;

             break;

             }

         s = 0;

         }


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


    return 0;
                                                          
}

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

using namespace std;

int main()
{
    int n;
    cin >>n;
    vector<int> v(n);
    for(int i=0;i<n;i++){
        cin >>v[i];
    }
    sort(v.begin(), v.end());
    long long l1 = -1, l2=-1;
    
    for(int i=n-1;i>=1;i--){
        if(v[i] == v[i-1]){
            if(l1 == -1)
                l1 = v[i];
            else
                l2 = v[i];
            i--;
        }
        
        if(l2!=-1)
            break;
    }
    
    if(l1==-1 || l2==-1)
        cout << 0<<endl;
    else
        cout << l1*l2<<endl;
    
}


Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Library;
using static Library.Input;

namespace AtCoderTemplate
{
    class ProgramC
    {
        static void Main()
        {
            int n = NextInt;

            System.Console.WriteLine(
                IntList.OrderBy(x => x).Select(x => (decimal)x).Aggregate((x, y) => (x + y) / 2)
            );
        }
    }
}

namespace Library
{
    class Input
    {
        static IEnumerator<string> enumerator = new string[] { }.AsEnumerable().GetEnumerator();

        public static string Line => Console.ReadLine();

        public static string[] StrArr => Line.Split(' ');

        public static int NextInt => int.Parse(NextWord());

        public static long NextLong => long.Parse(NextWord());

        public static List<int> IntList => StrArr.Select(int.Parse).ToList();

        public static List<long> LongList => StrArr.Select(long.Parse).ToList();

        public static IEnumerable<long[]> TakeLine(int N)
        {
            return Enumerable.Repeat(0, N).Select(_ => Console.ReadLine().Split(' ').Select(long.Parse).ToArray());
        }

        public static string NextWord()
        {
            while (!enumerator.MoveNext())
            {
                enumerator = StrArr.AsEnumerable().GetEnumerator();
            }
            return enumerator.Current;
        }
    }
}


Measured memory_bytes: 13524
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstring>
#define fr first
#define sc second
using namespace std;

int w,n;
typedef pair<int,int> P;
P dp[1001][1001];
bool chg[1001][1001];
vector <P> dat;

P rec(int idx,int wi){
    P ans;
    if(chg[idx][wi]) return dp[idx][wi];
    if(idx == n){
        ans = P(0,wi);
    }
    else{
        if(wi - dat[idx].sc >= 0){
            P p = rec(idx+1,wi-dat[idx].sc);
            p.first += dat[idx].fr;
            ans = max(p,rec(idx+1,wi));
        }
        else ans = rec(idx+1,wi);
    }
    chg[idx][wi] = true;
    return dp[idx][wi] = ans;
}

int main(){
    int a = 0;
    while(cin >> w,w){
        memset(dp,-1,sizeof(dp));
        memset(chg,false,sizeof(chg));
        cin >> n;
        for(int i=0;i<n;i++){
            int t,m; scanf("%d,%d",&t,&m); dat.push_back(P(t,m));
        }
        P p = rec(0,w);
        cout << "Case " << ++a << ":\n" << p.fr << endl << w - p.sc << endl;
        dat.resize(0);
    }
}

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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    int N, M, X;
    cin >> N >> M >> X;
    vector<int> a(M);
    rep(i, M) cin >> a[i];
    ll left = 0, right = 0;
    for (int i=X; i>=0; --i) {
        rep(j, M) {
            if (a[j] == i) {
                left++;
                break;
            }
        }
    }
    for (int i=X; i<=N; ++i) {
        rep(j, M) {
            if (a[j] == i) {
                right++;
                break;
            }
        }
    }
    cout << min(left, right) << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();		
		int count = 0;
		for(int i=1; i<=N; i++) {
			if(i%2==0)continue; //continueで偶数の場合は下の処理を行わない(奇数の場合は行う)
			int Yakusu=0; //ここに約数の個数を入れる
			
			for(int j=1; j<=i; j++) {
				if(i%j==0) Yakusu++; //N%1からN%Nを繰り返し、割り切れる場合Yakusuに＋1する
			}
			
			if(Yakusu==8)count++; //Yakusuの個数がちょうど８のとき
		}							//countに＋1する
		
		System.out.println(count); //N以下で「奇数かつ約数が８個」を満たす数の個数を表示
	}
}

Measured memory_bytes: 20564
#include <iostream>
#include <algorithm>
#include <array>

typedef long long ll;

int main (void){
  ll N; std::cin >> N;
  std::array<ll, 5> t;
  for(int i=0; i<5; i++){
    std::cin >> t[i];
  }

  ll m = *std::min_element(t.begin(), t.end());
  ll s = N%m == 0 ? N/m : N/m+1;
  std::cout << 4 + s << std::endl;
  return 0;
}

Measured memory_bytes: 256
using System;

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            string[] n = Console.ReadLine().Split();
            int[] a = new int[N];
            for (int x = 0; x < N; x++)
            {
                a[x] = int.Parse(n[x]);
            }
            for(int y = 0;y < N;y++)
            {
                if(a[y]%2==0)
                {
                    if(a[y]%5==0||a[y]%3==0)
                    { }
                    else
                    {
                        Console.WriteLine("DENIED");
                        y = N;
                    }
                }
                if(y == N-1)
                {
                    Console.WriteLine("APPROVED");
                }
            }
        }
    }
}


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

static const int M_NUM = 100;
static const int WHITE = 0;
static const int GRAY  = 1;
static const int BLACK = 2;

int adj_M[M_NUM][M_NUM];
int v_num, Time(0);
int visit_state[M_NUM], D_time[M_NUM], C_time[M_NUM];

void DepthFirstSearch_Recursion(int vertex) 
{
    visit_state[vertex] = GRAY;
    D_time[vertex] = ++Time;
    for (int i = 0; i < v_num; ++i)
    {
        if (adj_M[vertex][i] && visit_state[i] == WHITE) DepthFirstSearch_Recursion(i);
    }
    visit_state[vertex] = BLACK;
    C_time[vertex] = ++Time;
}

int main() 
{
    int v_id, v_degree, adj_v;
    cin >> v_num;

    for (int i = 0; i < v_num; ++i) 
    {
        for (int j = 0; j < v_num; ++j) 
        {
            adj_M[i][j] = 0;
        }
    }

    for (int i = 0; i < v_num; ++i) 
    {
        cin >> v_id >> v_degree;
        v_id--;
        for (int j = 0; j < v_degree; ++j) 
        {
            cin >> adj_v;
            adj_v--;
            adj_M[v_id][adj_v] = 1;
        }
    }

    for (int i = 0; i < v_num; ++i) visit_state[i] = WHITE;

    for (int i = 0; i < v_num; ++i) if (visit_state[i] == WHITE) DepthFirstSearch_Recursion(i);

    for (int i = 0; i < v_num; ++i) 
    {
        cout << i + 1 << " " << D_time[i] << " " << C_time[i] << endl;
    }
}


Measured memory_bytes: 3116
#include <bits/stdc++.h>
#define int long long
#define ld long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define pii pair<int,int>
#define ff first
#define ss second
#define frr(i,n) for(int i=0;i<n;i++)
#define td(v) v.begin(),v.end()
#define inf 1000000000 // 1e9
#define M   1000000007 // 1e9 + 7
using namespace std;
inline int mod(int n, int m){ int ret = n%m; if(ret < 0) ret += m; return ret; }
int gcd(int a, int b){return (b == 0 ? a : gcd(b, a%b));}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int exp(int a,int b,int m){
    if(b==0) return 1;
    if(b==1) return mod(a,m);
    int k = mod(exp(a,b/2,m),m);
    if(b&1){
        return mod(a*mod(k*k,m),m);
    }
    else return mod(k*k,m);
}
int32_t main(){
    fastio;
    string x;
    cin >> x;
    int n = x.size();
    int r1=0,r2=0;
    bool fl = 0;
    string s1,s2;
    for(int i=0;i<n;i++){
        if(fl) s1+='0';
        else s1+='1';
        if(fl) s2 += '1';
        else s2+='0';
        if(s1[i]!=x[i]){
            r1++;
        }
        else if(s2[i]!=x[i]){
            r2++;
        }
        fl = !fl;
    }
    cout << min(r1,r2) << endl;
} 

Measured memory_bytes: 720
def main():
	N = int(input())
	A = list(map(int, input().split()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)
main()

Measured memory_bytes: 84420
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
typedef long long ll;
typedef unsigned long long ull;

ll A[100000];
ll S[100000];

int main()
{
	int N, M;
	ll ans = 0;
	map<ll, ll> cnt;

	cin >> N >> M;
	rep(i, N) cin >> A[i];

	rep(i, N) {
		if (i == 0) S[i] = A[i] % M;
		else S[i] = (S[i - 1] + A[i]) % M;
	}

	rep(i, N) {
		if (S[i] == 0) ans++;
		if (cnt.count(S[i]) > 0) ans += cnt[S[i]];

		if (cnt.count(S[i]) == 0) cnt[S[i]] = 1;
		else cnt[S[i]]++;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 5760
from collections import Counter
N = int(input())
numbers = [int(i) for i in input().split()]

o = Counter(numbers[::2]).most_common()
e = Counter(numbers[1::2]).most_common()

if o[0][0] == e[0][0]:
    if len(o) == 1:
        output = N // 2
    else :
        e1, e2 = e[0][1], e[1][1]
        o1, o2 = o[0][1], o[1][1]
        
        output = min(N-e1-o2, N-e2-o1)
else :
    output = N - o[0][1] - e[0][1]

print(output)

Measured memory_bytes: 25364
#include <iostream>

using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if (a + b == c || b + c == a || c + a == b){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;    
  }
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<complex>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
#include <numeric>
using namespace std;
using Complex = complex<double>;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1145141919810364364LL;
double PI = acos(-1.0);
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)

ll MOD = 1e9 + 7;
ll n, k,cnt[101010];

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

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

	cin >> n >> k;
	ll ans = 0;
	for (ll i = k; i >= 1; i--) {
		ll tmpcnt = modpow(k/i,n);
		for (int j = 2 * i; j <= k; j += i) {
			tmpcnt -= cnt[j];
			tmpcnt += MOD;
			tmpcnt %= MOD;
		}
		cnt[i] = tmpcnt;
		ans += i * tmpcnt;
		ans %= MOD;
	}
	puts(ans);
	
	
	return 0;
}

Measured memory_bytes: 4392
//                                      KiSmAt
#include "bits/stdc++.h"
using namespace std;
 
using ll = long long;
 
const ll inf = 1e18;
const int N = 2 * 1e5 + 10;

ll res;
ll a[N], dp[N];

vector<ll> v;

void solve(){
    ll n, k, x;
    cin >> n >> k;
    for(int i = 0; i < n; ++i){
        cin >> x;
        v.push_back(x); 
    }
    for(int i = 1; i <= k; ++i){
        dp[i] = 1;
        for(auto j: v){
            if(j <= i)  dp[i] &= dp[i - j];  
        }
        dp[i] ^= 1;
    }
    cout << (dp[k] ? "First": "Second");
}
 
int main(int argc, char const *argv[]){
    ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
    ll t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}
// nEro

Measured memory_bytes: 1024
let () =
  Scanf.scanf "%d %d %d\n" @@ fun w a b ->
  let ans = if b > a then if b-(a+w) > 0 then b-(a+w) else 0
    else if a-(b+w) > 0 then a-(b+w) else 0 in
  Printf.printf "%d\n" ans

Measured memory_bytes: 3848
#include "bits/stdc++.h"
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(s) s.begin(), s.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<string> vs;
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
const int DIV = 1e9+7;

int N, W;
vi w, v;
ll memo[101][101010];

ll rec(int p, int nokori) {
    if (p == N) return 0;
    if (memo[p][nokori] == -1) {
        if (nokori < w[p]) memo[p][nokori] = rec(p + 1, nokori);
        else memo[p][nokori] = max(rec(p + 1, nokori), rec(p + 1, nokori - w[p]) + v[p]);
    }
    return memo[p][nokori];
}

int main() {
    cin >> N >> W;
    w.resize(N); v.resize(N);
    rep(i, N) cin >> w[i] >> v[i];
    rep(i, N) rep(j, W + 1) memo[i][j] = -1;
    cout << rec(0, W) << endl;
}

Measured memory_bytes: 79104
using System;
using System.Collections.Generic;

namespace ALDS1_4_B
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            var S = new HashSet<string>(Console.ReadLine().Split(' '));
            Console.ReadLine();
            var T = Console.ReadLine().Split(' ');

            int cnt = 0;
            foreach (var a in T)
            {
                if (S.Contains(a)) cnt++;
            }
            Console.WriteLine(cnt);
        }
    }
}

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

//{ START
using namespace std;
#define int int64_t
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define reps(i, a, n) for (int i = (a); i > (n); --i)
#define arep(i, x) for (auto &&i : (x))
#define irep(i, x) for (auto i = (x).begin(); i != (x).end(); ++i)
//降順はgreater<T>()
#define all(x) (x).begin(), (x).end()
#define rv(s) reverse((s).begin(), (s).end())
// gcd lcmはそのままok
#define gcd(a, b) __gcd(a, b)
#define bits(n) (1 << (n))
#define pcnt(x) __builtin_popcountll(x)
//配列内等要素削除
#define unique(x) (x).erase(unique((x).begin(), (x).end()), (x).end())
#define Fixed(n) fixed << setprecision(n)
//総和
#define sowa(n) ((n) * ((n) + 1)) / 2
#define pb(x, a) (x).push_back(a)
#define fb(x, a) (x).push_front(a)
#define eb(x, a) (x).emplace_back(a)
#define F first
#define S second
#define cauto const auto &
using P = pair<int, int>;
using Graph = vector<vector<P>>;
template <class T>  //昇順
using min_heap = priority_queue<T, vector<T>, greater<T>>;
template <class T>  //降順
using max_heap = priority_queue<T>;
template <class A, class B>
using umap = unordered_map<A, B>;
template <class A>
using uset = unordered_set<A>;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {  //多次元初期化
  std::fill((T *)array, (T *)(array + N), val);
}
template <class T>
bool chmax(T &a, const T &b) {  //最大値更新 返り値はbool
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {  //最小値更新 返り値はbool
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr int LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod1 = 1e9 + 7;
constexpr int mod2 = 998244353;
//} END

int N, cnt = 0;
void dfs(int x) {
  if (x > N)
    return;
  else {
    uset<int> se;
    int nx = x;
    while (nx > 0) {
      se.insert(nx % 10);
      nx /= 10;
    }
    if (se.size() == 3) ++cnt;
  }

  dfs(x * 10 + 3), dfs(x * 10 + 5), dfs(x * 10 + 7);
}

signed main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);

  cin >> N;
  dfs(0);
  cout << cnt << '\n';
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int i,N,max,x,y,z;

	scanf("%d",&N);

	for(i=0;i<N;i++){
		scanf("%d",&x);
		max=x;
		scanf("%d",&y);
		if(max<y)
			max=y;
		scanf("%d",&z);
		if(max<z)
			max=z;
		if(max==x)
			if(x*x==y*y+z*z)
				printf("YES\n");
			else
				printf("NO\n");

		else if(max==y)
			if(y*y==x*x+z*z)
				printf("YES\n");
			else
				printf("NO\n");
		else
			if(x*x+y*y==z*z)
				printf("YES\n");
			else
				printf("NO\n");
	}

	return 0;
}

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

process.stdin.on('data', function (chunk) {
var line = chunk.toString().split(' ');
var s = Number(line[0]);
var hour_sec = 60*60;
var minitu_sec = 60;

var h = Math.floor(s / hour_sec);
var m = Math.floor((s % hour_sec) / minitu_sec);
var sec = s % hour_sec %  minitu_sec;

console.log(h+':'+m+':'+sec);
    
});

Measured memory_bytes: 15592
from bisect import bisect_left,bisect_right
import sys
def input(): return sys.stdin.readline().strip()
n=int(input())
ll=sorted(list(map(int,input().split())))
c=0
lll=len(ll)
for i in range(lll-2):
    for j in range(i+1, lll-1):
        uk = bisect_left(ll, ll[i] + ll[j], j+1)
        lk = bisect_right(ll, abs(ll[j] - ll[i]), j+1, uk)
        c+=uk-lk
print(c)

Measured memory_bytes: 48236
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define all(i,n) (i),(i+n)

int dx4[4]={1,0,-1,0};
int dy4[4]={0,-1,0,1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

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

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;

// --------------------------------------
int n;
int a[200005];
int memo[200005];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> n;
  vector<int> ans;
  FOR(i, 1, n + 1) cin >> a[i];
  REP(i, n + 1) memo[i] = 0;

  for(int i = n; i > 0; i--) {
    int sum = 0;
    for(int j=1; j * i <= n; j++) {
      if(memo[i * j]) sum++;
    }
    if(sum % 2 != a[i]) {
      memo[i] = 1;
      ans.push_back(i);
    }
  }

  cout << ans.size() << endl;
  REP(i, ans.size()) {
    cout << ans[i] << " ";
  }
  cout << endl;
}


Measured memory_bytes: 3192
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
  char s[6]="aeiou",a;
  cin>>a;
  for(int i=0;i<5;i++){
    if(a==s[i]){
      cout<<"vowel";
      return 0;
    }
  }
  cout<<"consonant";
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
#include<set>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
llfor;///////////////////////////////////////////////////////////
int main(){
 ll n;sc(n);
 ll a[n],b[n]={2};
 ll ans=0;
 b[0]=2;
 rep(i,0,n){
  sc(a[i]);
 }
 rep(i,0,n){
  while(i<n-1&&a[i+1]==a[i])i++;
  if(i<n-1&&a[i]<a[i+1]){
   while(i<n-1&&a[i]<=a[i+1])i++;
   }
  else if(i<n-1&&a[i]>a[i+1]){
   while(i<n-1&&a[i]>=a[i+1])i++;
  }
  ans++;
  //pr(i);
 }
 pr(ans);
 
return 0;}

Measured memory_bytes: 5104
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define MN 100005
using namespace std;
int n,ans=0x3f3f3f3f,a[MN],k;
int main(){
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	for(int l=1;l+k-1<=n;l++){
		if(1ll*a[l]*a[l+k-1]>=0)ans=min(ans,max(abs(a[l+k-1]),abs(a[l])));
		else ans=min(ans,abs(a[l])+abs(a[l+k-1])+min(abs(a[l]),abs(a[l+k-1])));
	}printf("%d\n",ans);
}

Measured memory_bytes: 512
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */



template<class Type>
Type solve(Type res = Type()){
    ll N; cin >> N;
    vector<ll> A(N); for(auto& in:A) cin >> in;
    map<ll,ll> mp;
    for(int i = 0; i < N;i++){
        ll a = A[i];
        
        auto it = mp.lower_bound(a);
        if(it == mp.begin()){
            res++;
            mp[a]++;
        }else{
            it--;
            if(it->second){
                it->second--;
                if(it->second == 0){
                    mp.erase(it);
                }
                
                mp[a]++;
            }
        }
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 7168
#include <cstdio>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <cmath>
#include <iomanip>
#include <deque>
#include <queue>
#include <unordered_map>
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
ll intpow(ll N, ll P){
    if(P==0) return 1;
    if(P%2==0){
        ll t = intpow(N, P/2);
        return t*t;
    }
    return N * intpow(N, P-1);
}
ll modpow(ll N, ll P,ll k){
    if(P==0) return 1;
    if(P%2==0){
        ll t = modpow(N, P/2,k)%k;
        return t*t%k;
    }
    return N * modpow(N, P-1,k)%k;
}
ll modkai(ll n,ll m,ll k){//n*(n-1)*(n-2)*...(m+1)%k
    if(n == m)return 1;
    return modkai(n-1,m,k)*n%k;
}
ll mod_cnb(ll n,ll m,ll k){//nCm%k,kは十分大きい素数
  int m_=modkai(m,0,k);
  return modkai(n,n-m,k)*modpow(m_,k-2,k)%k;
}
ll gcd(ll n,ll m){
    ll n_ = max(n,m);
    ll m_ = min(n,m);
    if(n_%m_ == 0)return m_;
    return gcd(m_,n_%m_);
}
ll lcm(ll n,ll m){
    return n*m/gcd(n,m);
}
int main(){
    int n;cin>>n;
    ll sum=0;
    for(ll i=1;i<=n;i++){
        if(i%3!=0&&i%5!=0)sum+=i;
    }
    cout<<sum<<endl;
}


Measured memory_bytes: 3636
N = int(input())
A = list(map(int,input().split()))
s = 0
for i in range(N):
  A[i] = A[i] - (i+1)
A.sort()

a = N//2
if(N%2 == 0):
  x = (A[a-1]+A[a])//2
else:
  x = A[a]

ans = 0
for i in range(N):
  ans += abs(x-A[i])
print(ans)

Measured memory_bytes: 26836
MAX_N = 10**6+1
over = [0] * MAX_N
for i in xrange(2, MAX_N/2+1):
    for j in xrange(i+i, MAX_N, i):
        over[j] += (i-1)-over[i]
ans = [0] * MAX_N
ans[0] = 1
ans[1] = 2
for i in xrange(2,MAX_N):
    ans[i] = ans[i-1] + (i - 1) - over[i]
for _ in xrange(input()):
    print ans[int(raw_input())]

Measured memory_bytes: 65836
#include <bits/stdc++.h>
using namespace std;
long long log5(long long x){
    int i=0;
    while(1){
        x/=5;
        if(x<1)break;
        else i++;
    }
    return i;
}

int main(){
    long long n,count=0,divide=10;
    cin >> n;
    if(n%2LL==1LL){
        cout << 0 << endl;
        return 0;
    }
    for(int i=0;i<log5(n);i++){
        count+=(n/divide);
        divide*=5;
    }
    cout << count << endl;
}

Measured memory_bytes: 256
/*
JOI テ」ツδ妥」ツつケテ」ツつソテ・ツコツ療」ツ?ァテ」ツ?ッテッツシツ古」ツδゥテ」ツδウテ」ツδ?」ツ?ョテ」ツ?甘」ツ?凖」ツ?凖」ツつ?」ツδ妥」ツつケテ」ツつソテ」ツ?ィテヲツ青セテ」ツつ甘」ツ?淌」ツ?ヲテ」ツつクテ」ツδ・テ」ツδシテ」ツつケテ」ツ?ョテ」ツつサテ」ツδε」ツδ暗」ツδ。テ」ツδ凝」ツδ・テ」ツδシテ」ツ?古・ツ・ツスティツゥツ陛」ツ?ァテ」ツ?づ」ツつ凝ッツシツ偲」ツ?禿」ツ?ョテ」ツつサテ」ツδε」ツδ暗」ツδ。テ」ツδ凝」ツδ・テ」ツδシテ」ツつ津ヲツウツィテヲツ鳴?」ツ?凖」ツつ凝」ツ?ィテ」ツ?催」ツ?ッテッツシツ古」ツ?敕」ツ?ョテヲツ猟・テ」ツ?ョ 3 テァツィツョテゥツ。ツ榲」ツ?ョテ」ツδ妥」ツつケテ」ツつソテ」ツ?ィ 2 テァツィツョテゥツ。ツ榲」ツ?ョテ」ツつクテ」ツδ・テ」ツδシテ」ツつケテ」ツ?凝」ツつ?1 テ」ツ?、テ」ツ?堙」ツ?、テゥツ?クテ」ツ?カテッツシツ偲」ツδ妥」ツつケテ」ツつソテ」ツ?ィテ」ツつクテ」ツδ・テ」ツδシテ」ツつケテ」ツ?ョテ・ツ?、テヲツョツオテ」ツ?ョテ・ツ青暗ィツィツ暗」ツ?凝」ツつ?50 テ・ツ??」ツつ津・ツシツ陛」ツ??」ツ?淌ゥツ?妥ゥツ。ツ催」ツ?古、ツサツ」テゥツ?妥」ツ?ィテ」ツ?ェテ」ツつ凝ッツシツ?
テ」ツ?づ」ツつ凝ヲツ猟・テ」ツ?ョテ」ツδ妥」ツつケテ」ツつソテ」ツ?ィテ」ツつクテ」ツδ・テ」ツδシテ」ツつケテ」ツ?ョテ・ツ?、テヲツョツオテ」ツ?古、ツクツ偲」ツ?暗」ツつ嘉」ツつ古」ツ?淌」ツ?ィテ」ツ?催ッツシツ古」ツ?敕」ツ?ョテヲツ猟・テ」ツ?ョテ」ツつサテ」ツδε」ツδ暗」ツδ。テ」ツδ凝」ツδ・テ」ツδシテ」ツ?ョテ、ツサツ」テゥツ?妥」ツ?ョテヲツ慊?・ツーツ湘・ツ?、テ」ツつ津ヲツアツづ」ツつ?」ツつ凝」ツδ療」ツδュテ」ツつーテ」ツδゥテ」ツδ?」ツつ津、ツスツ愿ヲツ按静」ツ?崚」ツつ暗ッツシツ?
*/

#include <stdio.h>

int main(void){
	int pasta = 2000, juice = 2000, input;
	int i;

	// テ」ツδ妥」ツつケテ」ツつソテ」ツ?ョテ・ツ?・テ・ツ環?
	for (i = 0; i < 3; i++){
		scanf("%d", &input);
		if (input < pasta){
			pasta = input;
		}
	}

	// テ」ツつクテ」ツδ・テ」ツδシテ」ツつケテ」ツ?ョテ・ツ?・テ・ツ環?
	for (i = 0; i < 2; i++){
		scanf("%d", &input);
		if (input < juice){
			juice = input;
		}
	}

	// テ・ツ?コテ・ツ環?
	printf("%d\n", pasta + juice - 50);

	return 0;
}

Measured memory_bytes: 592
#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 rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()
#pragma endregion


int main()
{
	int n; cin >> n;
	vector<int> d(n + 1);
	d[0] = 0;
	for (int i = 1; i <= n; ++i)cin >> d[i];
	sort(all(d));
	rep(i, n + 1)if (i % 2)d[i] = 24 - d[i];
	d.push_back(24);
	sort(all(d));
	int res = 12;
	rep(i, n + 1)
	{
		res = min(res, d[i + 1] - d[i]);
	}
	cout << res << endl;
}

Measured memory_bytes: 256
N, K = map(int, input().split())
V = list(map(int, input().split()))

ans = 0

for a in range(K + 1):
    for b in range(K - a + 1):

        # a+b>Nとなるような操作は実現不可能
        if a + b > N:
            continue

        # 左からa個、右からb個取り出す
        get = []
        get += V[:a]
        get += list(reversed(V))[:b]
        # (a+b)回操作した時点でのスコア
        tmp = sum(get)

        # まだ操作出来るなら、負の数を取り除く
        get.sort()
        for i in range(min(K - a - b, len(get))):
            if get[i] < 0:
                tmp += -get[i]
        ans = max(ans, tmp)

print(ans)


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

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << min(a, b) + min(c, d) << endl;
    
    return 0;
}


Measured memory_bytes: 256
{-# LANGUAGE BangPatterns #-}
import           Control.Exception           (assert)
import           Control.Monad
import           Control.Monad.Primitive
import qualified Control.Monad.ST            as ST
import qualified Data.Array.IO               as IO
import qualified Data.Array.ST               as ST
import qualified Data.Array.Unboxed          as A
import           Data.Bits
import qualified Data.ByteString.Char8       as BS
import           Data.Char
import           Data.Foldable
import           Data.List
import qualified Data.Map.Strict             as Map
import           Data.Maybe
import qualified Data.Sequence               as Seq
import qualified Data.Set                    as Set
import qualified Data.Vector                 as VB
import qualified Data.Vector.Mutable         as VBM
import qualified Data.Vector.Unboxed         as V
import qualified Data.Vector.Unboxed.Mutable as VM
import           Debug.Trace

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine
getIntVec n = V.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

readInteger = fst . fromJust . BS.readInteger
readIntegerList = map readInteger . BS.words
getInteger = readInteger <$> BS.getLine
getIntegerList = readIntegerList <$> BS.getLine

inf :: Int
inf = 10^18

main = do
  [x, y] <- getIntList

  let plus_plus   = x >= 0 && y >= 0
      plus_minus  = x >= 0 && y <  0
      minus_plus  = x <  0 && y >= 0
      minus_minus = x <  0 && y <  0

      d = abs (abs x - abs y)

      ans | x == y    = 0
          | x == (-y) = 1
          | abs x < abs y && plus_plus   = d
          | abs x < abs y && plus_minus  = d + 1
          | abs x < abs y && minus_plus  = d + 1
          | abs x < abs y && minus_minus = d + 2
          | x > 0 && y == 0 = x + 1
          | x < 0 && y == 0 = -x
          | abs x > abs y && plus_plus   = d + 2
          | abs x > abs y && plus_minus  = d + 1
          | abs x > abs y && minus_plus  = d + 1
          | abs x > abs y && minus_minus = d

  print ans

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl;

int main()
{
    double a, b;

    cin >> a >> b;

    cout << (int)(a / b) << " " << (int)a % (int)b << " ";
    cout << fixed << setprecision(5) << a / b << endl;

    return 0;
}


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

int main() {
    int n; cin >> n;
    map<char, char> s; char _s;
    
    rep (i, n) {
        cin >> _s;
        if (s.find(_s) == s.end()) s[_s] = 1;
        else s[_s]++;
    }

    if (s.size() == 4) {
        cout << "Four" << endl;
    }
    else {
        cout << "Three" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	if(a>0&&b>0)printf("Positive");
	else if(b>=0&&a<=0)printf("Zero");
	else if(a<0&&b<0&&(b-a)%2==0)printf("Negative");
	else printf("Positive");
}
/*
bool arr[110000]={};
int main(){
	int n,m,t1,t2;
	scanf("%d %d",&n,&m);
	arr[1]=true;
	for(int i=1;i<=m;i++){

	}
}
*/


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

long long m, n;
vector<string> e;
map<string, set<int>> mp;
stack<set<int>> st;

bool solve();

int main() {
  cin >> m;
  for(int i = 0; i < m; ++i) {
    string s;
    int l, r;
    cin >> s >> l >> r;
    for(int i = l; i <= r; ++i) mp[s].insert(i);
  }
  cin >> n;
  e.resize(n);
  for(int i = 0; i < n; ++i) cin >> e[i];
  if(solve())
    cout << "correct" << endl;
  else
    cout << "error" << endl;
  return 0;
}

bool solve() {
  for(int i = 0; i < n; ++i) {
    set<int> a, b, c;
    if(e[i] == "+") {
      b = st.top();
      st.pop();
      a = st.top();
      st.pop();
      for(int x : a)
        for(int y : b) c.insert((x + y) % MOD);
      st.push(c);
    }
    else if(e[i] == "-") {
      b = st.top();
      st.pop();
      a = st.top();
      st.pop();
      for(int x : a)
        for(int y : b) c.insert((x - y + MOD) % MOD);
      st.push(c);
    }
    else if(e[i] == "*") {
      b = st.top();
      st.pop();
      a = st.top();
      st.pop();
      for(int x : a)
        for(int y : b) c.insert((x * y) % MOD);
      st.push(c);
    }
    else if(e[i] == "/") {
      b = st.top();
      st.pop();
      a = st.top();
      st.pop();
      for(int x : a)
        for(int y : b) {
          if(y == 0) return 0;
          c.insert((x / y) % MOD);
        }
      st.push(c);
    }
    else if(isdigit(e[i][0])) {
      a.insert(stoi(e[i]) % MOD);
      st.push(a);
    }
    else
      st.push(mp[e[i]]);
  }
  return 1;
}


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

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


#define rep(i,n) for(ll (i)=0; (i)<(ll)(n); (i)++)
#define frep(i,m,n) for(ll (i)=(m); (i)<=(ll)(n); (i)++)
#define rrep(i,n) for(ll (i)=(n)-1; (i)>-1; (i)--)
#define frrep(i,m,n) for(ll (i)=(n); (i)>(ll)(m); (i)--)
#define ALL(x) (x).begin(), (x).end()

const ll INF = 100100100100100100;
const ll MOD = 1000000007;

// get abs
ll my_abs(ll a);
// a^n
ll a_n(ll a, ll n);
// get gcd
ll my_gcd(ll a, ll b);
// a^(-1) % MOD 
ll inv(ll a);

ll N, A, B, C;
vector<ll> l(8);

ll dfs(ll len, ll a, ll b, ll c) {
    if(len == N) {
        if(a == 0 || b == 0 || c == 0) {
            return 1000000007;
        }
        else {
            return my_abs(A-a) + my_abs(B-b) + my_abs(C-c) - 30;
        }
    }
    else {
        ll w,x,y,z;
        w = dfs(len+1, a, b, c);
        x = dfs(len+1, a+l[len], b, c) + 10;
        y = dfs(len+1, a, b+l[len], c) + 10;
        z = dfs(len+1, a, b, c+l[len]) + 10;
        return min({w,x,y,z});
    }
}

int main() {
    cin >> N >> A >> B >> C;
    rep(i, N) cin >> l[i];

    cout << dfs(0, 0, 0, 0) << endl;

    return 0;
}

ll my_abs(ll a) {
    if(a >= 0) return a;
    else return -1 *a;
}

ll a_n(ll a, ll n) { 
    if(n == 0) return 1;
    
    ll ret = a, count = 1;
    while(count * 2 < n) {
        ret *= ret;
        count *= 2;
    }
    if(count == n) return ret;
    else return (ret * a_n(a, n-count));
}

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

ll inv(ll a) {
    return a_n(a, MOD-2);
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long n,w,c[105],v[105],dp[100005];
int main()
{
	cin >> n >> w;
	long long sum=0;
	for(int i=1; i<=n; i++) cin >> c[i] >> v[i],sum+=v[i];
	for(int i=1; i<=sum; i++) dp[i]=1e13;
	for(int i=1; i<=n; i++) 
	{
		for(int j=sum; j>=v[i]; j--) dp[j]=min(dp[j],dp[j-v[i]]+c[i]);
	}
	for(int j=sum; j>=0; j--) if(dp[j]<=w) {cout << j ; break;}
	
	return 0;
}

Measured memory_bytes: 4412
import bisect
import sys
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

def tami(index):
  if index == N:
    ans.append(-1)
    return
  num = a[index]
  if len(data[num]) == 1:
    ans.append(index)
    tami(index+1)
  elif index == data[num][-1]:
    ans.append(index)
    tami(data[num][0]+1)
  else:
    tmp = bisect.bisect_left(data[num],index)
    #print(num,data[num],tmp)
    tami(data[num][tmp+1]+1)

N,K = IL()
a = IL()

data = [[] for i in range(200010)]
ans = []

for i in range(N):
  data[a[i]].append(i)

#print(data)

tami(0)

#print(ans)
#print(len(ans),K)
#print(K%len(ans))

if K%len(ans) == 0:
  print()
else:
  x = ans[K%len(ans)-1]
  d = []
  d.append(a[x])
  while x != N-1:
    x += 1
    if len(data[a[x]]) == 1:
      d.append(a[x])
    elif x == data[a[x]][-1]:
      d.append(a[x])
    else:
      tmp = bisect.bisect_left(data[a[x]],x)
      x = data[a[x]][tmp+1]

  print(" ".join(map(str,d)))

"""
for i in range(K):
  for j in range(N):
    if a[j] in data:
      num = data.index(a[j])
      data = data[:num]
    else:
      data.append(a[j])
  print(data)

11 10
1 2 3 0 4 5 6 0 4 5 6

11 10
3 1 4 1 5 9 2 6 5 3 5

10 10
1 4 8 3 5 4 2 3 4 6
"""

Measured memory_bytes: 235876
#include <iostream>
#include <string>
using namespace std;
 
int main() {
  double l[10];
  char c;
   
  while(cin >> l[0] >> c) {
    // ????????¨??????1?????????
    int sum = l[0];
    for(int i=1; i<10; i++) cin >> l[i] >> c, sum += l[i];
    for(int i=0; i<10; i++) l[i] = l[i]/sum;
     
    // ???????????????1?????????
    double a, b;
    double left;
    cin >> a >> c >> b;
    left = a/(a+b);
     
    int t = 0;
    double L = 0.0;
    while( L < left ) {
      L += l[t++];
    }
    cout << t << endl;
  }
   
  return 0;
}


Measured memory_bytes: 1224