akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
int main()
{
long long int a,b,c,d,max,i;
  long long int ara[4];
    scanf("%lld %lld %lld %lld",&a,&b,&c,&d);
    ara[0]=a*c;
    ara[1]=a*d;
    ara[2]=b*c;
    ara[3]=b*d;
    max = ara[0];
    for(i=1;i<4;i++)
    {
      if(ara[i]>max)
      {
         max=ara[i];
      }

    }
printf("%lld",max);
return 0;
}


Measured memory_bytes: 1732
from collections import deque
H, W = map(int, input().split())
S = [input() for i in range(H)]
C = sum(s.count('.') for s in S)

dd = ((-1, 0), (0, -1), (1, 0), (0, 1))
que = deque([(0, 0, 0)])
used = {(0, 0)}

res = None
while que:
    s, t, cost = que.popleft()
    if s == H-1 and t == W-1:
        res = cost
        break
    for di, dj in dd:
        ni = s + di; nj = t + dj
        if (not 0 <= ni < H) or (not 0 <= nj < W) or S[ni][nj] == '#' or (ni, nj) in used:
            continue
        used.add((ni, nj))
        que.append((ni, nj, cost + 1))
if res:
    print(C - 1 - res)
else:
    print(-1)


Measured memory_bytes: 3700
#include <stdio.h>

int main(int argc, char** argv)
{
	int i, tmp, isChange;
	int num[3];

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

	for (i = 0; i < 3; i++) {
		isChange = 0;
		if (num[1] < num[0]) {
			tmp = num[1];
			num[1] = num[0];
			num[0] = tmp;
			isChange = 1;
		}

		if (num[1] > num[2]) {
			tmp = num[2];
			num[2] = num[1];
			num[1] = tmp;
			isChange = 1;
		}

		if (isChange == 0) {
			break;
		}
	}

	printf("%d %d %d\n", num[0], num[1], num[2]);

	return 0;
}

Measured memory_bytes: 596
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
	int size, sizecad,i;
	scanf("%d", &size);
	char *cadena = (char *)malloc(100);
	scanf("%s", cadena);
	sizecad= strlen(cadena);
	if(sizecad > size){
		for(i=0; i<size; i++){
			printf("%c", cadena[i]);
		}
		printf("...");
	}else{
		for(i=0; i<sizecad; i++){
			printf("%c", cadena[i]);
		}
	}	
}

Measured memory_bytes: 1688
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

int IT_MAX = 1 << 19;
int MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db ERR = 1e-10;
#define szz(x) (int)(x).size()
#define rep(i, n) for(int i=0;i<n;i++)
#define Se second
#define Fi first

const int MX = 200005;
const int MM = 1000000007;

int N, M;
int D[MX];
ll S[MX];

int main()
{
	scanf("%d", &N);
	for(int i = 1; i <= N; i++) scanf("%d", D+i), S[i] = S[i-1] + D[i];
	ll mn = 1e18;
	for(int i = 1; i < N; i++){
		mn = min(mn, abs(S[N] - S[i] * 2));
	}
	printf("%lld\n", mn);
}


Measured memory_bytes: 2560
#include <stdio.h>

int selection_sort(int A[], int N)
{
    int minj;
    int count = 0;
    for (int i = 0; i < N; ++i) {
         minj = i;
         for (int j = i + 1; j < N; j++) {
             if (A[j] < A[minj])
                minj = j;
         }
         if (minj != i) {
            int temp = A[i];
            A[i] = A[minj];
            A[minj] = temp;
            count++;
         }
    }
    
    return count;
}

int main(int argc, char const *argv[])
{
    // int A[] = {5, 6, 4, 2, 1, 3};
    int A[100];
    int N;

    scanf("%d", &N);
    for (int i = 0; i < N; ++i) {
        scanf("%d", &A[i]);
    }
    
    int count = selection_sort(A, N);

    for (int i = 0; i < N; i++) {
        if (i > 0) printf(" ");
        printf("%d", A[i]);
    }
    printf("\n");
    printf("%d\n", count);
    
    return 0;
}



Measured memory_bytes: 2104
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <regex>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define all(a)          (a).begin(), (a).end()
#define sort(a)         sort(all(a))
#define uniq(a)         sort(a);(a).erase(unique(all(a), (a).end())
#define reverse(a)      reverse(all(a))
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define YES()           cout << "YES" << endl
#define NO()            cout << "NO" << endl
#define Yes()           cout << "Yes" << endl
#define No()            cout << "No" << endl
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }
#define pb              push_back
#define fst             first
#define int             long long

using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;

const ll MOD = 1000000007; // 10^9 + 7
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

void solve() {
  ll x; cin >> x;
  outl(min(2 * ceil(x, 11), 2 * ceil((x + 5), 11) - 1));
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 256
#include <stdio.h>
int divide_ffb(int a[],int l,int key);

int main()
{
    int n,i,a,b[100000],l,pos;
    while(~scanf("%d",&n))
    {
        if(n==0) {printf("0\n");continue;}
        scanf("%d",&a);
        b[0]=a;l=1;
        for(i=1;i<n;i++)
        {
            scanf("%d",&a);
            pos=divide_ffb(b,l,a);
            b[pos]=a;
            if(pos==l) l++;

            //for(int j=0;j<l;j++) printf("%-3d",b[j]);
            //printf("\n");

        }
        printf("%d\n",l);
    }
    return 0;
}

int divide_ffb(int b[],int l,int key)
{
    int i;
    if(key>b[l-1]) return l;
    for(i=0;i<l;i++)
    {
        if(b[i]>=key) break;
    }
    return i;
}

Measured memory_bytes: 2132
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);



