akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main(void){
	char mozi[1001];
	cin>>mozi;
	int x=strlen(mozi);
	for(int i=0;i<x;i++){
		if(mozi[i]=='C'){
			mozi[i]='Z';
		}
		else if(mozi[i]=='A'){
			mozi[i]='X';
		}
		else if(mozi[i]=='B'){
			mozi[i]='Y';
		}
		else mozi[i]-=3;
		
	}
	for(int i=0;i<x;i++){
		cout<<mozi[i];
	}
	cout<<endl;
	return 0;
}



Measured memory_bytes: 3108
import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int n = sc.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];

        for (int i = 0; i< n; i++) {
            a[i] = sc.nextInt();
            b[i] = sc.nextInt();

        }

        int[] dp = new int[10001];
        for (int i = 0; i <= h; i++) {
            dp[i] = Integer.MAX_VALUE;
        }


        for(int i = 0; i < n; i++) {
            for(int j = 0; j < a[i]; j++) {
                dp[j] = Math.min(dp[j], b[i]);
            }

            for(int j = a[i]; j < h; j++) {
                dp[j] = Math.min(dp[j], dp[j - a[i]] + b[i]);
            }
        }
        System.out.println(dp[h - 1]);
    }
}



Measured memory_bytes: 26840
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();
        char[][] c = new char[H][W];
        boolean[][] bb = new boolean[H][W];

        for (int i = 0; i < H; i++) {
            String s = sc.next();
            for (int j = 0; j < W; j++) {
                c[i][j] = s.charAt(j);
            }
        }

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

        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                if (c[i][j] != '#') {
                    continue;
                }

                boolean b = false;
                for (int k = 0; k < 4; k++) {
                    int x = j + dx[k];
                    int y = i + dy[k];

                    if (x < 0 || x > W - 1) continue;
                    if (y < 0 || y > H - 1) continue;

                    if (c[y][x] == '#') {
                        b = true;
                        bb[i][j] = true;
                        break;
                    }
                }
                if (!b) {
                    System.out.println("No");
                    return;
                }
            }
        }

        System.out.println("Yes");
    }
}

Measured memory_bytes: 21584
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <queue>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <time.h>
#include <cassert>
#include <map>
#include <set>
#include <stack>
#include <time.h>
#include <cstdlib>
#include <cstring>
#include <string.h>
#include <bitset>
#include <ctype.h>

#include <complex>

#include <unordered_map>
//#include <unordered_set>
#define ll long long
#define ullong unsigned long long int
#define pb push_back
#define mp make_pair
#define endl "\n"

#define forit(it, x) for (__typeof(x.begin()) it = x.begin(); it != x.end(); it++)

#define f first
#define s second
#define all(x) x.begin(), x.end()
#define prev qweqewqewqwe

#define pii pair <int, int>

using namespace std;
const int MAXN = 2e6 + 10;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e15;
int a[10];
int main() {
    
#ifdef DEBUG
    double beg = clock();
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    
    //ios_base::sync_with_stdio(0);
    //cin.tie(0);
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        int x;
        scanf("%d", &x);
        a[x % 2]++;
    }
    a[0] += a[1] / 2;
    a[1] %= 2;
    while (a[0] > 1) {
        int x = a[0];
        a[0] = x / 2 + x % 2;
    }
    
    if (a[0] + a[1] == 1) {
        cout << "YES";
    } else {
        cout << "NO"
        ;    }
    
#ifdef DEBUG
    double end = clock();
    fprintf(stderr, "\n*** Total time = %.3lf ***\n", (end - beg) / CLOCKS_PER_SEC);
#endif
    return 0;
}

Measured memory_bytes: 256
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

#define REP(i,a,b) for(int i=a; i<=b; i++)

#define MOD 1000000007

void solve(int test_case) {//233
	int n,k;
	cin>>n>>k;
	vi arr(n);
	for(int &i:arr)cin>>i;
	sort(arr.begin(),arr.end());
	int mi = INT_MAX;
	REP(i,0,n-k) {
		mi=min(mi,arr[i+k-1]-arr[i]);
	}
	cout<<mi;
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


Measured memory_bytes: 3740
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,m,s,t,ans=1e13;
vector<ll> g[100005];
queue<ll> q;
bool a[100005][3];
ll lcd(ll x,ll y){
	if(x%y==0)return y;
	return lcd(y,x%y);
}
int main(){
	cin >> n >> m;
	for(int i=0;i<m;i++){
		cin >> s >> t;
		g[s-1].push_back(t-1);
	}
	cin >> s >> t;
	s--,t--;
	q.push(s),q.push(0),q.push(0),a[s][0]=1;
	while(!q.empty()){
		int x=q.front();q.pop();
		int y=q.front();q.pop();
		int z=q.front();q.pop();
		if(x==t and y==0){
			cout << z;
			return 0;
		}
		for(int i=0;i<g[x].size();i++){
			if(a[g[x][i]][(y+1)%3])continue;
			a[g[x][i]][(y+1)%3]=1;
			q.push(g[x][i]),q.push((y+1)%3);
			if(y==0)q.push(z+1);
			else q.push(z);
		}
	}
	cout << -1;
    return 0;
}

Measured memory_bytes: 6016
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
int main(){
  vector<int> data(32);
  data = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  int N;
  cin >> N;
  cout << data[N-1]<< endl;
  return 0;
}

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

using namespace std;

int main(){
    int H, W;
    cin >> H >> W;

    string lastrow = "null";
    int lmaxcpos = -1;
    for(int i = 0; i < H; i++){
        string crow;
        cin >> crow;
        int tmaxcpos;
        for(int j = 0; j < crow.length(); j++){
            if(lmaxcpos != -1 && j < lmaxcpos && crow[j] == '#')
                goto impossible;
            if(crow[j] == '#')
                tmaxcpos = j;
        }
        lmaxcpos = tmaxcpos;
    }
    cout << "Possible";
    return 0;
    
    impossible:
    cout << "Impossible";
    return 0;
}

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

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n, k;
	cin >> n >> k;
	vector<int> x(n);
	for (int i = 0; i < n; i++) {
		cin >> x[i];
	}
	int dist = 0;
	for (int i = 0; i < n; i++) {
		int dist_a = x[i] + x[i];
		int dist_b = (k - x[i]) + (k - x[i]);
		if (dist_a < dist_b) {
			dist += dist_a;
		} else {
			dist += dist_b;
		}
	}
	cout << dist << '\n';
	
	return 0;
}


