akhauriyash/Code-Regression huggingface dataset:
while True:
    a, op, b = (x for x in input().split())
    if(op == "+"): print(int(a) + int(b))
    elif(op == "-"): print(int(a) - int(b))
    elif(op == "*"): print(int(a) * int(b))
    elif(op == "/"): print(int(a) // int(b))
    else: break


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

using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define REP(NAME, NUM) for (int NAME = 0; NAME < (NUM); ++NAME)
#define BREP(NAME, NUM) for (int NAME = (NUM)-1; NAME >= 0; --NAME)
#define ALL(NAME) (NAME).begin(), (NAME).end()

#define cMOD 1000000007ULL
#define cINF ((1ull<<62)-1)
#define cINFINT ((1<<30)-1)


int main()
{
	int a,b,c;cin>>a>>b>>c;
	REP(i,10)
	{
		c = a * c - b;
		cout << c << endl;
	}
	
	return 0;
}

Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define For(i, s, e) for(int i = s;i <= e;i++)
#define Sort(v, n) sort(v, v+n);
#define VSort(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define cY cout<<"Yes";
#define cN cout<<"No";
#define cA(a) cout<<a;
const ll MOD = 1000000007;


int main() {
    ll n,m;
    cin>>n>>m;
    ll sum = 0;
    rep(i,m) {
        int tmp;
        cin>> tmp;
        sum += tmp;
    }
    if(sum>n) {
        cout << -1;
    }else {
        cout << n - sum;
    }
}

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

using namespace std;

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

	priority_queue<int> h;
	int hi;
	for (int i = 0; i < n; i++) {
		cin >> hi;
		h.push(hi);
	}

	
	int64_t cnt = 0;
	while (!h.empty()) {

		if (k > 0) {
			h.pop();
			k--;
		}
		else {
			cnt += h.top();
			h.pop();
		}
	}

	cout << cnt << endl;
	return 0;
}

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

using namespace std;

#define int long long

int mod = (long long)(1e9) + 7;

signed main(){
	int n, k; cin >> n >> k;
	int a[n];
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	
	int res = 0;
	for(int i = 0; i < n; i++){
		for(int j = i+1; j < n; j++){
			if(a[j] < a[i]){
				 int mul = (k*(k+1))/2LL;
				 res += mul%mod;
				 if(res >= mod) res -= mod;
			}
			if(a[j] > a[i]){
				int mul = (k*(k-1))/2LL;
				res += mul%mod;
				if(res >= mod) res -= mod;
			}
		}
	}
	cout << res;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int X  = keyboard.nextInt();
		int N  = keyboard.nextInt();
		
		int p;
		final int nmax = 102;
		int[] hako  = new int[nmax];
		
		int ans = 0;
		
		for(int i=0; i<N; i++) {
			p = keyboard.nextInt();
			hako[p] = 1;
		}
		
		for(int j=0; j<nmax; j++) {
			if(X-j >=0 && hako[X-j] == 0){
				ans = X-j;
				break;
			} 
			else {
				if(X+j <nmax && hako[X+j] == 0){
					ans = X+j;
					break;
				}
			}
		}
		
		System.out.print(ans);
		keyboard.close();	
	}
}


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