int main(){fastio
    ll n;cin>>n;
    ll a[n];rep(i,0,n-1)cin>>a[i];
    if(n%2==0){
        ll m=n/2;
        ll dp[m][2];
        rep(i,0,m-1)rep(j,0,1)dp[i][j]=-inf;
        dp[0][0]=a[0];
        dp[0][1]=a[1];
        rep(i,1,m-1){
            dp[i][0]=dp[i-1][0]+a[i*2];
            dp[i][1]=max(dp[i-1][0]+a[i*2+1],dp[i-1][1]+a[i*2+1]);
        }
        cout<<max(dp[m-1][0],dp[m-1][1])<<endl;
    }else{
        ll m=(n-1)/2;
        ll dp[m][2];
        rep(i,0,m-1)rep(j,0,1)dp[i][j]=-inf;
        dp[0][0]=a[0];
        dp[0][1]=a[1];
        rep(i,1,m-1){
            dp[i][0]=dp[i-1][0]+a[i*2];
            dp[i][1]=max(dp[i-1][0]+a[i*2+1],dp[i-1][1]+a[i*2+1]);
        }
        reverse(a,a+n);
        ll dp1[m][2];
        rep(i,0,m-1)rep(j,0,1)dp1[i][j]=-inf;
        dp1[0][0]=a[0];
        dp1[0][1]=a[1];
        rep(i,1,m-1){
            dp1[i][0]=dp1[i-1][0]+a[i*2];
            dp1[i][1]=max(dp1[i-1][0]+a[i*2+1],dp1[i-1][1]+a[i*2+1]);
        }
        reverse(a,a+n);
        ll maxi=-inf;
        rep(i,-1,m-1){
            if(i==-1){
                maxi=max(maxi,max(dp1[m-1][0],dp1[m-1][1]));
            }else if(i==m-1){
                maxi=max(maxi,max(dp[m-1][0],dp[m-1][1]));
            }else{
                maxi=max(maxi,max(dp[i][0],dp[i][1])+max(dp1[m-2-i][0],dp1[m-2-i][1]));
            }
        }
        cout<<maxi<<endl;
    }
    
    
    return 0;
}





Measured memory_bytes: 8332
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>


using namespace std;

using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)


int main() {
	string s;
	string t;
	cin >> s >> t;

	vector<char> csl(256,0);
	vector<char> ctl(256,0);


	for (int i = 0; i < s.size(); i++) {
		char cs = s[i];
		char ct = t[i];

		if (csl[cs] != 0) {
			if (csl[cs] != ct) {
				cout << "No" << endl;
				return 0;
			}
		} else {
			csl[cs] = t[i];
		}

		if (ctl[ct] != 0) {
			if (ctl[ct] != cs) {
				cout << "No" << endl;
				return 0;
			}
		} else {
			ctl[ct] = s[i];
		}
	}
	cout << "Yes" << endl;

	return 0;
}

Measured memory_bytes: 1020
#include<stdio.h>

void trace(int A[], int N){
   int i;
   for (i = 0; i < N; i++){
      if(i>0) printf(" ");
      printf("%d", A[i]);
   }
   printf("\n");
}

void insertionSort(int A[],int N){
   int v, j;
   for (int i=1; i < N; i++){
      v = A[i];
      j = i - 1;
      while((j >= 0) && (A[j] > v)){
         A[j+1] = A[j];
         j--;
      }
      A[j+1] = v;
      trace(A,N);
   }
}

int main(){
   int N, i, j;
   int A[100];

   scanf("%d",&N);
   for (i=0;i< N; i++) scanf("%d", &A[i]);
   trace(A,N);
   insertionSort(A,N);

   return 0;
}


Measured memory_bytes: 2712
c = []
c_diff = []
 
for i in range(3) :
    c.append([int(x) for x in input().split()])
 
for i in range(3) :
    c_diff.append([c[i][j] - c[i][0] for j in range(3)])
 
if c_diff[0] == c_diff[1] == c_diff[2] :
    print('Yes')
else :
    print('No')

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

ans = float("inf")

A = 0
B = N
for i in range(N//2):

    A += 1
    B -= 1

    if A + B > N:
        break

    else:

        s_a = str(A)
        s_b = list(str(B))

        a = [int(i) for i in s_a]
        b = [int(i) for i in s_b]

        ans = min(ans, sum(a)+sum(b))

print(ans)


Measured memory_bytes: 3060
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {

		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int a=sc.nextInt();
		String s = sc.next();
		
		if(a>=3200) {
			out.println(s);
		}else {
			out.println("red");
		}
		
		out.flush();
	}

}

class FastScanner {
	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() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		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 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();
		}
	}

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

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

	public int[] nextIntsN(int N) {
		int[] ints = new int[N];
		for (int i = 0; i < N; i++) {
			ints[i] = nextInt();
		}
		return ints;
	}
	
	public long[] nextLongsN(int N) {
		long[] longs = new long[N];
		for (int i = 0; i < N; i++) {
			longs[i] = nextLong();
		}
		return longs;
	}
	
	public char[] nextCharsN(int N) {
		char[] chars = new char[N];
		String msg=next();
		for (int i = 0; i < N; i++) {
			chars[i] = msg.charAt(i);
		}
		return chars;
	}

	public char[][] nextCharsHW(int H, int W) {
		char[][] chars = new char[H][W];
		for (int i = 0; i < H; i++) {
			String str = next();
			for (int j = 0; j < W; j++) {
				chars[i][j] = str.charAt(j);
			}
		}
		return chars;
	}

	public int[][] nextIntsNM(int N, int M) {
		int[][] ints = new int[N][M];
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < M; j++) {
				ints[i][j] = nextInt();
			}
		}
		return ints;
	}
}


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

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var ss = Console.ReadLine().Split();
            var x = int.Parse(ss[0]);
            var a = int.Parse(ss[1]);
            var b = int.Parse(ss[2]);

            Console.WriteLine(Math.Abs(x - a) < Math.Abs(x - b) ? 'A' : 'B');
        }
    }
}

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