Measured memory_bytes: 256
import sys
import math
from collections import Counter
import itertools
import fractions
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
 
A,B=MI()
 
print(lcm(A,B))

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

namespace AOJ.Volume2
{
    public class InputCandidates
    {
        public static int Main()
        {
            while (true)
            {
                int n = int.Parse(Console.ReadLine());
                if (n == 0) { break; }

                var dic = new Dictionary<string, int>();
                for(int i = 0; i < n; i++)
                {
                    var line = Console.ReadLine().Split(' ');
                    foreach(var s in line)
                    {
                        if (dic.ContainsKey(s)) { dic[s]++; }
                        else { dic.Add(s, 1); }
                    }
                }

                char k = Console.ReadLine()[0];
                var query = dic.Where(x => x.Key[0] == k).OrderByDescending(y => y.Value).ThenBy(z => z.Key).Take(5);
                string output = "";
                foreach (var q in query) { output += q.Key + " "; }
                if (string.IsNullOrEmpty(output)) { Console.WriteLine("NA"); }
                else { Console.WriteLine(output.Trim()); }
            }
            return 0;
        }
    }
}

Measured memory_bytes: 10780
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define PN cout << endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (n-1); i >= (int)(m); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v,c) sort(v.begin(), v.end(), greater<c>()) 
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - (a)) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - (a)) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

/*
ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
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; }
*/

/*
vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}
*/

/*
ll ncr[100][100];
ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

ll npr[100][100]={};
ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

ll nHr(int n,int r){ret nCr(n+r-1,r);}
*/

///////////////////////////////////////////////////////////////////////////



int main(){
    ll a,b;
    cin >> a >> b;
    P(a*b);
    /*
    ll n;
    cin >> n;

    ll a = 2;
    ll ans = 0;
    ll sq = sqrt(n);
    bool f = 0;
    while(sq >= a){
	ll cnt = 0;
	while(n%a == 0){
	    cnt++;
	    f = 1;
	    n /= a;
	}
	ll b = 1;
	while(cnt >= b){
	    ans++;
	    cnt -= b;
	    b++;
	}
	
	a++;
    }
    if(n > 1)ans = 1;
 
    P(ans);*/
    return  0;
}


Measured memory_bytes: 3604
// in the name of Allah

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

#define endl '\n'
#define pb push_back
#define ll long long
#define double long double
#define sz(x) ((int) (x.size()))

#define fr first
#define se second

#define inf 1e18
#define max_n 200002
#define mod 1000000007

ll add(ll a, ll b) {
	a += b;
	if(a >= mod) return a - mod;
	return a;
}

ll mul(ll a, ll b) {
	a *= b;
	if(a >= mod) return a % mod;
	return a;
}

ll power(ll a, ll b) {
	ll p = 1;
	while(b) {
		if(b&1) p = mul(p, a);
		a = mul(a, a);
		b /= 2;
	}
	return p;
}

/*

// a bit of NT

const int _N = 1234567;

ll F[_N];
ll IF[_N];

void init() {
	F[0] = 1;
	for(int i=1; i<_N; i++) F[i] = mul(F[i-1], i);
	IF[_N-1] = power(F[_N-1], mod-2);
	for(int i=_N-2; i>=0; i--) IF[i] = mul(IF[i+1], i+1);
}

ll ncr(ll x, ll y) {
	if(y > x || y < 0) return 0;
	return mul(F[x], mul(IF[x-y], IF[y]));
}

/**/