template <typename T> struct BinaryIndexedTree {
    vector<T> data;

    BinaryIndexedTree(int sz) { data.assign(++sz, 0); }

    T sum(int k) {
        T ret = 0;
        for (++k; k > 0; k -= k & -k)
            ret += data[k];
        return (ret);
    }

    void add(int k, T x) {
        for (++k; k < (int)data.size(); k += k & -k)
            data[k] += x;
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, Q;
    cin >> N >> Q;
    vector<int> C(N);
    for (int i = 0; i < N; i++) {
        cin >> C[i];
        C[i]--;
    }
    vector<vector<pair<int, int>>> L(N);
    for (int i = 0; i < Q; i++) {
        int l, r;
        cin >> l >> r;
        l--, r--;
        L[r].emplace_back(make_pair(l, i));
    }
    vector<int> res(Q);
    unordered_map<int, int> mp;
    BinaryIndexedTree<int> ft(N + 1);
    for (int i = 0; i < N; i++) {
        if (mp.count(C[i]) > 0)
            ft.add(mp[C[i]], -1);
        ft.add(i + 1, 1);
        mp[C[i]] = i + 1;
        for (auto &x : L[i]) {
            res[x.second] = ft.sum(i + 1) - ft.sum(x.first);
        }
    }
    for (auto r : res) {
        cout << r << '\n';
    }
    return 0;
}


Measured memory_bytes: 51048
#include<bits/stdc++.h>
using namespace std;
int a,b;
int main()
{
    scanf("%2d%2d",&a,&b);
    if(a>=1&&b>=1&&a<=12&&b<=12)puts("AMBIGUOUS");
    else if(a>=1&&a<=12)puts("MMYY");
    else if(b>=1&&b<=12)puts("YYMM");
    else puts("NA");
    return 0;
}

Measured memory_bytes: 256
def m_c_d(x, y):
    if x == 0:
        return y
    elif y == 0:
        return x
    else:
        return m_c_d(y, x % y)


a = int(input())
b = 0
for i in range(int(a ** 0.5 + 1), 1, -1):
    b = max(m_c_d(a, i), b)
print(max(len(str(b)), len(str(a // b))))



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

int main(){
    int N, A, B, max, min;
    cin >> N >> A >> B;
    if (A < B)
        cout << A << " ";
    else
        cout << B << " ";
    
    if(A + B <= N)
        cout << 0 << endl;
    else
        cout << (A + B) - N << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#define ALL(x) (x).begin(), (x).end()
#define dll(x) scanf("%I64d",&x)
#define xll(x) printf("%I64d\n",x)
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define gg(x) getInt(&x)
#define db(x) cout<<"== [ "<<x<<" ] =="<<endl;
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll powmod(ll a,ll b,ll MOD){ll ans=1ll;while(b){if(b&1)ans=ans*a%MOD;a=a*a%MOD;b>>=1;}return ans;}
inline void getInt(int* p);
const int maxn=1000010;
const int inf=0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
int n;
map<ll,int> st;
ll a[maxn];
ll bin[2334];
int main()
{
	//    freopen("C:\\Users\\DH_M\\Desktop\\code_io\\in.txt.txt","r",stdin);
	//    freopen("C:\\Users\\DH_M\\Desktop\\code_io\\out.txt.txt","w",stdout);
	gbtb;
	cin>>n;
	repd(i,1,n)
	{
		cin>>a[i];
		st[a[i]]+=1;
	}
	sort(a+1,a+1+n,greater<int>());
	bin[0]=1ll;
	repd(i,1,33)
	{
		bin[i]=bin[i-1]*2ll;
	}
	int ans=0;
	repd(i,1,n)
	{
		if(st[a[i]]>0)
        {
            for(int j=33;j>=0;j--)
            {
                ll f=bin[j]-a[i];
                if(f<0)
                {
                    break;
                }
                if(st[f]>=1&&f!=a[i])
                {
//                    cout<<f<<" "<<a[i]<<endl;
                    ans++;
                    st[f]-=1;
                    st[a[i]]-=1;
                    break;
                }
                if(st[f]>=2&&f==a[i])
                {
//                    cout<<f<<" "<<a[i]<<"xyqnb"<<endl;
                    ans++;
                    st[f]-=1;
                    st[a[i]]-=1;
                    break;
                }
            }
        }
	}
	cout<<ans<<endl;
 
    return 0;
}
 
inline void getInt(int* p) {char ch;do {ch = getchar();}
while (ch == ' ' || ch == '\n');if (ch == '-') {*p = -(getchar() - '0');
while ((ch = getchar()) >= '0' && ch <= '9') {*p = *p * 10 - ch + '0';}}
else {*p = ch - '0';while ((ch = getchar()) >= '0' && ch <= '9')
{*p = *p * 10 + ch - '0';}}}

Measured memory_bytes: 77696
S=input()
K=int(input())
L=[""]
for s in range(len(S)):
    for e in range(s,len(S)):
        #print(S[s:e+1])
        if S[s:e+1] in L:
            continue
        if len(L)>K:
            if S[s:e+1]>L[K]:
                break
        if S[s:e+1] not in L:
            if len(L)<=K:
                L.append(S[s:e+1])
                L.sort()
            else:
                L.append(S[s:e+1])
                L.sort()
                L=L[:K+1]
                #print(L)
print(L[-1])

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

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
//#define LOG(...)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define RFOR(i, a, b) for (int i = (int)(b - 1); i >= (int)(a); --i)
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define RREP(i, n) for (int i = (int)(n - 1); i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(a) ((int)(a).size())
#define BIT(x, i) (((x) >> (i)) & 1)
#define SQ(x) ((x) * (x))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

bool augment(vvi& E, int from, vi& match_to, vb& visited) {
    if (from < 0) return true;
    for (int to : E[from]) {
        if (!visited[to]) {
            visited[to] = true;
            if (augment(E, match_to[to], match_to, visited)) {
                match_to[from] = to;
                match_to[to] = from;
                return true;
            }
        }
    }
    return false;
}

int bipartite_matching(vvi& E, int M, int N) {
    vi match_to(M+N, -1);
    int match = 0;
    REP(u, M) {
        vb visited(M+N);
        if (augment(E, u, match_to, visited)) match++;
    }
//    REP(u, L) if (matchTo[u] >= 0) matching.push_back({u, matchTo[u], 0});
    return match;
}

int main() {
    int M, N;
    while (cin >> M >> N, M | N) {
        vi b(M), r(N);
        REP(i, M) cin >> b[i];
        REP(i, N) cin >> r[i];

        vvi E(M+N);

        REP(i, M) {
            REP(j, N) {
                int e = __gcd(b[i], r[j]);
                if (e > 1) {
                    E[i].push_back(M+j);
                }
            }
        }
        cout << bipartite_matching(E, M, N) << endl;
    }
}

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

using namespace std;

void solve(){
   int n;
   cin >> n;
   int a = n % 10;
   if(a == 3){
    cout << "bon" << endl;
   }
   else if(a == 0 || a == 1 || a == 6 ||a == 8){
    cout << "pon" << endl;
   }
   else{
    cout << "hon" << endl;
   }
}

int main()
{
    solve();
    return 0;
}


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

int main()
{
    int ans=0;
    string s,t;
    cin>>s>>t;
    for(unsigned int i=0;i<s.length();i++)
    {
        if(s[i]!=t[i]) ans++;
    }
    cout<<ans;
}

Measured memory_bytes: 3920
#include <bits/stdc++.h>
using namespace std;
char s[105];
int c[105];
long long k;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> s+1;
    cin >> k;
    long long ans = 0;
    int n = strlen(s+1);
    if(n == 1) {
        cout << k/2;
        return 0;
    }
    int ch = 1;
    for(int i = 2;i <= n;i++) {
        if(s[i] != s[1]) {
            ch = 0;
            break;
        }
    }
    if(ch) {
        cout << n*k/2;
        return 0;
    }
    for(int i = 2;i <= n;i++) {
        if(!c[i-1]&&s[i] == s[i-1]) {
            ans++;
            c[i] = 1;
        }
    }
    long long rans = ans*k;
    if(!c[n]&&s[1] == s[n]) rans += k-1;
    memset(c,0,sizeof(c));
    long long ans2 = 0,rans2 = 0;
    for(int i = n-1;i >= 1;i--) {
        if(!c[i+1]&&s[i] == s[i+1]) {
            ans2++;
            c[i] = 1;
        }
    }
    rans2 = ans2*k;
    if(!c[1]&&s[1] == s[n]) rans2 += k-1;
    //cout << rans << " " << rans2 << '\n';
    cout << min(rans,rans2);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define F(i,s,e) for(int i=s;i<e;++i)
#define ll long long

int main()
{
    int k;
    cin >> k;
    cout << int(k/2) * int((k+1)/2) << endl;
    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define IO ios::sync_with_stdio(false); cin.tie(0);
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const int modulo = 1e9 + 7;
const int nmax = 1e5 + 10;
int n;
ll f[nmax][4];
int main() {
    IO;
    string s;
    cin >> s;
    n = s.length();
    s = "#" + s;
    for (int i = 1; i <= n; i++)
    for (int j = 0; j <= 3; j++)
        f[i][j] = 0;
    f[0][0] = 1;
    for (int j = 0; j <= 3; j++) 
    for (int i = 1; i <= n; i++) {
        if (s[i] - 'A' == j - 1) f[i][j] = f[i - 1][j] + f[i - 1][j - 1];
        else 
            if (s[i] == '?') f[i][j] = (j == 0 ? 0ll : f[i - 1][j - 1]) + 3ll * f[i - 1][j];
        else 
            f[i][j] = f[i - 1][j];
        f[i][j] %= modulo;
    }
    cout << f[n][3];
    return 0;
}


Measured memory_bytes: 3564
import math
import sys
input = sys.stdin.readline

n = int(input())
a = list(map(int, input().split()))
be = []
af = []
for i in range(math.floor(n/2)):
    be.append(a[n-(2*i)-1])
    af.append(a[n-(2*i)-2])
af.reverse()
if n%2 == 1:
    ans = be + [a[0]] + af
else:
    ans = be + af
for i in range(n):
    print(ans[i], end=' ')
print('\n')

Measured memory_bytes: 25160
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define ITR(x, c) for(__typeof(c.begin()) x = c.begin(); x != c.end(); x++)
#define all(v) v.begin(), v.end()
#define inputv(v, n)                                                           \
    vl v;                                                                      \
    rep(i, n) {                                                                \
        ll x;                                                                  \
        cin >> x;                                                              \
        v.push_back(x);                                                        \
    }
const ll INF = 999999999999999;
const ll MOD = 1000000007;
ll a, b, c, d, e, f, p, t, x, y, z, q, m, n, r, h, k, w, l, ans = 0;
#include <cstdint>

template <std::uint_fast64_t Modulus> class modint {
    using u64 = std::uint_fast64_t;

  public:
    u64 a;

    constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
    constexpr u64 &value() noexcept { return a; }
    constexpr const u64 &value() const noexcept { return a; }
    constexpr modint operator+(const modint rhs) const noexcept {
        return modint(*this) += rhs;
    }
    constexpr modint operator-(const modint rhs) const noexcept {
        return modint(*this) -= rhs;
    }
    constexpr modint operator*(const modint rhs) const noexcept {
        return modint(*this) *= rhs;
    }
    constexpr modint operator/(const modint rhs) const noexcept {
        return modint(*this) /= rhs;
    }
    constexpr modint &operator+=(const modint rhs) noexcept {
        a += rhs.a;
        if(a >= Modulus) {
            a -= Modulus;
        }
        return *this;
    }
    constexpr modint &operator-=(const modint rhs) noexcept {
        if(a < rhs.a) {
            a += Modulus;
        }
        a -= rhs.a;
        return *this;
    }
    constexpr modint &operator*=(const modint rhs) noexcept {
        a = a * rhs.a % Modulus;
        return *this;
    }
    constexpr modint &operator/=(modint rhs) noexcept {
        u64 exp = Modulus - 2;
        while(exp) {
            if(exp % 2) {
                *this *= rhs;
            }
            rhs *= rhs;
            exp /= 2;
        }
        return *this;
    }
};

using mint = modint<MOD>;
int main() {
    cin >> n >> k;
    vector<mint> kaijo(100001);
    kaijo[0] = 1;
    rep(i, n) { kaijo[i + 1] = kaijo[i] * (i + 1); }

    inputv(A, n);
    sort(all(A));
    t=A[0];
    rep(i,n){
        A[i]-=t;
    }

    mint ANS=0,X,Y;
    rep(i, n) {
        x = n - 1 - i;
        y = i;
        if(x < k - 1)
            X = 0;
        else
            X = kaijo[x] / (kaijo[k - 1] * kaijo[x + 1 - k]);
        if(y < k - 1)
            Y = 0;
        else
            Y = kaijo[y] / (kaijo[k - 1] * kaijo[y + 1 - k]);

        ANS += (Y - X)*A[i];
    }

   

    cout<<ANS.a<<endl;
}

Measured memory_bytes: 2168
#include <bits/stdc++.h>
using namespace std;
using f32 = float;
using f64 = double;
using LL = long long;
using ULL = unsigned long long;
#define REP(i, n) for (LL i = 0; i < (int)(n); i++)
int main()
{ 
 char a;
  cin>> a;
  a++;
  cout <<a;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    string s, t;
    cin >> s >> t;
    int m = s.length(), n = t.length();
    int lcs[m + 1][n + 1];
    for (int i = 0; i <= m; i++)
    {
        for (int j = 0; j <= n; j++)
        {
            if (i == 0 || j == 0) lcs[i][j] = 0;
            else if (s[i - 1] == t[j - 1]) lcs[i][j] = lcs[i][j] = lcs[i - 1][j - 1] + 1;
            else lcs[i][j] = max(lcs[i][j - 1], lcs[i - 1][j]);
        }
    }
    int i = m, j = n;
    string e = "";
    while (i > 0 && j > 0)
    {
        if (s[i - 1] == t[j - 1])
        {
            e += s[i - 1];
            i--;
            j--;
        }
        else
        {
            if (lcs[i][j - 1] > lcs[i - 1][j]) j--;
            else i--;
        }
    }
    reverse(e.begin(), e.end());
    cout << e;
}

Measured memory_bytes: 38712
#include <iostream>
#include <string>
#include <cctype>
using namespace std;

int main(){
    string str1, str2, str3;
    cin >> str1 >> str2 >> str3;
    cout << char(toupper(str1[0])) << char(toupper(str2[0])) << char(toupper(str3[0])) << endl;
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3

import sys, math, copy
# import fractions, itertools
# import numpy as np
# import scipy
# sys.setrecursionlimit(1000000)

HUGE = 2147483647
HUGEL = 9223372036854775807
ABC = "abcdefghijklmnopqrstuvwxyz"

def main():
    n, t = map(int, input().split())
    tn = list(map(int, input().split()))
    assert len(tn) == n
    su = 0
    till = 0
    for i in range(n):
        su += min(t, tn[i] + t - till)
        till = tn[i] + t
    print(su)

main()


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

using namespace std;

const int maxn=25;

int n,m,a[maxn][maxn],ans,d[maxn][maxn],vis[maxn][maxn];
int dx[5]={0,0,0,-1,1};
int dy[5]={0,-1,1,0,0};

inline bool can(int x,int y){
	if(x<1||y<1||x>n||y>m||a[x][y]) return 0;
	else return 1;
}

inline void bfs(int sx,int sy){
	queue<int> qx,qy;
	memset(d,0,sizeof(d));
	memset(vis,0,sizeof(vis));
	qx.push(sx);qy.push(sy);
	vis[sx][sy]=1;
	while(!qx.empty()){
		int x=qx.front(),y=qy.front();
		qx.pop();qy.pop();
		for(int k=1;k<=4;k++){
			int nx=x+dx[k],ny=y+dy[k];
			if(!can(nx,ny)||vis[nx][ny]) continue;
			d[nx][ny]=d[x][y]+1;
			vis[nx][ny]=1;
			ans=max(ans,d[nx][ny]);
			qx.push(nx);qy.push(ny);
		}
	}
}

int main(){
	cin>>n>>m;
	for(int i=1;i<=n;i++) for(int j=1;j<=m;j++){
		char opt;
		cin>>opt;
		if(opt=='#') a[i][j]=1;
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			if(a[i][j]==0) bfs(i,j);
		}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int n,m;
    cin>>n>>m;
    set<int> set;
    rep(i,m){
        int a;
        cin>>a;
        set.insert(a);
    }
    vi dp(n+1);
    dp[0]=dp[1]=1;
    REP(i,2,n){
        auto s1=set.find(i-1);
        auto s2=set.find(i-2);
        if(s1!=set.end()&&s2!=set.end()){
            continue;
        }
        if(s1!=set.end()){
            dp[i]+=dp[i-2];
            dp[i]%=mod;
        }
        else if(s2!=set.end()){
            dp[i]+=dp[i-1];
            dp[i]%=mod;
        }
        else{
            dp[i]+=(dp[i-1]+dp[i-2])%mod;
            dp[i]%=mod;
        }
    }
    cout<<dp[n]<<endl;
}

Measured memory_bytes: 5760
#include "bits/stdc++.h"
using namespace std;
typedef long long li;

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


    string s;
    cin >> s;
    string suffix;
    if (s.back() == 's') {
        suffix = "es";
    } else {
        suffix = "s";
    }
    cout << s << suffix << endl;
    return 0;
}

Measured memory_bytes: 3664
#include <bits/stdc++.h>
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define popcnt(x) __builtin_popcount(x)
#define inf 0x3f3f3f3f
#define watch(x) cout << (#x) << " is " << (x) << endl

using namespace std;
typedef long long  ll;
const int N = 1e3 + 4 , MOD = 1e9 + 7;

int memo[N][N] , n , m;
char g[N][N];

int add(int a , int b){
    return (1ll * a + b) % MOD;
}

bool valid(int i , int j){
    if(i >= n || j >= m || g[i][j] == '#')return false;
    return true;
}

int solve(int i , int j){
    if(i == n - 1 && j == m - 1)
        return 1;

    int &ret = memo[i][j];
    if(~ret)
        return ret;

    ret = 0;
    if(valid(i + 1 , j))ret = add(ret , solve(i + 1 , j));
    if(valid(i , j + 1))ret = add(ret , solve(i , j + 1));
    return ret;
}

int main() {
    ios::sync_with_stdio() , cin.tie(0) , cout.tie();
    cin >> n >> m;
    for(int i = 0 ; i < n ; ++i){
        for(int j = 0 ; j < m ; ++j)
            cin >> g[i][j];
    }

    memset(memo , -1 , sizeof memo);

    cout << solve(0 , 0) << '\n';
}


Measured memory_bytes: 5248
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <iomanip>
#include <map>
#include <set>
#include <tuple>
#include <unordered_map>
#include <iterator>
#include <string>
#include <limits>

using namespace std;

using i64 = int64_t;
using P = pair<i64, i64>;
i64 mod = 1000000007;
int int_max = 2147483647;
int max_n = 1e5;
using mat2d_t = std::vector<std::vector<int64_t>>;


int main(int argc, char **argv) {
    int n;
    cin >> n;

    cout << (n % 2 ? n/2+1 : n/2) << endl;

    return 0;
}

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

double ave(int x){
  int sum = 0;
  if(x==0)return 0;

  for(int i=1; i<(x+1); i++){
    sum +=i;
  }
  return static_cast<double>(sum)/x;
}

int main()
{
    int n,k;
    std::cin >> n >> k;
    std::vector<int> p(n+1);
    for(int i=1; i<n+1; i++)std::cin >> p[i];
    
    //std::cout<< p;
    std::vector<double> memo(n+1);
    for(int i=1; i<=n; i++){
      memo[i] = ave(p[i]);
      //std::cout<<"i:"<<i<<" p[]:"<<p[i]<<" memo:"<<memo[i]<<std::endl;
    }

    double ans =0;
    double tmp_sum = 0.0;
    for (int j = 1; j <=k; j++)
    {
      //std::cout<<"j:"<<j<<" memo[j]:"<<memo[j]<<std::endl;
      tmp_sum += memo[j];
    }
    ans = std::max(ans, tmp_sum);
    for(int i=1; i+k<=n; i++) {
        //std::cout<<"====\n";
        //std::cout<<"i-1:"<<i-1<<" i+k:"<<i-1+k<<std::endl;
        tmp_sum = tmp_sum - memo[i] + memo[i+k];
        ans = std::max(ans, tmp_sum);
    }
    printf("%.10f", ans);
    return 0;
}

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

int main(){
	
	int N,t[100010],c[100010][3],i,z;
	t[0]=0;
	c[0][1]=0;
	c[0][2]=0;
	
	scanf("%d",&N);
	
	for(i=1;i<=N;i++){
		scanf("%d",&t[i]);
		scanf("%d",&c[i][1]);
		scanf("%d",&c[i][2]);
	}
	
	for(i=1;i<=N;i++){
		z=abs(c[i][1]-c[i-1][1])+abs(c[i][2]-c[i-1][2]);
		if((t[i]-t[i-1]-z)<0||(t[i]-t[i-1]-z)%2==1){
			printf("\nNo\n\n");
			return 0;
		}
	}
	
	printf("\nYes\n\n");
	
	
	return 0;
}

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

using namespace std;

typedef long long ll;

const int INF = 1e9;

int d[105] = { -1 }, f[105] = { -1 };
int n = -1;
int mat[105][105] = { { 0 } };
int visited[105] = { 0 };

void dfs(int v, int& now)
{
  d[v] = now;
  visited[v] = 1;
  ++now;
  for (int u = 1; u <= n; ++u) {
    if (mat[v][u] && !visited[u]) {
      dfs(u, now);
    }
  }
  f[v] = now;
  ++now;
}

int main()
{
  fscanf(stdin, "%d", &n);
  for (int i = 0; i < n; ++i) {
    int u = -1, k = -1, v = -1;
    fscanf(stdin, "%d %d", &u, &k);
    for (int j = 0; j < k; ++j) {
      fscanf(stdin, "%d", &v);
      mat[u][v] = 1;
    }
  }
  int now = 1;
  for (int v = 1; v <= n; ++v) {
    if (!visited[v]) {
      dfs(v, now);
    }
  }
  for (int i = 0; i < n; ++i) {
    fprintf(stdout, "%d %d %d\n", i + 1, d[i + 1], f[i + 1]);
  }
  return 0;
}

Measured memory_bytes: 1236
#include <vector>
#include <stack>
#include <iostream>

using namespace std;

int sumup(stack<int> &stk) {
	int sum = 0;
	while (stk.size()) {
		sum += stk.top();
		stk.pop();
	}
	return sum / 2;
}

int main() {
	vector<char> vec;
	stack<int> stk;
	vector<int> result;

	int count = 0;	
	int depth = 0;
	char s;
	while (cin >> s) {
		vec.push_back(s);
	}

	int i = 0;
	while (i < vec.size()) {
		if (vec[i] != '\\') {
			++i;
			continue;
		}
		depth = 0;
		for (int j = i; j < vec.size(); ++j) {
			s = vec[j];
			if (s == '\\') {
				stk.push(2 * depth + 1);
				++depth;
			} else if (s == '/') {
				stk.push(2 * depth - 1);
				--depth;
			} else if (s == '_') {
				stk.push(2 * depth);
			}
			if (depth == 0) {
				result.push_back(sumup(stk));
				i = j + 1;
				break;
			}
		}
		if (depth) {
			while(stk.size()) stk.pop();
			++i;
		}
	}

	int sum = 0;
	for (int i = 0; i < result.size(); ++i) {
		sum += result[i];
	}
	cout << sum << endl;
	cout << result.size();
	for (int i = 0; i < result.size(); ++i) {
		cout << " " << result[i];
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 1312
#include <iostream>
#include <sstream>
#include <string>
using namespace std;

string JoinWithSpace(int *array, int size);

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

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

	int swap_count = 0;
	bool exist_adjacent = true;
	while (exist_adjacent) {
		exist_adjacent = false;
		for (int i = n - 1; i > 0; i--) {
			if (array[i] < array[i -1]) {
				swap(array[i], array[i - 1]);
				exist_adjacent = true;
				swap_count++;
			}
		}
	}
	cout << JoinWithSpace(array, n) << endl;
	cout << swap_count << endl;
	return 0;
}

string JoinWithSpace(int *array, int size) {
	ostringstream oss;
	for (int i = 0; i < size - 1; i++) {
		oss << array[i] << " ";
	}
	oss << array[size - 1];
	return oss.str();
}

Measured memory_bytes: 1224
import java.util.*;
import java.util.stream.Collectors;
import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	int H, W;
	int[] a;
	int N;
	int[] cell;
	int[][] result;

	Main(BufferedReader in) throws IOException {
		String[] tokens = in.readLine().split(" ");
		H = Integer.parseInt(tokens[0]);
		W = Integer.parseInt(tokens[1]);
		N = Integer.parseInt(in.readLine());
		a = new int[N];
		tokens = in.readLine().split(" ");
		for (int i = 0; i < N; ++i) {
			a[i] = Integer.parseInt(tokens[i]);
		}
		cell = new int[H * W];
		int index = 0;
		for (int i = 0; i < N; ++i) {
			for (int j = 0; j < a[i]; ++j) {
				cell[index] = i + 1;
				++index;
			}
		}
	}

	void calc() {
		result = new int[H][W];
		for (int i = 0; i < H * W; ++i) {
			int h = i / W;
			int w = i % W;
			if (h % 2 == 1) {
				w = W - 1 - w;
			}
			result[h][w] = cell[i];
		}
	}

	void showResult() {
		for (int i = 0; i < H; ++i) {
			System.out.print(result[i][0]);
			for (int j = 1; j < W; ++j) {
				System.out.print(" " + result[i][j]);
			}
			System.out.println("");
		}
	}
}

Measured memory_bytes: 29900
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >>N;
  vector<int> PI(N);
  for(int i=0; i<N;i++){
    cin >> PI.at(i) ;
  }
  int count =0;
  for(int i=0 ; i<N-2 ;i++){
    if(  (PI.at(i)-PI.at(i+1))*(PI.at(i+2)-PI.at(i+1)) <= 0  ){
      count ++;
    }
  }
  cout << count <<endl;
}



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

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#ifdef _DEBUG_
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl
#else
#define dump(val)
#endif

using namespace std;

typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}

template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

template<typename T>
void chmin(T &a, T b) {
    a = min(a, b);
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int A, B, Q;
    cin >> A >> B >> Q;
    vector<ll> S(A), T(B), X(Q);
    REP(i, 0, A) {
        cin >> S[i];
    }
    REP(i, 0, B) {
        cin >> T[i];
    }
    REP(i, 0, Q) {
        cin >> X[i];
    }
    sort(begin(S), end(S));
    sort(begin(T), end(T));

    auto calc = [&](ll a, ll b, ll x) {
        //cout << a << ' ' << b << ' ' << x << endl;
        if (min(a, b) < x && x < max(a, b)) {
            return max(a, b) - min(a, b) + min(max(a, b) - x, x - min(a, b));
        } else if (x < min(a, b)) {
            return max(a, b) - x;
        } else {
            return x - min(a, b);
        }
    };

    for (auto x : X) {
        auto si = lower_bound(begin(S), end(S), x) - begin(S);
        auto ti = lower_bound(begin(T), end(T), x) - begin(T);
        ll ans = 1LL << 60;
        if (si != A && ti != B) {
            chmin(ans, calc(S[si], T[ti], x));
        }
        if (si != A && ti != 0) {
            chmin(ans, calc(S[si], T[ti - 1], x));
        }
        if (si != 0 && ti != B) {
            chmin(ans, calc(S[si - 1], T[ti], x));
        }
        if (si != 0 && ti != 0) {
            chmin(ans, calc(S[si - 1], T[ti - 1], x));
        }
        cout << ans << endl;
    }
    return 0;
}


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

/*******  All Required define Pre-Processors and typedef Constants *******/
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define rep(i,n) for(int i=0; i<(n); ++i)
#define rep1(i,n) for(int i=1; i<=(n); ++i)
#define Dcout(a) cout << setprecision(20) << a << endl
#define MP make_pair
#define PB push_back
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
using ll = long long;
using PAIR = pair<int, int>;
using Graph = vector<vector<int>>;
//const ll INF = (1LL << 60);
//const double pi=acos(-1.0);
#define debug cout << "line : " << __LINE__ << " debug" << endl
/****** Template of some basic operations *****/
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
/**************************************/

/******** User-defined Function *******/

/**************************************/

/********** Main()  function **********/
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n; cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];

    sort(all(a));
    reverse(all(a));

    ll ans = a[0];
    int tmp = n - 2;
    rep1(i,tmp/2){
      ans += (a[i]*2);
    }


    if(tmp%2==1) ans += a[tmp/2+1];
    cout << ans << endl;
    
    return 0;
}
/********  Main() Ends Here *************/


Measured memory_bytes: 4776
n, k = gets.split.map &:to_i
arr = Array.new(n).map{Array.new(2,0)}
n.times do |i|
  a, b = gets.split.map &:to_i
  arr[i][0] = a; arr[i][1] = b
end
arr = arr.sort{|a, b| a[0] <=> b[0]}
sum = 0; i = 0
until sum >= k do
  sum += arr[i][1]; i += 1
end
puts arr[i-1][0]


Measured memory_bytes: 13688
while True:
	n, x = map(int, input().split())
	if n == 0 and x == 0:
		break
	ans = 0
	for i in range(1, n + 1):
		for j in range(1, i):
			for k in range(1, j):
				if i + j + k == x:
					ans += 1
	print(ans)



Measured memory_bytes: 5596
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int MAX_M = 50;
int a[MAX_M], b[MAX_M], n, m, ans;
bool visited[MAX_M], graph[MAX_M][MAX_M];

void dfs(int v) {
    visited[v] = true;
    for (int v2 = 0; v2 < n; v2++) {
        if (!graph[v][v2]) continue;
        if (visited[v2]) continue;
        dfs(v2);
    }
}

int main() {
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        scanf("%d %d", &a[i], &b[i]);
        a[i]--; b[i]--;
        graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
    }
    for (int i = 0; i < m; i++) {
        graph[a[i]][b[i]] = graph[b[i]][a[i]] = false;
        for (int j = 0; j < n; j++) visited[j] = false;
        dfs(0);
        for (int j = 0; j < n; j++) {
            if (!visited[j]) {
                ans++;
                break;
            }
        }
        graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
  int n,l;
  int sum = 0,min = 300,appletaste[201];
  scanf("%d %d",&n,&l);                                                           //入力
  for(int i = 1;i <= n;i++) appletaste[i] = l + i - 1;                            //味の定義
  for(int j = 1;j <= n;j++) if(abs(appletaste[j]) < abs(min)) min = appletaste[j];//味の絶対値の最小値計算
  for(int k = 1;k <= n;k++) sum += appletaste[k];                                 //合計値計算
                                                                                  //FOR DEBUG => for(int o = 1;o <= n;o++) printf("aplletaste[%d] = %d\n",o,appletaste[o]); 
  printf("%d\n",sum - min);                                                       //出力
  return 0;
}

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


int main()
{
    int h, w;
    cin >> h >> w;
    char c[h+2][w+2];
    for (int i = 1; i <= h; i++) {
        for (int j = 1; j <= w; j++) {
            cin >> c[i][j];
        }
    }

    int cnt = 0;
    
    for (int i = 1; i <= h; i++) {
        for (int j = 1; j <= w; j++) {
            if (c[i][j]=='#' && c[i][j-1] != '#' && c[i][j+1] != '#' && c[i-1][j] != '#' && c[i+1][j] != '#') {
                cnt++;
            }
        }
    }
    if (cnt == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

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

const int MAX_VALUE = 1000000;

class PrimeNumbers
{
public:
	vector<bool> primeNumbers;

	PrimeNumbers()
	{
		this->createPrimeNumbers();
	}
	
	int answer(int N)
	{
		int result = 0;
		for (int i = 0; i <= N; i++)
		{
			if (this->primeNumbers[i])
			{
				result++;
			}
		}
		return result;
	}

	void createPrimeNumbers()
	{
		
		this->primeNumbers = vector<bool>(MAX_VALUE, true);
		this->primeNumbers[0] = false;
		this->primeNumbers[1] = false;
		for (long long i = 2; i < MAX_VALUE; i++)
		{
			for (long long j = i * i; j < MAX_VALUE; j += i)
			{
				this->primeNumbers[j] = false;
			}
			
		}
	}

};

int main()
{
	int N;
	PrimeNumbers pn = PrimeNumbers();
	
	while(cin >> N)
	{
		cout << pn.answer(N) << endl;
	}
	return 0;
}

Measured memory_bytes: 3088
/*
	Created by : imay_10
	" It won't be EASY, but I'll make it "
*/

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

typedef long long int ll;
const int mod = 1e9+7;
const ll inf = 1e18;
const double pi = 3.1415926535897932384626;

// Utility for fast exponentiation
ll mpow(ll a,ll b,ll m){
    ll res=1;
    //a%=m;
    while(b){
    	if(b%2) res=res*a%m;
		a=a*a%m;
		b/=2;
	}
	return res;
}

// Utility for modular inverse
ll inv(ll a,ll m){
	return mpow(a,m-2,m);
}

// Utility for GCD Calculation
ll gcd(ll a,ll b){
	if(b==0) return a;
	return gcd(b,a%b);
}

void solve(){
	//code
	int a,b;
	cin>>a;
	cin>>b;
	if((a==1 and b==2) or (a==2 and b==1))
		cout<<3;
	if((a==2 and b==3) or (a==3 and b==2))
		cout<<1;
	if((a==1 and b==3) or (a==3 and b==1))
		cout<<2;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	solve();
 	return 0;
}


Measured memory_bytes: 3580
import collections


def func1(N):
    if N == 0:
        print(0)
    else:
        print((pow(2, int(N / 2)) % (pow(10, 9) + 7)))


def func2(G, N):
    G_list = list(G.values())

    if G_list.count(2) == len(G_list):
        N = N
    else:
        N = 0

    return N


def main():
    N = int(input())
    A = list(map(int, input().split()))
    G = dict(collections.Counter(A))

    if N % 2 == 1:
        if G[0] == 1:
            del G[0]
        else:
            N = 0

    N = func2(G, N)

    func1(N)


main()


Measured memory_bytes: 16344
#include<iostream>
#include<vector>
#include<cstring>
using namespace std;
typedef long long ll;
#define ip(arr, n) for(int i=0; i<n; i++) cin>>arr[i];
#define op(arr, n) for(int i=0; i<n; i++) cout<<arr[i]<<" ";
#define fstIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define mod 1000000007

ll comp[25][25], dp[25][(1<<21)];
ll n;

ll solve(ll i, ll womens){

    if(i==n){// consider all men, but women as we are pairing men with women
        return womens == 0; // 0men 0women gives 1 pair(empty empty)
    }

    if(dp[i][womens] != -1) return dp[i][womens];

    ll ans=0;
    for(ll w=0; w<n; w++){
        bool availability = womens&(1<<w);
        if(availability && comp[i][w]){
            ans = (ans + solve(i+1, womens&(~(1<<w))))%mod;
        }
    }
    return dp[i][womens] = ans;
}

int main(){
    fstIO;
    cin>>n;
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            cin>>comp[i][j];
        }
    }
    memset(dp, -1, sizeof(dp));
    cout<<solve(0, (1<<n)-1)<<endl;
    return 0;
}

Measured memory_bytes: 409856
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,n) for(int i=a;i<n;i++)
#define been(ix) (ix).begin(),(ix).end()
using namespace std;
typedef long long ll; 
typedef vector<int> vi;
typedef vector<long long> vl;
const ll INFL = 1e18;
const int INF = 1001001001; 
typedef pair<int,int> P;
#define foreach(ix,i) for(auto& (ix) : (i))
typedef long double ld;
const int mod =1000000007;
int main(){
    string s,t;
    cin>>s>>t;
    int n= s.length();
    int k = t.length();
    if(n+1!=k){
        cout<<"No"<<endl;
        return 0;
    }
    bool f= true;
    rep(i,n){
        if(s[i]!=t[i])f=false;
    }
    if(f)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <functional>
#include <queue>
#include <map>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
const int INF = 1e9 +7;

int main(){
    int n;
    cin >> n;
    int a = 10*10*10*10*10, b = 10*10*10*10, c = 10*10*10, d = 10*10, e = 10;
    if(n / a == 1){
        cout << 90909 << endl;
    }else if(n / b >= 1){
        cout << n - b + 1 + 900 + 9 << endl;
    }else if(n / c >= 1){
        cout << 909 << endl;
    }else if(n / d >= 1){
        cout << n - d + 1 + 9 << endl;
    }else if(n / e >= 1){
        cout << 9 << endl;
    }else{
        cout << n << endl;
    }
}

Measured memory_bytes: 256
import java.lang.Integer.min
import java.util.*

fun readInt(): Int = readLine()!!.toInt()
fun readInts(): List<Int> = readLine()!!.split(" ").map { it.toInt() }

fun parseInt(): Int {
    var digit = System.`in`.read()
    while(digit <= 32) {
        digit = System.`in`.read()
    }

    val negative = digit == '-'.toInt()
    if (negative) {
        digit = System.`in`.read()
    }
    var res = 0
    while (digit in '0'.toInt()..'9'.toInt()) {
        res *= 10
        res += digit - '0'.toInt()
        digit = System.`in`.read()
    }
    return if (negative) -res else res
}

fun gcd(x : Int, y : Int) : Int {
    var a = x
    var b = y
    var r = 0
    while(b > 0) {
        r = a % b
        a = b
        b = r
    }
    return a
}

fun main() {
//    val t = readLine()!!.toInt()
    val t = 1

    for(testNumber in 1..t) {
        val a = readLine()!!
        val b = readLine()!!

        var ans = 0
        for(i in 0 until a.length) {
            if(a[i] != b[i]) ++ans
        }

        println(ans)
    }
}

Measured memory_bytes: 40616
#include <iostream>
#include <set>
using namespace std;
 
int main(){
    int n;
    cin >> n;
    string s[n];
    for(int i=0; i<n; i++) cin >> s[i];
    set <string> st;
    for(int i=0; i < n; i++){
        int x = s[i].length();
        if(i+1 < n && s[i][x-1] != s[i+1][0]){
            cout << "No";
            return 0;
        }
        else if(st.count(s[i])){
            cout << "No";
            return 0;
        }
        st.insert(s[i]);
    }
    cout << "Yes";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ctime>
#include <cstdlib>
#define rep(i, N) for (int i = 1; i < (N); i++)
#define swap(a, b) (a += b, b = a - b, a -= b)
using namespace std;
int main()
{
    int K, X;
    cin >> K >> X;
    int X2 = X, X1 = X;
    rep(i, K )
    {
    
        cout << X-(K-i) << endl;
    }
    cout << X1 << endl;

    rep(i, K )
    {
        X2++;
        cout << X2 << endl;
    }
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	int n,m,t=0;
	cin>>n>>m;
	if(m==10)
	{
		while(n>0)
		{
			n/=10;
			t++;
		}
	}
	else
	{
		while(n>0)
		{
			int x=n%m;
			int y=n/m;
			n=y;
			t++;
			
			
		}
		
		
	}
	
	cout<<t;
	
	return 0;
}

Measured memory_bytes: 256
judge :: Bool -> (String,String) -> String
judge f (ts,fs) = case f of
  True -> ts
  False -> fs

canPay :: Int -> Int -> Bool
canPay n a = n `mod` 500 <= a

main = do
  contents <- getContents
  let
    [n,a] = map (read :: String -> Int) $ lines contents
    ret = canPay n a
  putStrLn $ judge ret ("Yes","No")
  

Measured memory_bytes: 508
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long N;
    long long ans=0,divnum=5;
    cin >> N;
    if(N%2){
        cout << 0;
    }else{
        N/=2;
        while(divnum<=N){
            ans+=N/divnum;
            divnum*=5;
        }
        cout << ans;
    }
    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)
typedef long long ll;

int N, M;
vector<vector<int>> swithes;
vector<int> p;


int main(){
    cin >> N >> M;
    swithes.resize(M);
    p.resize(M);
    rep(i, M){
        int k;
        cin >> k;
        rep(j, k){
            int l;
            cin >> l;
            --l;
            swithes[i].push_back(l);
        }
    }
    rep(i, M) cin >> p[i];
    int ans = 0;

    for(int bit = 0; bit < (1<<N); ++bit){
        bool flag = true;
        rep(i, M){
            int res = 0;
            for(int j = 0; j < swithes[i].size(); ++j){
                if( bit & (1<<swithes[i][j])) res++;
            }
            if(res % 2 == p[i]) continue;
            else{
                flag = false;
                break;
            }
        }
        if(flag) ans++;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
'use strict';
process.stdin.on('data', function(chunk) {
    var inputs = chunk.toString().trim().split('\n');
 
    for (var i = 0; i < inputs.length; i++) {
        if (inputs[i] === '0') {
            break;
        }
        console.log('Case ' + (i + 1) + ': ' + inputs[i]);
    }
});
process.stdin.resume();
process.stdin.setEncoding('utf8');

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

int main()
{
   int x;
   scanf("%d",&x);
   int flag=0;
   int i=0;
   int j=0;


  for(i=x; i>0;i++)
  {
      flag=0;
      for(j=2;j<i;j++)
       {
    if(i%j==0)
    {
        flag=1;
        break;

    }
    }
        if(flag==0)
       {
      printf("%d\n",i);
      break;
       }

   }



return 0;

}




Measured memory_bytes: 1736
#include<bits/stdc++.h>
#define maxi 100000
using namespace std;
int n,ansn,f[100010][5],ma,cm,x;
int main(){
	cin>>n;
	for (int i=1;i<=n;i++){
		scanf("%d",&x);f[x][i%2]++;
	}
	for(int i=1;i<=maxi;i++){
		if (f[i][0]>ma){
			cm=ma;ma=f[i][0];
		}else{
			if (f[i][0]>cm)cm=f[i][0];
		}
	}
	for (int i=1;i<=maxi;i++){
		if (f[i][0]==ma)ansn=max(cm+f[i][1],ansn);else ansn=max(ansn,f[i][1]+ma);
	}
	cout<<n-ansn<<endl;
	return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
typedef long long ll;
typedef vector<ll> vl;
#define rp(i, f, t) for (long long int i = f; i < t; i++)
#define pr(i, f, t) for (long long int i = t - 1; i >= f; i--)
#define ca(n, a) rp(ca_i, 0, n) cout << a[ca_i] << ((ca_i == n - 1) ? "\n" : " ")
#define ia(n, a) rp(ia_i, 0, n) cin >> a[ia_i]
#define za(n, a) rp(za_i, 0, n) a[za_i] = 0
#define be(a) a.begin(), a.end()
#define ce(a) cout << (a) << endl
int main()
{
    string s;
    cin >> s;
    int ans = 0;
    ll r = 0;
    rp(i, 0, 3) if (s[i] == 'R') r++;
    if (r > 0)
        ans = 1;
    if (s.substr(0, 2) == "RR")
        ans = max(ans, 2);
    if (s.substr(1, 2) == "RR")
        ans = max(ans, 2);
    if (s.substr(0, 3) == "RRR")
        ans = max(ans, 3);
    ce(ans);
}

Measured memory_bytes: 3492
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n);++i)
const int INF =1001001001;
using ll=long long;
using P = pair<int,int>;
using Graph =vector<string>;
Graph field;
queue<P> q;

int main() {
  ll ans,n,d;
  ans=0;
  d=0;
  cin>>n;
  rep(i,n){
    ll a;
    cin>>a;
    if(d>a){
      ans=ans+d-a;
    }
    d=max(d,a);
  }
  cout<<ans<<endl;

}


Measured memory_bytes: 3632
import numpy as np
N,M = (int(X) for X in input().split())
Shop = np.zeros((N,2),dtype=int)
for T in range(0,N):
    Shop[T,:] = (np.array([int(X) for X in input().split()]))
Shop = Shop[np.argsort(Shop[:,0])]
Rest = M
Pric = 0
for T in range(0,N):
    Pric += Shop[T,0]*Shop[T,1]
    Rest -= Shop[T,1]
    if Rest<0:
        Pric += Rest*Shop[T,0]
        break
print(Pric)

Measured memory_bytes: 30408
#include<iostream>
#include<string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <math.h>
#include<iomanip>
using namespace std;

int main()
{
    int L,R;
    cin >> L >> R;
    if(R-L>=2019)
    {
    cout << 0 << endl;
    }
    else
    {
        int answer = 0;
        int l = L%2019;
        int r = R%2019;
        if(r==0 || l==0)
        {
            cout << 0 << endl;
        }
        else if(r>l)
        {
            answer = (l*(l+1))%2019;
            for (int i = l; i < r+1; i++)
            {
                for (int j = i+1; j < r+1; j++)
                {
                    int num = (i*j)%2019;
                    if(num < answer) answer = num;
                }
                
            }
            cout << answer << endl;
            
        }else{
            cout << 0 << endl;
        }
    }
    
}

Measured memory_bytes: 256