int main() {
    int N,x = 0,o = 0;
    char c;
    cin >> N;
    for(int i = 0;i < N;i++) {
        cin >> c;
        x += c == 'I' ? 1 : -1;
        if(o < x) o = x;
    }
    cout << o << endl;
}

Measured memory_bytes: 256
///supercalifragilisticexpialidocious.
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <cstdlib>
#include <cctype>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <numeric>
#include <utility>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <list>
#include <bitset>
#include <complex>
using namespace std;
#define f first
#define s second
#define endl '\n'
#define PB pop_back
#define pb push_back
#define mp make_pair
#define int long long
#define sz(s) (int)s.size()
#define seper(n) setprecision(n)
#define all(v) v.begin(),v.end()
#define mem(a,b) memset(a,b,sizeof a)
#define IOS ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...); }
#define debug(...) cerr << "{" << #__VA_ARGS__ << "}:", debug_out(__VA_ARGS__)
typedef long long ll;
typedef map<int , int> mii;
typedef pair<int , int> pii;
typedef map<string , int> msi;
int n , m , f , t;
int32_t main()
{
	cin >> n;
	if(n % 2)
		return cout << 0 << endl , 0;
	m = n / 2;
	while(m)
		f += m / 5 , m /= 5;
	m = n / 2;
	while(m)
		t += m / 2 , m /= 2;
	t *= 2;
	return cout << min(f , t) << endl , 0;
}


Measured memory_bytes: 256
#include <cstdio>

int main() {
	int N; scanf("%d", &N);
	long long ans = 0;
	for (int i = 1; i <= N; i++) {
		long long num = N / i;
		ans += i * (num * (num + 1) / 2);
	}
	printf("%lld", ans);
	return 0;
}