class mxLazySegTree {
public:
	int sz;
	vector <ll> tree, lazy;
	mxLazySegTree(int _sz) {
		sz = _sz;
		tree.assign(sz*4, 0);
		lazy.assign(sz*4, 0);
	}
	// update
	void update(int p, int L, int R, int l, int r, ll val) {
		if(lazy[p] != 0) {
			tree[p] += lazy[p];
			if(L != R) {
				lazy[2*p] += lazy[p];
				lazy[2*p+1] += lazy[p];
			}
			lazy[p] = 0;
		}
		if(R < l || r < L) return;
		if(l <= L && R <= r) {
			tree[p] += val;
			if(L != R) {
				lazy[2*p] += val;
				lazy[2*p+1] += val;
			}
			return;
		}
		int M = (L+R)/2;
		update(2*p, L, M, l, r, val);
		update(2*p+1, M+1, R, l, r, val);
		tree[p] = max(tree[2*p], tree[2*p+1]);
	}
	void update(int l, int r, ll val) {
		update(1, 0, sz-1, l, r, val);
	}
	// query
	ll query(int p, int L, int R, int l, int r) {
		if(R < l || r < L) return -1e18;
		if(lazy[p] != 0) {
			tree[p] += lazy[p];
			if(L != R) {
				lazy[2*p] += lazy[p];
				lazy[2*p+1] += lazy[p];
			}
			lazy[p] = 0;
		}
		if(l <= L && R <= r) return tree[p];
		int M = (L+R)/2;
		return max(query(2*p, L, M, l, r), query(2*p+1, M+1, R, l, r));
	}
	ll query(int l, int r) {
		return query(1, 0, sz-1, l, r);
	}
};

int n, m;
ll a[max_n];
int l[max_n], r[max_n];
vector <int> s[max_n];
vector <int> e[max_n];

int main() {
	// ll start = clock();
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> m;
	for(int i=0; i<m; i++) {
		cin >> l[i] >> r[i] >> a[i];
		s[l[i]].pb(i);
		e[r[i]].pb(i);
	}
	ll res = 0, ans;
	mxLazySegTree st(n+1);
	for(int i=1; i<=n; i++) {
		for(int id : s[i]) st.update(0, i-1, a[id]);
		ans = st.query(0, i-1);
		res = max(res, ans);
		st.update(i, i, ans);
		for(int id : e[i]) st.update(0, l[id]-1, -a[id]);
	}
	cout << res << endl;
	// cerr << (clock() - start) / (CLOCKS_PER_SEC*1.0) << endl;
	return 0;
}

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

using namespace std;

void solve()
{
   int a, b;
   cin >> a >> b;
   a--;
   cout << (b + a - 2) / a << endl;
}

int main()
{
    solve();
    cerr << "\"努力不足ですね！\"" << endl;
    return 0;
}

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