Measured memory_bytes: 3228
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>  
using namespace std;
#define eps 0.00000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
int main() {
	string s;
	cin >> s;
	long long ans = s.length();
	ans *= (long long)(s.length() + 1);
	ans /= (long long)2;
	ans++;
	map<int,long long> wow;
	for (int i = 0;i < s.length();++i) {
		wow[s[i] - 'a']++;
	}
	for (int i = 0;i < 26;++i) {
		ans -= wow[i] * (wow[i] + 1) / (long long)2;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 640
#include<iostream>
#include<iomanip>
#include<math.h>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#define INF 1000000000ll
#define MOD 1000000007ll
#define EPS 1e-10
#define REP(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define DUMP(a) for(long long dump=0; dump<(ll)a.size(); dump++) { cout<<a[dump]; if(dump!=(ll)a.size()-1) cout<<" "; else cout<<endl; }
#define ALL(v) v.begin(),v.end()
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef long double ld;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n;
	cin>>n;
	vector<vector<ll>> f(n,vector<ll>(10));
	vector<vector<ll>> p(n,vector<ll>(11));
	REP(i,n) REP(j,10) cin>>f[i][j];
	REP(i,n) REP(j,11) cin>>p[i][j];
	ll ret=-INF*INF;
	REP(bit,1<<10) {
		if(bit==0) continue;
		ll buf=bit;
		vector<bool> used(10,false);
		REP(i,10) {
			if(buf%2) used[i]=true;
			buf/=2;
		}
		ll adv=0;
		vector<ll> c(n);
		REP(i,n) {
			REP(j,10) {
				if(used[j]&&f[i][j]) c[i]++;
			}
		}
		REP(i,n) {
			adv+=p[i][c[i]];
		}
		ret=max(ret,adv);
	}
	cout<<ret<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ff        first
#define ss        second
#define ll        long long
#define int       long long
#define inf       ((ll)1e18)
#define double    long double
#define ull       unsigned long long
#define mod       1000000007
#define vi        vector<ll>
#define extreme   inline
#define ppi       pair<ll,pair<ll,ll>>
#define pb        push_back
#define mp        make_pair
#define pi        2*acos(0.0)
bool cust(const pair<int,int> &a,const pair<int,int> &b){return (a.second < b.second);} 
#define pr(a,x,y) for(int i=x;i<y;i++){cout<<a[i]<<" ";}
#define p(a)      cout<<a;
#define sp(x,y)   fixed<<setprecision(y)<<x
#define w(x)      ll x; cin>>x; while(x--)
#define all(v)    v.begin(), v.end()
#define rall(v)   v.rbegin(), v.rend()
#define test      cout<<"THIS_AND_THIS"<<endl;
#define str       string
void kehsihba(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	/*#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif*/
}
void solve(){
	str a,b;cin>>a>>b;
	int n=a.size();
	int ans=0;
	for(int i=0;i<n;i++){
		if(a[i]!=b[i]){ans+=1;}
	}
	cout<<ans;
}
int32_t main(){
	kehsihba();
	ll t=1;
	//cin>>t;
	while(t--){
		solve();
	}
}




Measured memory_bytes: 3800
#include <bits/stdc++.h>
#define rep(k,i,n) for(long long i=k;i<n;++i)
using namespace std;
typedef long long ll;
int main(void){
    // Your code here!
    ll N,K,h,c=0;
    cin>>N>>K;
    rep(0,i,N){
        cin>>h;
        if(K<=h)++c;
    }
    cout<<c<<endl;
}


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

using namespace std;
typedef long long ll;


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

	map<char, int> m;
	for (int i = 0; i < n; i++) {
		m[s[i]]++;
	}

	ll res = 1;
	for (auto iter = m.begin(); iter != m.end(); iter++) {
		res = (res * (iter->second + 1)) % 1000000007;
	}

	cout << res - 1 << endl;
}

Measured memory_bytes: 512
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <list>
#include <stack>
#include <math.h>
#include <map>
#include <unordered_map>
#include <set>
using namespace std;

#define ll long long
#define ull unsigned long long

#define	max	1000000007

ll gcd(ll a, ll b) {
	if (a < b)
		swap(a, b);
	while (ll r = a % b)
		a = b, b = r;
	return b;
}

class mod
{
public:
	ll val;

	mod(ll v)
	{
		val = v % max;
	}

	mod()
	{
		val = 0;
	}

	void operator -=(const mod &v)
	{
		val -= v.val;

		if (val < 0)
			val += max;
	}

	void operator +=(const mod &v)
	{
		if (val + v.val >= max)
			val -= max;
		val += v.val;
	}

	void operator +=(ll &v)
	{
		if (val + v >= max)
			val -= max;
		val += v;
	}

	void operator *=(const mod &v)
	{
		val *= v.val;
		val %= max;
	}

	void operator *=(ll &v)
	{
		val *= v;
		val %= max;
	}

	ll modinv(ll a)
	{
		ll b = max, u = 1, v = 0;
		while (b)
		{
			ll t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		u %= max;
		if (u < 0)
			u += max;
		return u;
	}

	void operator /=(const mod &v)
	{
		val *= modinv(v.val);
		val %= max;
	}

	void operator /=(ll &v)
	{
		val *= modinv(v);
		val %= max;
	}
};

int main()
{
	int n;
	cin >> n;
	bool y = false;
	for (int i = 0; i < n; i++)
	{
		int a;
		cin >> a;
		if (a % 2 == 1)
			continue;
		if (a % 3 == 0 || a % 5 == 0)
			continue;
		y = true;
		break;
	}

	if (y)
		printf("DENIED");
	else
		printf("APPROVED");

	return 0;
}


Measured memory_bytes: 888
def solve2(s):
    ans = 0
    for i, c in enumerate(s): #見る数字を右に広げていく
        if c in '02468':
            ans += i + 1 # 見ている数字のの一番右の桁が偶数ならその頭に乗っている数字の数だけ
                        # 答えに追加する
                        # 例 2254とし2→偶数、22→偶数（さらに先頭の2をどけても偶数）
                        # →225（奇数）→2254（偶数、上の3つをそれぞれどけても偶数）
    return ans


def solve5(s): # p==2のときと同じ原理
    ans = 0
    for i, c in enumerate(s):
        if c in '05':
            ans += i + 1
    return ans


def solve_other(s, p):
    ans = 0
    last_mod=0
    mods = [0]*p
    mods[0] = 1 #初期値として何も選んでない状態を1個加えとく
    digit = 1
    for i in range(n-1,-1,-1): # 一番右のけたから見る
        last_mod = (last_mod + int(s[i])*digit)%p # 最新のmodに新しく見ている桁*(10**x)を足してmod計算
        ans += mods[last_mod] # modリストに直前までのの値を答えに追加
        mods[last_mod] += 1 # modリスト更新
        digit=digit*10%p # 桁上げ
    return ans


n, p = list(map(int, input().split()))
s = input()
if p == 2:
    print(solve2(s))
elif p == 5:
    print(solve5(s))
else:
    print(solve_other(s, p))


Measured memory_bytes: 3508
#include <stdio.h>

long long n,s;

int main()
{
	scanf ("%lld %lld",&n,&s);
	for (long long b=2;b<=500000;b++){
		long long t = n, k = 0;
		while (t){
			k += t % b;
			t /= b;
		}
		if (k == s){
			printf ("%lld\n",b);
			return 0;
		}
	}
	long long g = 1e18;
	for (long long r=500000;r>=1;r--){
		if (s >= r){
			long long q = s - r;
			if (n - q >= 0 && (n - q) % r == 0){
				long long b = (n - q) / r;
				if (q < b && r < b && g > b)
					g = b;
			}
		}
	}
	if (g < 1e17){
		printf ("%lld\n",g);
	}
	else if (s == n) printf ("%lld\n",n+1);
	else printf ("-1\n");
	return 0;
}

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

int main(void)
{
    int n, a, b;
    int a_index = 0;
    int b_index = 0;
    cin >> n >> a >> b;
    string attends;
    cin >> attends;
    rep (i, n) {
        if (attends[i] == 'c') cout << "No" << endl;
        else if (attends[i] == 'a') {
            if (a_index + b_index < a + b) {
                cout << "Yes" << endl;
                a_index++;
            } else cout << "No" << endl;
        }else {
            if (a_index + b_index < a + b && b_index < b) {
                cout << "Yes" << endl;
                b_index++;
            } else cout << "No" << endl;
        }
    }

}


Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
bool ops[4];
int a[4];
string s;

int calc(bool ops[]){
  int sum = a[0];
  for ( int i = 0; i < 3; i++){
    if ( ops[i]){
      sum += a[i+1];
    } else {
      sum -= a[i+1];
    }
  }

  return sum;
}

void dfs(bool ops[], int pos){
  if ( pos == 3){
    int sum = calc(ops);
    if ( sum == 7){
      s = "";
      for ( int i = 0; i < 4; i++){
        ostringstream oss;
        oss << a[i];
        s += oss.str();
        if ( i == 3){
          s += "=7";
          break;
        }
        if ( ops[i]){
          s += '+';
        } else {
          s += '-';
        }
      }
    }
  } else {
    ops[pos] = true;
    dfs(ops, pos+1);
    ops[pos] = false;
    dfs(ops, pos+1);
  }
}

int main(){
  string str;
  cin >> str;
  for ( int i = 0; i < 4; i++){
    a[i] = str[i] - '0';
  }

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

  return 0;
}

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

//#define int long long
typedef long long ll;
const int INF = 2e9;
//const ll INF = 9e18;


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int D;
    cin >> D;
    vector<int> c(26);
    for (int i=0;i<26;i++) cin >> c[i];
    vector<vector<int>> s(D,vector<int>(26));
    for (int i=0;i<D;i++){
        for (int j=0;j<26;j++){
            cin >> s[i][j];
        }
    }
    vector<int> t(D);
    //初期t[i]の決定
    for (int i=0;i<D;i++) {
        t[i] = i % 26;
    }

    ll oldsum = -INF;
    for (int m=0;m<100000;m++) {
        //ここでt[i]を更新していく
        int process = rand()%2;
        if (process == 0){
            int dd = rand()%D;
            int qq = rand()%26;
            int oldval = t[dd];
            t[dd] = qq;
            ll sum = 0;
            vector<int> last(26);
            for (ll i=0;i<D;i++){
                sum += s[i][t[i]];
                last[t[i]] = i+1;
                for (int j=0;j<26;j++){
                    sum -= c[j]*(i+1-last[j]);
                }
            }
            if (sum > oldsum) {
                oldsum = sum;
            } else {
                t[dd] = oldval;
            }
        } else {
            int dd1 = rand()%(D-1);
            int dd2 = dd1 + 1 + rand()%(D-dd1-1);
            int qq1 = t[dd1];
            int qq2 = t[dd2];
            t[dd1] = qq2;
            t[dd2] = qq1;
            ll sum = 0;
            vector<int> last(26);
            for (ll i=0;i<D;i++){
                sum += s[i][t[i]];
                last[t[i]] = i+1;
                for (int j=0;j<26;j++){
                    sum -= c[j]*(i+1-last[j]);
                }
            }
            if (sum > oldsum) {
                oldsum = sum;
            } else {
                t[dd1] = qq1;
                t[dd2] = qq2;
            }
        }
        //=======================       
    }
    for (int i=0;i<D;i++){
        cout << t[i]+1 << "\n";
    }
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int N = s.size();
  string ans = "No";
  for (int i = 0; i < N; i++) {
    if (s.at(i) == 'C') {
      for (int j = i + 1; j < N; j++) {
        if (s.at(j) == 'F') {
          ans = "Yes";
        }
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
/*************************************************************************
    > File Name: test.cpp
    > Author: Akira 
    > Mail: qaq.febr2.qaq@gmail.com 
 ************************************************************************/

#include<bits/stdc++.h>
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
#define MST(a,b) memset(a,b,sizeof(a))
#define CLR(a) MST(a,0)
#define Sqr(a) ((a)*(a))
using namespace std;

#define MaxN 100001
#define MaxM MaxN*10
#define INF 0x3f3f3f3f
#define PI 3.1415926535897932384626
const int mod = 1E9+7;
const double eps = 1e-6;
#define bug cout<<88888888<<endl;
#define debug(x) cout << #x" = " << x;

int N;
LL C,K,T[MaxN];

int main()
{
    //std::ios::sync_with_stdio(false);
    while(~scanf("%d%lld%lld", &N, &C, &K))
    {
        for(int i=0;i<N;i++) scanf("%lld", &T[i]);
        sort(T,T+N);
        LL ans = 0;
        for(int i=0;i<N;)
        {
            LL Time = T[i]+K;
            LL cnt = 0;
            ans++;
            //cout << "Time:" <<Time << " : "<< endl;;
            while(T[i]<=Time&&i<N)
            {
                //cout << "#" <<T[i] << endl;
                cnt++;
                if(cnt==C)
                {
                    i++;
                    break;
                }
                i++;
            }
            //cout <<"ans: "<< ans << endl;
        }
        printf("%lld\n", ans);
    }
    //system("pause");
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <numeric>
#include <set>
#include <list>
#include <map>
#include<queue>

const int INF = 1 << 28;
const long long MOD = 1000000007;
using namespace std;
using Graph = vector<vector<int>>;

template<class T> bool chmin(T &a, T &b) { if (a > b) { a = b; return 1; }return 0; }
template<class T> bool chmax(T &a, T &b) { if (a < b) { a = b; return 1; }return 0; }
template<class T, class U> using P = pair<T, U>;

vector<int> seen(50,-1);
int counter_for_dfs = 0;
void dfs(Graph &G, int v) {
	seen[v] = counter_for_dfs;
	counter_for_dfs++;
	for (auto v_next : G[v]) {
		if (seen[v_next]>=0)continue;

		dfs(G, v_next);
	}
}

void bfs(Graph &G) {
	vector<int> dist(G.size(), -1);
	queue<int> que;
	
	dist[0] = 0;
	que.push(0);
	while (!que.empty()) {
		int v = que.front();
		que.pop();

		for (int g : G[v]) {
			if (dist[g] != -1)continue;
			dist[g] = dist[v] + 1;
			que.push(g);
		}
	}
	for (auto i : dist) {
		cout << i << " ";
	}
}

int counter[200005] = {};
void bfs2(Graph &G,int p,int x) {
	vector<int> dist(G.size() , -1);
	queue<int> que;
	
	dist[p] = 0;
	que.push(p);
	while (!que.empty()) {
		int v = que.front();
		que.pop();

		for (int g : G[v]) {
			if (dist[g] != -1)continue;
			dist[g] = dist[v] + 1;
			que.push(g);
			counter[g] += x;
		}
	}
}
int main()
{
	int a, b;
	std::cin >> a >> b;
	int rslt = 0;
	int plug = 1;
	while (true) {
		if (b <= plug)break;
		plug = plug -1 + a;
		rslt++;
	}
	std::cout << rslt;

	return 0;
}

Measured memory_bytes: 256
# C - Train Ticket
# https://atcoder.jp/contests/abc079/tasks/abc079_c
S = input()
n = len(S) - 1
TOTAL = 7
for i in range(1 << n):
    x = S[0]
    for j in range(n):
        if i & 1 << j:
            x += "+"
        else:
            x += "-"
        x += S[j + 1]
    if eval(x) == TOTAL:
        print(f"{x}={TOTAL}")
        break
    else:
        continue
    break


Measured memory_bytes: 8732
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n, flag=0;
    cin >> n;
    while(n!=0)
    {

        if(n%10==7)
        {
          flag=1;
        }
        n=n/10;


    }
    if(flag==1)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;

}


Measured memory_bytes: 3616
#include <cstdio>
#include <cmath>
int n;
double x[1005], y[1005], X, Y, d, e;
double dist(double a, double b) {
	return a*a + b*b;
}
int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lf%lf", &x[i], &y[i]);
		X += x[i]; Y += y[i];
	}
	X /= n; Y /= n;
	double P = 0.1;
	for (int i = 0; i < 30000; i++) {
		int f = 0;
		d = dist(X - x[0], Y - y[0]);
		for (int j = 1; j < n; j++) {
			e = dist(X - x[j], Y - y[j]);
			if (d < e) { d = e; f = j; }
		}
		X += (x[f] - X)*P;
		Y += (y[f] - Y)*P;
		P *= 0.999;
	}
	printf("%.8lf", sqrt(d));
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



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

    long long K,A,B;
    cin >> K >> A >> B;
    long long cou=1;
    long long y=0;
    long long ans=0;
    if(B-A<=2) ans=K+1;
    else{
        long long y=(K-(A-1))/2;
        ans=(K-(A-1))%2+y*(B-A)+A;
    }
    cout << ans << endl;


}


Measured memory_bytes: 256
#include<stdio.h>

main(){
	int a,b,c;
	int bf;
	scanf("%d %d %d",&a,&b,&c);

	if(a > b){
		bf = a;
		a = b;
		b = bf;
	}

	if(b > c){
		bf = b;
		b = c;
		c = bf;
	}
	if(a > b){
		bf = b;
		b = a;
		a = bf;
	}

	printf("%d %d %d\n",a,b,c);
	
	return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int roughTotal = 0;
		int maxBlank = 0;
		for(int i = 0; i < 5; i++){
			a[i] = sc.nextInt();

			roughTotal += (a[i] + 9)/10*10;
			if(a[i]%10 != 0){
				maxBlank = Math.max(maxBlank, 10 - a[i]%10);
			}
		}

		System.out.println(roughTotal - maxBlank);
	}

}


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

int main() {
  string N;
  int S = 0;
  cin >> N;
  for (int i = 0; i < N.size(); i++) {
    S += N[i] - '0';
  }
  
  if (stoi(N) % S == 0){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  
  return 0;
}


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

int main(void) {
  string s;
  cin >> s;

  long long result = 0;
  int i = 0;
  long long lt = 0;
  long long gt = 0;
  while (i < s.size()) {
    while (s[i] == '<') {
      lt++;
      i++;
    }
    while (s[i] == '>'){
      gt++;
      i++;
    }

    long long mx, mn;
    mx = max(gt, lt);
    mn = max(0LL, min(gt, lt) - 1);
    result += mx * (mx + 1) / 2;
    result += mn * (mn + 1) / 2;
    gt = 0;
    lt = 0;
  }

  cout << result << endl;
  return 0;
}

Measured memory_bytes: 4296
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E15;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
////////////////////////////


 
int main(){fastio
    
    ll n;cin>>n;
    rep(i,1,9){
        rep(j,1,9){
            if(i*j==n){
                cout<<"Yes"<<endl;return 0;
            }
        }
    }
    cout<<"No"<<endl;
    
    return 0;
}


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

void compress(vector<int>& v) {
	auto vs = v;
	sort(vs.begin(), vs.end());
	vs.erase(unique(vs.begin(), vs.end()), vs.end());
	for (auto& val : v) {
		val = lower_bound(vs.begin(), vs.end(), val) - vs.begin();
	}
}

const int MAX = 2e5;

int main()
{
	ios::sync_with_stdio(false), cin.tie(0);
	int q;
	cin >> q;
	vector<int> c(q), x(q);
	for (int i = 0; i < q; i++) {
		cin >> c[i] >> x[i];
	}
	compress(x);
	vector<int> cnt(MAX);
	int size = 0;
	for (int i = 0; i < q; i++) {
		if (c[i] == 0) {
			if (!cnt[x[i]]) {
				cnt[x[i]] = 1;
				++size;
			}
			printf("%d\n", size);
		}
		else if (c[i] == 1) {
			puts(cnt[x[i]] ? "1" : "0");
		}
		else {
			if (cnt[x[i]]) {
				cnt[x[i]] = 0;
				--size;
			}
		}
	}
	return 0;
}



Measured memory_bytes: 5428
N, M = map(int, input().split())
lamp = []
for _ in range(M):
    lamp.append(list(map(int, input().split()))[1:])
P = list(map(int, input().split()))
res = 0
for bit in range(1<<N):
    on = 0
    for l in range(M):
        temp = 0
        for i in lamp[l]:
            i -= 1
            if (bit >> i) & 1 == 1:
                temp += 1
        if temp%2 == P[l]:
            on += 1
    if on == M:
        res += 1
print(res)

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

int main()
{
  int a,b;
  scanf("%d%d",&a,&b);
  int v=b-a,x,y;
  x=(v-1)*v/2;
  y=x+v;
  printf("%d\n",x-a);
    return 0;
}


Measured memory_bytes: 128
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        n: usize,
        k: usize,
        mut ab: [[usize; 2]; n],
    }
    ab.sort();
    // debug!(ab);
    let mut end = 0;
    for i in 0..n {
        end += ab[i][1];
        if k <= end {
            println!("{}", ab[i][0]);
            return;
        }
    }

}


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

const int mx=1e5+1;
int cost[mx],n;
int dp[mx]={-1};
int solve(int u)
{
    if(u==n) return 0;
    if(dp[u]!=-1) return dp[u];
    int ret1,ret2=1e9+1;
    ret1=abs(cost[u+1]-cost[u])+solve(u+1);
    if((u+2)<=n) ret2=abs(cost[u+2]-cost[u])+solve(u+2);
    return dp[u]=min(ret1,ret2);
}
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //freopen("input.txt","r",stdin);    return 0;

    cin>>n;
    for(int i=1;i<=n;i++) cin>>cost[i];
    memset(dp,-1,sizeof dp);
    cout<<solve(1);

    return 0;
}


Measured memory_bytes: 9100
#include <bits/stdc++.h>
#define nl ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long
#define all(v) (v).begin(), (v).end()
#define allr(v) (v).rbegin(), (v).rend()
#define pi acos(-1)

using namespace std;

int main() {
    nl // Bazzi - Paradise

    char c; cin >> c;

    cout << char(int(c+1));

    return 0;
}

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

#define int long long
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

signed main(){
	int n, m;
	cin >> n >> m;

	int a[100010];
	int sum = 0;

	for(int i = 0;i < n;i++){
		cin >> a[i];
		sum += a[i];
	}

	int cnt = 0;
	for(int i = 0;i < n;i++){
		if(a[i] * 4 * m >= sum) cnt++;
	}

	cout << (cnt >= m ? "Yes" : "No") << endl;

	return 0;
}


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

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rept(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define reps(i,s,n) for(int (i)=(s);(i)<(int)(n);(i)++)
#define repst(i,s,n) for(int (i)=(s);(i)<=(int)(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define each(itr,v) for(auto (itr):(v))
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp(x,y) make_pair((x),(y))
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln "\n"
#define dbg(x) cout<<#x" = "<<(x)<<ln

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<int> > mat;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int inf = (int)1e9;
const ll linf = (ll)1e18;
const int mod = (int)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

int n;
string s, t;

int main() {
	cin >> n >> s >> t;
	repr(i,n) {
		if (i==0 || s.substr(n-i,i) == t.substr(0,i)) {
			cout << 2*n-i << ln;
			break;
		}
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

vector<int> E[100001];
int D[100001];
int kotae;
int dfs(int A) {
	if (D[A]) return 1;
	D[A] = 1;
	int goukei = 0;
	for (int i : E[A]) {
		goukei += dfs(i) ^ 1;
	}
	if (goukei > 1) kotae = 1;
	cesp(A);
	ce(goukei);
	return goukei;
}

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


	int N;
	cin >> N;
	rep(i, N - 1) {
		int a, b;
		cin >> a >> b;
		E[a].pb(b);
		E[b].pb(a);
	}

	if (dfs(1) == 0) kotae = 1;

	if (kotae) co("First");
	else co("Second");

	Would you please return 0;
}

Measured memory_bytes: 8192
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
int main()
{
    int n;
    scanf("%d", &n);
    ll t;
    scanf("%lld", &t);
    for (int i = 2; i <= n; i++)
    {
        ll k;
        scanf("%lld", &k);
        t = t / __gcd(k, t) * k;
    }
    printf("%lld\n", t);
    return 0;
}


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

typedef long long ll;

int main() {
    int H, W;
    cin >> H >> W;
    vector<vector<int>> a(H, vector<int>(W)), ans;
    rep(i, H) {
        rep(j, W) {
            cin >> a[i][j];
        }
    }
    rep(i, H) {
        rep(j, W - 1) {
            if (a[i][j] % 2) {
                ans.push_back({i, j, i, j + 1});
                a[i][j]--;
                a[i][j + 1]++;
            }
        }
    }
    rep(i, H - 1) {
        if (a[i][W - 1] % 2) {
            ans.push_back({i, W - 1, i + 1, W - 1});
            a[i][W - 1]--;
            a[i + 1][W - 1]++;
        }
    }
    cout << ans.size() << "\n";
    rep(i, ans.size()) {
        rep(j, 4) {
            cout << ans[i][j] + 1;
            if (j == 3) cout << "\n";
            else cout << " ";
        }
    }
}

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n1,num;
    set<int> set1;
    cin >> n1;
    
    for(int i = 0;i < n1;++i){
        cin >> num;
        set1.insert(num);
    }
    
    cin >> n1;
    for(int i = 0;i < n1;++i){
        cin >> num;
        set1.insert(num);
    }
    
    for(set<int>::iterator it = set1.begin();it != set1.end();++it){
        cout << *it << endl;
    }
}



Measured memory_bytes: 21936
#include <iostream>

using namespace std;

static const int MAX = 200000;

int main () {

  int n, R[MAX];

  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> R[i];
  }

  int max = -1000000000;
  int min = R[0];

  for (int i = 1; i < n; i++) {

    if (max < R[i] - min) {
      max = R[i] - min;
    }

    if (min > R[i]) {
      min = R[i];
    }

  }

  cout << max << endl;

}