int main(){
    int a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f;
    bool water[3010] = {false}, suger[3010] = {false};
    a *= 100; b*=100;
    for(int i = 0; i<=f; i += a){
        for(int j = 0; i+j <= f; j += b)water[i+j] = true;
    }
    for(int i = 0; i<=f; i += c){
        for(int j = 0; i+j <= f; j += d)suger[i+j] = true;
    }
    //cout << water[800] << ' ' << suger[400] << endl;
    double conc[3] = {0.0, (double)a, 0.0};
    for(double i = 0.0; i <= f; ++i){
        for(double j = 0.0; j+i <= f; ++j){
            if(water[(int)i] && suger[(int)j]){
                if(conc[0] < j/(i+j) && j*100/i <= e){
                    conc[0] = j/(i+j); conc[1] = i; conc[2] = j;
                }
            }
        }
    }
    cout << conc[1] + conc[2] << ' ' << conc[2] << endl; return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace At
{
    class Program
    {
        static void Main(string[] args)
        {
            var dh = Reads();
            if (dh[0] == "H")
            {
                if (dh[1] == "H") WriteLine("H");
                else WriteLine("D");
            }
            else
            {
                if (dh[1] == "H") WriteLine("D");
                else WriteLine("H");
            }
        }

        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


Measured memory_bytes: 11092
// 12/07/2020  @ 19:54:17
// *****************************************************************
// *****************************************************************
#include <bits/stdc++.h>
// *****************************************************************
// *****************************************************************
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); srand(chrono::high_resolution_clock::now().time_since_epoch().count());
#define fr(i,n) for(llu i=0;i<n;i++)
#define fl(j,a,b) for(llu j=a;j<=b;j++)
#define Pi 3.1415926535897932384626
#define mod 1e9+7
#define MID(a,b) ((a + b) >> 1)
#define MAX(a,b) ((a) > (b) ? (a): (b))
#define MIN(a,b) ((a) < (b) ? (a) :(b))
#define pb push_back
#define mp make_pair
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector<ll>
#define pi pair<int, int>
#define pl pair<ll, ll>
#define printer(a, n) fr(i,n) cout << a[i] << " ";
// *****************************************************************
// *****************************************************************
typedef long long unsigned int llu;
typedef long long int ll;
// *****************************************************************
// *****************************************************************
using namespace std;
// *****************************************************************
// *****************************************************************

                   // Dream it. Wish it. Do it.

                         // tannatsri //

              // Without tact you can learn nothing.

// *****************************************************************
// *****************************************************************
bool rev(ll a, ll b) {
    return a > b;
}
// *****************************************************************
void solution() {
	char ch;
	cin >> ch;
	if(ch > 96) {
		cout << 'a';
	}
	else cout << 'A';

}
// *****************************************************************
int main() {
    IOS;
    // #ifndef ONLINE_JUDGE
        // freopen("C:/Users/Mr.Tanishq/Desktop/noc/input.txt", "r", stdin);
        // freopen("C:/Users/Mr.Tanishq/Desktop/noc/output.txt", "w", stdout);
        // freopen("C:/Users/Mr.Tanishq/Desktop/noc/error.txt", "w", stderr);
    // #endif
    // *****************************************************************
    // *****************************************************************
    int t = 1;
    // cin >> t;
    while(t--) {

       solution();
       cout << "\n";
    }
    return 0;
}

Measured memory_bytes: 3640
#include<cstdio>
#include<functional>
#include<algorithm>
using namespace std;
int main(void)
{
	int i,n,a[100],mx;
	scanf("%d",&n);
	for(i=0;i<n;i++)	scanf("%d",&a[i]);
	sort(a,a+n);
	mx=a[n-1]-a[0];
	printf("%d\n",mx);
	return 0;
}

Measured memory_bytes: 128
# import bisect
from collections import Counter, deque
# from copy import copy, deepcopy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline

def resolve():

    N=int(input())
    A=list(map(int,input().split()))
    AA=Counter(A)
    def main():
        for i in AA.values():
            if i>=2:
                return 'NO'
        return 'YES'
    print(main())

resolve()

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

#define D 200
#define N 200

#define max(a,b) (a>b?a:b)

int main() {
	int d, n, t[D], a[N], b[N], c[N], dp[D][N], ans=0;
	cin >> d >> n;
	for(int i=0; i<d; ++i) cin >> t[i];
	for(int i=0; i<n; ++i) cin >> a[i] >> b[i] >> c[i];
	for(int i=0; i<n; ++i) dp[0][i] = (a[i]<=t[0]&&t[0]<=b[i]?0:-1);
	for(int i=1; i<d; ++i) {
		for(int j=0; j<n; ++j) {
			dp[i][j] = 0;
			if(a[j]<=t[i]&&t[i]<=b[j]) {
				for(int k=0; k<n; ++k) {
					if(dp[i-1][k]!=-1) {
						dp[i][j] = max(dp[i][j], dp[i-1][k] + abs(c[j]-c[k]));
					}
				}
			}else dp[i][j] = -1;
		}
	}
	for(int i=0; i<n; ++i) ans = max(ans, dp[d-1][i]);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1320
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long h1,h2,m1,m2,k,d,e,count=0,i,j,count1=0;
    cin>>h1>>m1>>h2>>m2>>k;

    cout<<(60 * (h2 - h1) + m2 - m1 - k)<<endl;
    return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
 
const int N = 1e5 + 5;
 
int n;
int a[N];
 
int32_t main()
{
	IOS;
	cin >> n;
	int ans = 1;
	for(int i = 1; i <= n; i++)
		cin >> a[i];
	sort(a + 1, a + n + 1);
	if(a[1] == 0)
	{
		cout << 0;
		return 0;
	}
	long double cur = 1;
	for(int i = 1; i <= n; i++)
	{
		cur *= a[i];
		if(cur > 1e18 + 5)
		{
			cout << -1;
			return 0;
		}
		ans *= a[i];
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 4396
#include<bits/stdc++.h>
#include<boost/algorithm/string/replace.hpp>
#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::algorithm;
using namespace boost::multiprecision;
 
#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define ALL(x) (x).begin(),(x).end()

typedef long long ll;
typedef unsigned long long ull;
 
const int INF = 1e9;
const int MOD = 1e9+7;

template<typename T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//C++17以上
template<typename T>
T GCD(T a,T b){ return b ? GCD(b,a%b) : a ;}
template<typename T>
T LCM(T a,T b){ return a*b / GCD(a,b) ;}

template<typename T>//文字列の置換/Boost:replace_all()
T replace_str(T str, string target, string str_to) {
    string::size_type pos = 0;
    while (pos = str.find(target, pos), pos != string::npos) {
        str.replace(pos, target.length(), str_to);
        pos += str_to.length();
    }
    return str;
}

int main(){
    int n;cin >> n;
    vector<int> h(n);
    rep(i,n)cin >> h[i];
    int ans = 0;
    int Max = -1;
    for(int i=0;i<n-1;i++){
        if(h[i]>=h[i+1]){
            ans++;
        }else{
            chmax(Max,ans);
            ans = 0;
        }
    }
    chmax(Max,ans);
    cout << Max << endl;
    return 0;
}

Measured memory_bytes: 640
// Comment
// xx99999999

#include <bits/stdc++.h>

using namespace std;

#define SZ(v) ((int)(v).size())
#define ALL(v) (v).begin(),(v).end()
#define one first
#define two second
using ll = long long;
using pi = pair<int, int>;
const int INF = 0x3f3f3f3f;
const ll LINF = 1ll * INF * INF;

int S(ll v) {
	int res=0;
	while(v) res+=v%10, v/=10;
	return res;
}

ll F(ll v) {
	ll a = LINF / 1000, b = 1;

	int len = 0;
	ll temp = v;
	while(temp) len++, temp /= 10;

	ll p = 1;
	temp = v;
	for(int i=0; i<len; i++) {
		temp = temp / (p * 10) * (p * 10);
		temp += p - 1;
		for(int j=0; j<10; j++) {
			if (j != 0) temp += p;
			if (v > temp) continue;
			if (a * S(temp) > temp * b) {
				a = temp;
				b = S(temp);
			}
		}
		p *= 10;
	}
	return a;
}

int K;
int main() {
	cin >> K;
	ll now = 0;
	for(int i=1; i<=K; i++) {
		if(i == 1) now = 1;
		else{
			now = F(now+1);
		}
		printf("%lld\n", now);
	}
	return 0;
}



Measured memory_bytes: 3668
#include <stdio.h>

int find(int n, int k, int s){
  int ret=0;
  if(s<0)return 0;
  if(n<k)return 0;
  if(k==0)return s==0? 1:0;
  ret = find(n-1,k-1,s-n) + find(n-1,k,s);
  return ret;
}

int main(){
  int n,k,s;
  while(1){
    int ans=0;
    scanf("%d",&n);scanf("%d",&k);scanf("%d",&s);
    if(!(n+k+s))
      break;

    ans = find(n,k,s);

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


Measured memory_bytes: 2024
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  map<string,ll>cnt;
  ll ma = 0;
  for(int i=0;i<n;i++){
    string s;cin>>s;
    cnt[s]++;
    ma=max(ma,cnt[s]);
  }
  vector<string>vs;
  for(auto a:cnt){
    if(a.S == ma)
      vs.pb(a.F);
  }
  for(auto a:vs)cout<<a<<endl;
  return 0;
}


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

const long long INF = 1LL << 60;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define vi vector<int>
#define vii vector< vector<int> >

int N, K;
int A[110];
bool dp[110000];

int main() {

	cin >> N >> K;
	rep(i, N) cin >> A[i];
	
	//dp[i] = 山がi個のときに先手が勝つか？
	//dp[0] = False 0個には着手できない

	rep1(i, K+1) {
		rep(j, N) {
			if (i - A[j] < 0) continue;
			dp[i] = dp[i] || !(dp[i - A[j]]);
			if (dp[i]) break;
		}
	}

	if (dp[K]) cout << "First" << endl;
	else cout << "Second" << endl;

}


Measured memory_bytes: 384
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    long ans = 0;
    while ((N /= K) > 0) {
      ans++;
    }
    System.out.println(ans + 1);
  }
}


Measured memory_bytes: 21844
#include <iostream>
#include <vector>
#include <queue>

const int MAX = 1001;

std::vector<int> G[MAX];
int P[MAX];
int D[MAX];
int n,m;

int BFS(int v, bool print = false)
{
    std::queue<int> q;
    q.push(v);
    for (int i=1;i<=n;++i) P[i] = 0;
    for (int i=1;i<=n;++i) D[i] = 0;
    P[v] = v;
    int best = n+1;
    int bestw = -1;
    while (!q.empty())
    {
        int w = q.front();
        q.pop();
        for (int u : G[w])
        {
            if (P[u])
            {
                if (u == v)
                {
                    if (D[w] < best)
                    {
                        best = D[w];
                        bestw = w;
                    }
                }
            }
            else
            {
                P[u] = w;
                q.push(u);
                D[u] = D[w] + 1;
            }
        }
    }
    
    if (!print) return best;
    int w = bestw;
    std::cout << best+1 << "\n";
    while (w != v)
    {
        std::cout << w << "\n";
        w = P[w];
    }
    std::cout << v;
    return 0;
}

int main()
{
    std::ios_base::sync_with_stdio(0);
    std::cin>>n>>m;
    for (int i=0;i<m;++i)
    {
        int a,b;
        std::cin >> a >> b;
        G[a].push_back(b);
    }
    int v = -1;
    int best = n+1;
    for (int i=1;i<=n;++i)
    {
        int p = BFS(i);
        if (p < best)
        {
            best = p;
            v = i;
        }
    }
    if (v == -1) std::cout << -1;
    else BFS(v, true);
    return 0;
}

Measured memory_bytes: 384
include Math
# util functions

# debug
$debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if $debugFlag

def pd(str)
  p str if $debugFlag
end

# input
inputs = []
lc = 0
while l = $stdin.gets do
  if false
    inputs << l.chomp.split(" ").map(&:to_s)
  else
    inputs << l.chomp.split(" ").map(&:to_i)
  end
  lc += 1
end

# input check
if $debugFlag
  p "--- INPUT (begin) ---"
  inputs.each do |l_i|
    p l_i
  end
  p "--- INPUT (end) ---"
  print "\n"
end

nn = inputs[0][0].to_f
kk = inputs[0][1]
kkf = kk.to_f

# body
if $debugFlag
  p nn
  p kk
end

lg2 = log(2)

ans = 0
for i in 1..nn
  if i > kk
    break
  end
  ans += 1.0/(2**((log(kkf/i)/lg2).ceil))
  #p 1.0/(2**((log(kkf/i)/log(2)).ceil))
end

ans = ans / nn
if nn > kk
  ans += (nn - kk)/nn
end

puts ans

Measured memory_bytes: 1788
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<sstream>
#include<stack>
#include<string>
#include<unordered_set>
#include<vector>

#define ll long long
#define P pair<int,int>
#define FOR(i,N) for(int i=0;i<(int)N;i++)
#define FORIN(i,a,b) for(int i=a;i<(int)b;i++)
#define ALL(x) (x).begin(),(x).end()
#define LAST(x) (x)[(x).size()-1]
#define GI(name) int (name);scanf("%d",&(name))
#define GI2(name1,name2) int (name1),(name2);scanf("%d %d",&(name1),&(name2))
#define GI3(name1,name2,name3) int (name1),(name2),(name3);scanf("%d %d %d",&(name1),&(name2),&(name3))
#define GVI(name,size) vector<int> (name)(size);FOR(i,(size))scanf("%d",&(name)[i])
#define MOD 1000000007

using namespace std;

string to_hex(int x){
    stringstream ss;
    ss<<hex<<x;
    return ss.str();
}

inline int get_int(){
    int ret;
    scanf("%d",&ret);
    return ret;
}

inline vector<int> get_ints(int n){
    vector<int> ret(n);
    FOR(i,n){
        scanf("%d",&ret[i]);
    }
    return ret;
}

inline string get_str(){
    string ret;
    cin>>ret;
    return ret;
}

bool is_prime(int n){
    int s=sqrt(n)+1;
    for(int i=2;i<=s;++i){
        if(n%i==0){
            return 0;
        }
    }
    return 1;
}

vector<P> prime_division(int n){
    vector<P> ret;
    int s=sqrt(n)+1;
    int c=0;
    for(int i=2;i<=n;++i){
        if(n%i==0){
            c=0;
            do{
                ++c;
                n/=i;
            }while(n%i==0);
            ret.push_back(P(i,c));
        }
    }
    return ret;
}

struct UnionFind{
    vector<int> data;
    UnionFind(int size){
        data=vector<int>(size,-1);
    }
    bool union_set(int x,int y){
        x=root(x);
        y=root(y);
        if(x!=y){
            if(data[y]<data[x])swap(x,y);
            data[x]+=data[y];
            data[y]=x;
        }
        return x!=y;
    }
    bool find(int x,int y){
        return root(x)==root(y);
    }
    int root(int x){
        return data[x]<0?x:data[x]=root(data[x]);
    }
    int size(int x){
        return -data[root(x)];
    }
};

string to_string(string s){
    return s;
}

template<class T>
string to_string(vector<T> v){
    string ret="{";
    FOR(i,v.size()-1){
        ret+=to_string(v[i])+",";
    }
    if(v.size()>0){
        ret+=to_string(LAST(v));
    }
    ret+="}";
    return ret;
}

void debug_print(){
    cerr<<endl;
}

template<class Head,class... Tail>
void debug_print(Head head,Tail... tail){
    cerr<<to_string(head)<<" ";
    debug_print(tail...);
}

template<class... T>
void debug(T... args){
    cerr<<"["<<__LINE__<<"]: ";
    debug_print(args...);
}

void print(){
    cout<<endl;
}

template<class Head,class... Tail>
void print(Head head,Tail... tail){
    cout<<to_string(head);
    print(tail...);
}

int main(){
    GI2(N,K);
    GVI(h,N);
    vector<ll> dp(N,0);
    FORIN(i,1,N){
        vector<int> list;
        for(int j=i-1;j>=max(0,i-K);--j){
            list.push_back(dp[j]+abs(h[j]-h[i]));
        }
        dp[i]=*min_element(ALL(list));
    }
    print(dp[N-1]);
    return 0;
}

Measured memory_bytes: 1408
class UnionFind:
    def __init__(self, n):
        self.sz = [ -1 for i in range(n)]

    # 検索
    def find(self, x):
        if self.sz[x] < 0:
            return x
        else:
            self.sz[x] = self.find(self.sz[x])
            return self.sz[x]


    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False
        if self.sz[x] > self.sz[y]:
            x,y = y,x
        self.sz[x] += self.sz[y]
        self.sz[y] = x

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

    def size(self,x):
        return -self.sz[self.find(x)]


N,K,L = map(int,input().split())
ufpq = UnionFind(N)
ufrs = UnionFind(N)
for i in range(K):
    a,b = map(int,input().split())
    ufpq.union(a-1,b-1)
for i in range(L):
    a,b = map(int,input().split())
    ufrs.union(a-1,b-1)

pq = []
rs = []
from collections import defaultdict
d = defaultdict(int)
for i in range(N):
    d[(ufpq.find(i),ufrs.find(i))] += 1

ans = []
for i in range(N):
    ans.append(d[(ufpq.find(i),ufrs.find(i))])
print(" ".join(map(str,ans)))


Measured memory_bytes: 125212
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <complex>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long ll;

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

//container util
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define UNIQUE(a)  (a).erase(unique((a).begin(),(a).end()),(a).end())
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,b,a) for(int i=(b)-1;i>=(a);--i)
#define RREP(i,n) RFOR(i,n,0)

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << "[L " << __LINE__ << "] " << #x << " = " << (x) << "\n";

const int INF = 1e9;
const double EPS = 1e-10;

int n;

int main() {
	string s;
	string t = "YAKI";
	cin >> s;
	REP(i,4)if(s[i]!=t[i]){
		cout << "No"<<endl;
		return 0;
	}
	cout << "Yes"<< endl;
	return 0;
}


Measured memory_bytes: 256
X, Y = map(int, input().split())
statement = False
for a in range(X+1):
  for b in range(X-a+1):
    c = X - a - b
    if a * 10000 + b * 5000 + c * 1000 == Y:
      print(str(a) + " " + str(b) + " " + str(c))
      statement = True
      break
  if statement:
    break
if not statement:
  print("-1 -1 -1")

Measured memory_bytes: 3060
//ABC172_B
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(){
	char s[200005],t[200005];
	int sum=0,n=0;
	scanf("%s",s);
	scanf("%s",t);
	
	n = strlen(s);	//文字列の長さ取得
	
	for(int i=0;i<n;i++){	//n文字繰り返す
		if(s[i] != t[i]){	//i文字目を比較する
			sum = sum + 1;
		}
	}
	
	printf("%d",sum);
	
	return 0;
}


Measured memory_bytes: 2124
#include<bits/stdc++.h>
#define ll long long
#define dbg(x) cout<<#x<<": "<<x<<endl;
#define N 300005
#define M 1000000007
#define pii pair<ll,ll>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
map<int,int>mp;
main()
{
    int x,y;
    bool f=false;
    cin>>x>>y;
    for(int i=0;i<=x;i++)
    {
        if(i*2+(x-i)*4==y)
            f=true;
    }
    if(f)
        cout<<"Yes";
    else
        cout<<"No";
}



Measured memory_bytes: 3636
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    K = I()
    A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51] 
    print(A[K-1])


main()



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

using namespace std;
#define ll long long

ll const lmt = 2e5+6;




int main()
{
    int a,b,c,d,e,f,g,h,j,i;
 int k,sum=0,tc;
 
    string s,s1;
    cin>>s>>s1;
    map<char, int> m, m1;
    string ans = "Yes";
    for( i=0; i<s.size(); i++)
    {
        m[s[i]]++;
        m1[s1[i]]++;
        if(m[s[i]] != m1[s1[i]])
        {
            ans = "No";
            break;
        }
    }
    cout<<ans<<endl;
}






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

int main(){
    int x, y, a, b, c;
    cin >> x >> y >> a >> b >> c;

    ll p[a], q[b], r[c];
    for(int i = 0; i < a; i++){
        cin >> p[i];
    }
    for(int i = 0; i < b; i++){
        cin >> q[i];
    }
    for(int i = 0; i < c; i++){
        cin >> r[i];
    }

    sort(p, p + a, greater<ll>());
    sort(q, q + b, greater<ll>());
    sort(r, r + c, greater<ll>());

    ll ans = 0;
    for(int i = 0; i < x; i++){
        ans += p[i];
    }
    for(int i = 0; i < y; i++){
        ans += q[i];
    }

    int p_poj = x - 1;
    int q_poj = y - 1;
    for(int i = 0; i < c; i++){
        if(p_poj >= 0 && q_poj >= 0){
            if(p[p_poj] > r[i] && q[q_poj] > r[i]){
                break;
            }else{
                if(p[p_poj] >= q[q_poj]){
                    ans -= q[q_poj];
                    ans += r[i];
                    q_poj--;
                }else{
                    ans -= p[p_poj];
                    ans += r[i];
                    p_poj--;
                }
            }
        }else if(p_poj >= 0){
            if(p[p_poj] < r[i]){
                ans -= p[p_poj];
                ans += r[i];
                p_poj--;
            }
        }else if(q_poj >= 0){
            if(q[q_poj] < r[i]){
                ans -= q[q_poj];
                ans += r[i];
                q_poj--;
            }
        }else{
            break;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 2560
#include<iostream>
#define ll long long
#define MOD 1000000007

using namespace std;
int main()
{
    int n,w;
    cin>>n>>w;
    ll int *weights=new ll int[n];
    ll int *value=new ll int[n];
    ll int sum=0;
    for(int i=0;i<n;i++)
    {
        cin>>weights[i];
       cin>>value[i];
        sum+=value[i];
    }
    ll int **dp=new ll int*[n+1];
    for(int i=0;i<=n;i++)
    {
        dp[i]=new ll int[sum+1]();
        for(int p=0;p<=sum;p++)
            dp[i][p]=INT_MAX;
    }
    int myres=0;
    for(int i=0;i<=n;i++)
        dp[i][0]=0;
        for(int i=1;i<=n;i++)
        {
            for(int j=1;j<=sum;j++)
            {
            if(value[i-1]<=j)
                dp[i][j]=min(dp[i-1][j],dp[i-1][j-value[i-1]]+weights[i-1]);
            else
                dp[i][j]=dp[i-1][j];
           
            if(dp[i][j]!=0&&dp[i][j]<=w)
            {
               
                myres=max(myres,j);
            }
              
        }
          
    }
    cout<<myres<<endl;
}


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

int main(){
    // 引数の受け取り
    int A,B,C;
    scanf("%d %d %d", &A, &B, &C);
    int F = 0;
    F = (A+B)*C/2;

    printf("%d", F);
    return 0;
}


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

int main(){
    int a, b;
    cin >> a >> b;
    if(a==b){
        cout << a+b;
    }
    else if(a-b>=1){
        cout << a*2-1;
    }
    else if(b-a>=1){
        cout << b*2-1;
    }
    cout << endl;
    return 0;
}


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

#define INF 2e9

#define REP(i,n) for(int i = 0; i < n;++i)
#define REPA(i,a,n) for(int i = a; i < n; ++i)
#define REPR(i,a) for(int i = a; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector< vector<int> > vvi;

//int gcd(int a, int b){ return b ? gcd(b, a % b) : a; }
template<typename A> void psn(A a){ cout << a << endl; }
template<typename A, typename... B> void psn(A a, B... b){ cout << a << ' '; psn(b...); }

ll gcd(ll x, ll y){
    if(y == 0) return x;
    
    return gcd(y, x % y);
}

ll lcm(ll x, ll y){
    return (ll)(x * y) / gcd(x, y);
}

int main(void){
    
    ll A, B;
    
    cin >> A >> B;
    
    ll ABlcm = lcm(A, B);
    
    cout << ABlcm << endl;;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
    REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

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; }

const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};

const int dx8[8] = {1,1,0,-1,-1,-1,0,1};
const int dy8[8] = {0,1,1,1,0,-1,-1,-1};

vector< vector<int> > Graph;
vector< int > value;





int main(int argc, const char * argv[]) {
    
    // remove the bottom 3 lines when you submit this code.
    std::ifstream in("sample.txt");
    std::cin.rdbuf(in.rdbuf());

    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int x,a,b; cin >> x >> a >> b;
    if(abs(x-a) > abs(x-b)) cout << "B" << endl;
    else if(abs(x-a) < abs(x-b)) cout << "A" << endl;
}



Measured memory_bytes: 256
import java.io.BufferedReader
import java.util.*

fun main() = abc138e()

@OptIn(ExperimentalStdlibApi::class)
fun abc138e() = SimpleFastIOWithToken_abc138e().exec {
    val s = readString()
    val t = readString()
    fun Char.toIndex() = this - 'a'

    val nextAppearDist = Array(26) { IntArray(s.length) }
    val repeatedS = s.repeat(2)

    for (tChar in t.toSet()) {
        var distToNext = 1
        for (i in repeatedS.indices.reversed()) {
            if (i in s.indices) nextAppearDist[tChar.toIndex()][i] = distToNext
            if (repeatedS[i] == tChar) distToNext = 1 else distToNext++
        }
        if (distToNext - 1 == repeatedS.length) return@exec println(-1)
    }

    var before = s.lastIndex
    var answer = 0L

    for (tChar in t) {
        val nextDist = nextAppearDist[tChar.toIndex()][before % s.length]
        answer += nextDist
        before = (before + nextDist) % s.length
    }

    println(answer)
}

// region kokokara template dayo (^o^)
@Suppress("unused", "HasPlatformType", "MemberVisibilityCanBePrivate", "ClassName")
private class SimpleFastIOWithToken_abc138e(private val separator: String = System.lineSeparator()) {
    private val br: BufferedReader = System.`in`.bufferedReader()
    private var st: StringTokenizer = StringTokenizer("")
    private val sb: StringBuilder = StringBuilder()
    private fun prepareNext() = run { if (!st.hasMoreTokens()) st = StringTokenizer(br.readLine()) }

    fun readString(): String = run { prepareNext() }.run { st.nextToken() }
    fun readStringList(size: Int): List<String> = List(size) { readString() }
    fun readInt(): Int = Integer.valueOf(readString())
    fun readIntList(size: Int): List<Int> = List(size) { readInt() }
    fun readLong(): Long = java.lang.Long.valueOf(readString())
    fun readLongList(size: Int): List<Long> = List(size) { readLong() }
    inline fun <reified T> readArray(size: Int, init: () -> T) = Array(size) { init() }
    inline fun <T> readList(size: Int, init: () -> T) = List(size) { init() }

    fun println(): Unit = run { sb.append(separator) }
    fun print(any: Any): Unit = run { sb.append(any) }
    fun println(any: Any): Unit = print(any.toString() + separator)

    fun exec(action: SimpleFastIOWithToken_abc138e.() -> Unit) = run {
        Thread(null, { action() }, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()
    }.run { kotlin.io.print(sb) }

    fun readLine(): Nothing = error("readLine is disabled.")
}
// endregion kokomade template dayo (^o^)


Measured memory_bytes: 51600
using System;
using System.Linq;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] AB = Console.ReadLine().Split(' ').Select(e => int.Parse(e)).ToArray();
            if (AB[0] <= 9 && AB[1] <= 9)
            {
                Console.WriteLine(AB[0]*AB[1]);
            }
            else
            {
                Console.WriteLine("-1");
            }
        }
    }
}

Measured memory_bytes: 13396
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main(void){
  ll h,w;
  cin >> h >> w;
  if(w <= 1 || h <= 1){
    cout << 1 << endl;
    return 0;
  }
  ll cnt = 0LL;
  cnt += ((w+1)/2) * ((h+1)/2);
  cnt += (w/2) * (h/2);
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
const ll mod=1e9+7;
const int inf=1<<30;

int main(){
  string s;
  cin >> s;
  int gt=0,pt=0;
  rep(i,s.size()){
    if(s[i]=='g') gt++;
    else pt++;
  }
  int pa=s.size()/2;
  cout << pa-pt << endl;
}

Measured memory_bytes: 512
N, T = map(int, input().split())

c = []
t = []
for _ in range(N):
    _c, _t = map(int, input().split())

    if _t <= T:
        c.append(_c)
        t.append(_t)

if len(c) == 0:
    print('TLE')
else:
    print(min(c))
    

Measured memory_bytes: 2940
import java.io.PrintWriter;
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		//String S = sc.next();
		//int N = Integer.parseInt(sc.next());
		//out.println();
		// ArrayList<String> list = new ArrayList<String>();
		// list.stream().sorted().distinct();
		
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		if(A+B>=10){
			out.println("error");
		}else {
			out.println(A+B);
		}
		out.flush();	
	}
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int N; cin >> N;
  int maxa, mina;
  cin >> maxa >> mina;
  if (maxa < mina) swap(maxa, mina);
  for (int i = 2; i < N; i++) {
    int A; cin >> A;
    if (maxa < A) maxa = A;
    else if (mina > A) mina = A;
  }
  cout << abs(maxa - mina) << "\n";
}

Measured memory_bytes: 256