Measured memory_bytes: 3840
package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	ls := make([]int, n, n)
	max := 0
	maxIdx := -1
	for i := 0; i < n; i++ {
		var l int
		fmt.Scanf("%d", &l)
		if l > max {
			max = l
			maxIdx = i
		}
		ls[i] = l
	}
	sum := 0
	for i, v := range ls {
		if i != maxIdx {
			sum += v
		}
	}
	if sum > max {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 512
#include <stdio.h>
#include <math.h>

int evaluation(double x, double y){
    int xInt, yInt, i;
    xInt = x;
    yInt = y;
    
    if(xInt == 2){
        return 1;
    }
    for(i = 2; i < yInt + 1; i++){
        if(xInt % i == 0){
            break;
        }
    }
    if(i == yInt + 1){
        return 1;
    }else{
        return 0;
    }
}

int main(void){
    int n;
    double x, y;
    int ans = 0;
    char order[101];
    
    fgets(order, 100, stdin);
    sscanf(order, "%d", &n);
    
    for(int i = 0; i < n; i++){
        fgets(order, 100, stdin);
        sscanf(order, "%lf", &x);
        y = sqrt(x);
        ans += evaluation(x, y);
    }
    
    printf("%d\n", ans);
    return 0;
}


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

int main(){
	int N, i;
	scanf("%d", &N);
	vector<int> d(N);
	for(i = 0; i < N; i++){
		scanf("%d", &d[i]);
	}
	sort(d.begin(), d.end());
	printf("%d\n", d[N / 2] - d[N / 2 - 1]);
	return 0;
}

Measured memory_bytes: 640
from collections import Counter
N,K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
ca = Counter(A)
count = [[k, ca[k]] for k in ca]
count.sort(key = lambda x: x[1])
tn = 0
for i in range(len(count) - K):
    tn += count[i][1]
print(tn)

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

int main(){
  int n, t;
    cin >> n >> t;
  int x, ans=t, prev=0;
    cin >> x;
    for(int i=1; i<n; i++){
      cin >> x;
      ans += min(t, (x-prev));
      prev = x;
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include "iostream"
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
using namespace std;
using ll=long long;
#define mod  1000000007

int main(int argc, char const *argv[]) {
  int a,b;
  std::cin >>  a >> b;
  if(a+b<10)std::cout << a+b ;
  else std::cout << "error" << '\n';
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <climits>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <cstdio>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <list>

#define FOR(i,n) for(int i = 0 ; i < n ; i++)
#define ALL(a) a.begin(),a.end()

typedef long long int LLD; 

using namespace std;

int main() {
	int M , D;
	cin>>M>>D;
	int count = 0;
	for(int i = 1 ; i <= M ; i++) {
		for(int j = 1 ; j <= D ; j++) {
			if(j % 10 < 2 || j / 10 < 2)
				continue;
			if((j % 10) * (j / 10) == i) {
				//cout<<i<<" "<<j<<endl;
				count++;
			}
		}
	}
	cout<<count;
}

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

void trace(int a[],int n){
	for(int i=0;i<n-1;i++){
		cout << a[i] << " ";
	}
	cout << a[n-1] << endl;
}
void insertionSort(int a[],int n){
	int j, i, v;
	for(i=1;i<n;i++){
		v=a[i];
		j=i-1;
		while((j>=0)&&(a[j]>v)){
			a[j+1] = a[j];
			j--;
		}
		a[j+1]=v;
		trace(a,n);
	}
}



int main() {
	int n,j;
	int a[100];
	
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	
	trace(a,n);
	insertionSort(a,n);

	return 0;
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define double long double
#define x first
#define y second
#define long long long
#define int long 



           //       |----|       /\      |    |   -----   |
           //       |   /       /  \     |    |     |     |
           //       |--/       /----\    |----|     |     |
           //       |   \     /      \   |    |     |     |
           //       |    \   /        \  |    |   -----   -------

int n,k;
int arr[300006][3];
int cache[300006][5];
int dp(int i,int last)
{
	if(i==n)
		return 0;
	if(cache[i][last]!=-1)
		return cache[i][last];
	int maxi=0;
	for(int j=0;j<3;j++)
		if(j!=last)
			maxi=max(maxi,arr[i][j]+dp(i+1,j));
	return cache[i][last]=maxi;
}
int32_t main()
{
    IOS
    cin>>n;
    for(int i=0;i<n;i++)for(int j=0;j<3;j++)cin>>arr[i][j];
    	memset(cache,-1,sizeof(cache));
    cout<<dp(0,4);
}

Measured memory_bytes: 22400