akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi; 
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;

#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define ini(a, i) memset(a, i, sizeof(a))
#define contains(c, i) ((c).find(i) != (c).end())
#define present(i, c) (find(all(c), i) != (c).end())

#define rep(i, n) for(int i = 0; i < n; i++)
#define repa(i, b, e) for(int i = (b)-((b)>(e)); i != (e)-((b)>(e)); i += 1-2*((b)>(e)))

#define dbg(x) cerr << #x << " = " << x << endl;
#define dbgall(x) cerr << #x << " = "; for(auto i_ : x) cerr << i_ << " "; cerr << endl;
#define debug(args...) { string s_(#args); replace(all(s_), ',', ' '); stringstream ss_(s_); istream_iterator<string> it_(ss_); cerr_(it_, args); }
void cerr_(istream_iterator<string> it) { (void) it; }
template<class T, class... Args> void cerr_(istream_iterator<string> it, T a, Args... args) { cerr << *it << " = " << a << endl; cerr_(++it, args...); }

template<class T, class S>  ostream& operator<<(ostream& os, const pair<T, S>& p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<class T> ostream& operator<<(ostream &os, const set<T> &s) { os << '{'; string sep; for (const auto &x : s) os << sep << x, sep = ", "; return os << '}'; }
template<class T, class S> ostream& operator<<(ostream &os, const map<T, S> &m) { os << '{'; string sep; for (const auto &x : m) os << sep << x, sep = ", "; return os << '}'; }
template<class T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }

//=========================

void run_test() {
	int n, m; cin >> n >> m;
	int t = 0;
	rep(i, m) {
		int a; cin >> a;
		t += a;
	}
	if(t > n) cout << -1 << endl;
	else cout << n - t << endl;
}

//=========================

int main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);
	//int t_ = 1, t__; cin >> t__; while(t_ <= t__) { cout << "Case #" << t_++ << ": "; run_test(); }
	// int t_; cin >> t_; while(t_--) run_test();
	run_test();
	return 0;	
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    int n; cin>>n;
    cout << (1000-(n%1000))%1000 << '\n';
    return 0;
}

Measured memory_bytes: 3596
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<iomanip>
#include<sstream>
#include<map>
#include<set>
#include<cmath>
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T& val) {
	std::fill((T*)array, (T*)(array + N), val);
}
#define rep(i,n) for(int i = 0;i < n;i++)
#define req(i,n) for(int i = 1;i <=n;i++)
#define rrep(i,n) for(int i = n -1;i >= 0;i--)
#define ALL(a) a.begin(),a.end()
typedef long long ll;
typedef long double ld;
const ll INF =  1LL << 60;
const int inf = 1 << 20;
ll n, m, x, y, q, d,z, w = 0, sum = 0, ans = 0;
const int MAX = 510000;
const int MOD = 1000000007;
int main(void) {
	cin >> n; vector<ll> a(n);
	rep(i, n) {
		cin >> a[i]; sum ^= a[i];
	}
	rep(i, n) {
		ans = sum ^ a[i];
		cout << ans << " ";
	}cout << endl;
}

Measured memory_bytes: 4776
class COM:
    def __init__(self, n: int, mod: int):
        self.n = n
        self.mod = mod
        self.fact = [0] * (n + 1)
        self.factinv = [0] * (n + 1)
        self.inv = [0] * (n + 1)
        
        self.fact[0] = self.fact[1] = 1
        self.factinv[0] = self.factinv[1] = 1
        self.inv[1] = 1
        for i in range(2, n + 1):
            self.fact[i] = (self.fact[i - 1] * i) % mod
            self.inv[i] = (-self.inv[mod % i] * (mod // i)) % mod
            self.factinv[i] = (self.factinv[i - 1] * self.inv[i]) % mod
    
    def get_cmb(self, n: int, k: int):
        if (k < 0) or (n < k):
            return 0
        k = min(k, n - k)
        return self.fact[n] * self.factinv[k] % self.mod * self.factinv[n - k] % self.mod


def solve():
    n = int(input())
    a = list(map(int, input().split()))
    MOD = 10 ** 9 + 7
    
    pos = dict()
    l, r = -1, -1
    for i in range(n + 1):
        if a[i] in pos:
            l, r = pos[a[i]], i
            break
        pos[a[i]] = i
    
    com = COM(10 ** 5 + 1, MOD)
    print(n)
    for i in range(2, n + 1):
        ans = com.get_cmb(n + 1, i) - com.get_cmb(l + n - r, i - 1)
        print(ans % MOD)
    print(1)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 29660
#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
 
using namespace std;
 
int main() {
  int K,T,ma=0;
  cin >> K >> T;
  int a[T+10];
  for(int i=0; i<T; i++){
    cin >> a[i];
    ma=max(a[i],ma);
  }
  cout << max(ma-1-(K-ma),0) << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B_Algae
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] x = new int[11];
            string[] str = Console.ReadLine().Split(' ');
            int r = int.Parse(str[0]);
            int D = int.Parse(str[1]);
            x[0] = int.Parse(str[2]);

            for(int i = 1; i <= 10; i++)
            {
                x[i] = r * x[i - 1] - D;
                Console.Write(x[i].ToString()+"\r\n");
            }
            //Console.ReadKey();
        }
    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <vector>
#include <string>
#include <cctype>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cfloat>
#include <algorithm>
#include <memory>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned uint;
typedef long double l_double;

#define vtr vector
#define PB push_back
#define EB emplace_back
#define gcd __gcd
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define st_ct static_cast // <>
#define TEST uint _ {}; cin >> _; while (_--)
#define PI (3.1415926535897932384626433832795)
#define MOD st_ct<int>(1e9 + 7)
#define EPS 1e-9
#define deb1(x) cerr << #x << " -> " << x << endl;
#define deb2(x,y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ")" << endl;
#define deb3(x,y,z) cerr << "(" << #x << ", " << #y << ", " << #z << ") -> (" << x << ", " << y << ", " << z << ")" << endl;
#define debVV(V) cerr << #V << ":\n" << V << endl; // 2D

// 1D
template<typename T>
istream& operator>>(istream &is, vector<T> &A) {
    for (T &v: A)
        is >> v;
    return is;
}

template <typename T>
ostream& operator<<(ostream &os, const vector<T> &A) {
    for (T const &v: A)
        os << v << " ";
    return os;
}

template<typename T>
void vtrV(const vector<T> &A)
{ for (T const &val: A) cout << val << endl; }

// 2D
template<typename T>
istream& operator>>(istream &is, vector<vector<T>> &A) {
    for (vector<T> &i: A)
        for (T &j: i)
            is >> j;
    return is;
}

template <typename T>
ostream& operator<<(ostream &os, const vector<vector<T>> &A) {
    for (vector<T> const &i: A) {
        for (T const &j: i)
            os << j << " ";
        os << endl;
    }
    return os;
}

template<typename T>
void vvtrNS(const vector<vector<T>> &A) {
    for (vector<T> const &i: A) {
        for (T const &j: i)
            cout << j;
        cout << endl;
    }
}

template<typename T>
T cntDigits(const T &N) { return (floor(log10(N)) + 1); }

template<typename T>
bool isPowOfTwo(const T &N) { return (N && (!(N&(N-1)))); }

template<typename T>
T lcm(T a, T b) { return ((a*b)/gcd(a, b)); }
/* -------------------------------------------------------- */
/* -------------------------------------------------------- */

//

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    // cout.setf(std::ios::boolalpha);
    cout<<std::fixed;
    cout<<std::setprecision(6); // default
    /* -------------------------------- */

    int n {}, k {};
    cin >> n >> k;

    vtr<bool> ref (n+1, false);

    while (k--) {
        int n_snukes {};
        cin >> n_snukes;
        while (n_snukes--) {
            int snukes {};
            cin >> snukes;
            ref.at(snukes) = true;
        }
    }

    int ans {};
    for (size_t i {1}; i < ref.size(); ++i)
        if (!ref.at(i))
            ++ans;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3616
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		if (a < b) System.out.println("a < b");
		else if (a > b) System.out.println("a > b");
		else if (a == b) System.out.println("a == b");
		else;
	}

}

Measured memory_bytes: 26168
#include<iostream>

using namespace std;

int main()
{
    int n;
    int A[10010];
    cin >> n;
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
    }
    int q;
    int B[1000];
    cin>>q;
    for(int j=0;j<q;++j)
    {
        cin >> B[j];
    }

    int C=0;

    for(int i=0;i<q;++i)
    {
        for(int j=0;j<n;++j)
        {
            if(B[i]==A[j])
            {
                C++;
                break;
            }
        }
    }
    cout << C << endl;
    return 0;
}


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


typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _  %  MOD
#define __ %= MOD

#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      sortA(v)          sort(v.begin(), v.end())
#define      sortD(v)          sort(v.begin(), v.end(), greater<auto>())
#define      fill(a)           memset(a, 0, sizeof (a))

#define      swap(a,b)        {a=a+b;b=a-b;a=a-b;}
#define      rep(i, n)         for(ll i = 0; i < (n); ++i)
#define      repA(i, a, n)     for(ll i = a; i <= (n); ++i)
#define      repD(i, a, n)     for(ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) <<endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}
ll power(ll x,ll y){ll res=1; while(y>0){if(y&1) res=res*x;y=y>>1;x=x*x;}return res;} // modular exponent
const int maxn=1e5+5;
ll n,m,k;
ll parent[maxn];
ll siz[maxn];
void create(ll v)
{
  parent[v]=v;
  siz[v]=1ll;
}
ll findset(ll v)
{
  while(parent[v]!=v) v=parent[v];
  return v;
}
void unions(ll a,ll b)
{
  a=findset(a);b=findset(b);
  if(a!=b)
  {
    if(siz[a]<siz[b]) swap(a,b);
    parent[b]=a;
    siz[a]+=siz[b];
  }
}
ll ans[maxn];
vector<ll> adj[maxn];
int main()
{
    ios_base::sync_with_stdio(false); // don't use printf and scanf
    cin.tie(NULL); // cout<<fixed<<setprecision
    cin>>n>>m>>k;
    repA(i,1,n) create(i);
    rep(i,m)
    {
      ll x,y;
      cin>>x>>y;
      adj[x].pb(y);adj[y].pb(x);
      unions(x,y);
    }
    repA(i,1,n)
    {
      ans[i]=siz[findset(i)]-1-(ll)adj[i].size();
    }
    rep(i,k)
    {
      ll x,y;
      cin>>x>>y;
      if(findset(x)==findset(y))
      {
        ans[x]--;
        ans[y]--;
      }
    }
    repA(i,1,n)
    {
      cout<<ans[i]<<" ";
    }
    cout<<'\n';
    return 0;
}
// JUST ASK YOURSELF DID YOU GIVE YOUR BEST ? ISSE ZYADA
// KUCH KAR BHI NAHI SAKTE !! ENJOY AND GIVE YOUR BEST!!


Measured memory_bytes: 11920
#include <bits/stdc++.h>
 
using namespace std;
 
const int N = 200000;

int n, m;
vector<int> adj[N + 1];
bool vis[N + 1] = {};

int dfs(int v)
{
    vis[v] = 1;
    int curr = 1;
    
    for (auto a : adj[v])
    {
        if (!vis[a])
            curr += dfs(a);
    }
    
    return curr;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    cin >> n >> m;
    
    for (int i = 0; i < m; i++)
    {
        int a, b;
        cin >> a >> b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    
    int ans = 0;
    for (int i = 1; i <= n; i++)
    {
        if (!vis[i])
            ans = max(ans, dfs(i));
    }
    
    cout << ans;
    
    return 0;
}


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

int main()
{
        int x;
        int y;
        int i;
        int j;
        int count;
        string a;

        cin >> y >> x;
        char map[y + 2][x + 2];
        j = -1;
        while (++j < y + 2)
        {       
                i = -1;
                while (++i < x + 2) 
                        map[j][i] = '.';
        }
        j = 0;
        while (++j < y + 1)
        {      
                cin >> a;
                i = 0;
                while (++i < x + 1)
                        map[j][i] = a[i - 1];
        }
        j = 0;
        while (++j < y + 1)
        {
                i = 0;
                while (++i < x + 1)
                {
                        count = 0;
                        if (map[j][i] == '.')
                        {
                                if (map[j - 1][i - 1] == '#')
                                        count++;
                                if (map[j - 1][i] == '#')
                                        count++;
                                if (map[j - 1][i + 1] == '#')
                                        count++;
                                if (map[j][i - 1] == '#')
                                        count++;
                                if (map[j][i + 1] == '#')
                                        count++;
                                if (map[j + 1][i - 1] == '#')
                                        count++;
                                if (map[j + 1][i] == '#')
                                        count++;
                                if (map[j + 1][i + 1] == '#')
                                        count++;
                                cout << count;

                        }
                        else
                                cout << '#';
                }
                cout << endl;
        }

}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <numeric>
#include <utility>
#include <unordered_set>

using namespace std;

int main() {
  cin.tie(0);
  int n;
  cin >> n;
  int list[20];
  for (int i = 0; i < n; i++) {
    cin >> list[i];
  }
  
  int ans = 0;
  for (int i = 1; i < n-1; i++) {
    if ((list[i+1] > list[i] && list[i-1] < list[i]) || (list[i+1] < list[i] && list[i-1] > list[i])) {
      ans++;
    }
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <utility>
#include <numeric>

using namespace std;
typedef long long llong;
typedef unsigned long long ullong;

const ullong MOD = 1000000000 + 7;

int main()
{
	int n;
	for (; cin >> n;)
	{
		cout << 1 + n * (n + 1) / 2 << endl;
	}
}


Measured memory_bytes: 3020
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sz size()
#define ll long long
#define all(_v) _v.begin(), _v.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pvllvll pair <vector <ll>, vector <ll> >
#define ld long double
#define veci vector <int>
#define vecll vector <ll>


const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
const double PI = 3.1415926535897932384626433832795;
const double eps = 1e-9;
const int MOD1 = 1e9 + 7;
const int MOD2 = 998244353;

void solve() {
    string s, t;
    cin >> s >> t;
    int n = s.sz;
    int m = t.sz;
    int ans = 1e9;
    for(int l = 0; l < n; ++l) {
        int r = l + m - 1;
        if(r >= n) break;
        int res = 0;
        for(int i = l; i <= r; ++i)
            if(s[i] != t[i - l]) res++;
        ans = min(ans, res);
    }
    cout << ans;
}


int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int T = 1;
    ///cin >> T;
    while(T--) solve(), cout << '\n';
    return 0;
}


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

const int MOD = (int)1e9 + 7;

void add(int &a, ll b) {
    a = (a + b) % MOD;
}

int fastsolve(vector<vector<int> > e) {
    int n = e.size();

    vector<vector<int> > g(n);
    int all = 1;
    for (int i = 0; i < n; i++) {
        for (int to : e[i]) {
            g[to].push_back(i);
            all = 2 * all % MOD;
        }
    }
    vector<int> cov(1 << n);
    vector<int> cntEdges(1 << n);
    vector<vector<int> > cnt(1 << n, vector<int>(n));
    for (int mask = 0; mask < (1 << n); mask++) {
        for (int i = 0; i < n; i++) {
            if (!(mask & (1 << i))) continue;
            for (int to : g[i]) {
                cov[mask] |= 1 << to;
                cntEdges[mask]++;
                cnt[mask][to]++;
            }
        }
    }
    vector<int> pw(1000);
    pw[0] = 1;
    for (int i = 1; i < 1000; i++) pw[i] = pw[i - 1] * 2 % MOD;

    vector<int> dp(1 << n);
    dp[0] = 1;
    int ans = 0;
    for (int mask = 0; mask < (1 << n); mask++) {
        if (dp[mask] == 0) continue;
        int omask = ((1 << n) - 1) ^ mask;
        for (int cmask = omask; cmask; cmask = (cmask - 1) & omask) {
            int rmask = cmask ^ omask;
            /*if ((cov[cmask] & rmask) != rmask) {
                continue;
            }*/
            int ways = dp[mask];
            for (int i = 0; i < n; i++) {
                if (rmask & (1 << i)) {
                    ways = 1LL * ways * ((1 << cnt[cmask][i]) - 1) % MOD;
                } else if (mask & (1 << i)) {
                    ways = 1LL * ways * (1 << cnt[cmask][i]) % MOD;
                }
            }
            if ((cmask & 3) == 3) add(ans, ways * 1LL * pw[cntEdges[rmask]]);
            add(dp[mask | cmask], ways);
        }
    }

    return (all - ans + MOD) % MOD;
}

int main() {
#ifdef HOME
    freopen("in", "r", stdin);
#endif

    int n, m;
    while (cin >> n >> m) {
        vector<pair<int, int> > ed(m);
        for (int i = 0; i < m; i++) {
            cin >> ed[i].first >> ed[i].second;
            ed[i].first--;
            ed[i].second--;
        }
        vector<vector<int> > e(n);
        for (int i = 0; i < m; i++) {
            e[ed[i].first].push_back(ed[i].second);
        }
        for (int i = 0; i < n; i++) {
            sort(e[i].begin(), e[i].end());
        }
        printf("%d\n", fastsolve(e));
    }

#ifdef HOME
    cerr << clock() / (double)CLOCKS_PER_SEC << endl;
#endif
    return 0;
}


Measured memory_bytes: 4096
#include <bits/stdc++.h>
using namespace std;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define int long long
  #define endl "\n"
  #define all(v) v.begin(),v.end()
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<< ": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  const int N = 200005;
int ans;

const int mod = 1000000007;

int32_t main()
{


    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    IOS

    int n;
    cin >> n;

    int ans = 1;

    for(int i = 1; i <= n; i++)
    {
      ans *= i;
      ans %= mod;
    }

    cout << ans;



    return 0; 
}


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

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


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define all(A) A.begin(),A.end()
typedef long long ll;

int main(){
  int n,k;
  cin >> n >> k;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  int maxA = *max_element(all(a));
  
  int ng = -1;
  int ok = maxA;
  
  while(abs(ok-ng) > 1){
    int mid = (ok + ng)/2;
    int tmp = 0;
    if (mid == 0){
      ng = mid;
      continue;
    }
    rep(i,n){
      tmp += (a[i]+mid-1)/mid - 1;
    }
    if(tmp <= k) ok = mid;
    else ng = mid;
  }
  cout << ok << endl;
}


Measured memory_bytes: 3964
#include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
const ll N = 303 ;
int dp[303][303][303], n, k;
string s ;
int main()
{
	for(int i = 0 ; i < N ; i ++)
		for(int j = 1 ; j < N ; j ++)
			dp[i][j][j] = 1 ; 
	cin >> s >> k ; 
	n = s.size() ;
	for(int jump = 1 ; jump <= n ; jump ++){
		for(int i = 1 ; i + jump <= n ; i ++){
			for(int u = 0 ; u <= n ; u ++){
				dp[u][i][i+jump] = max(dp[u][i+1][i+jump], dp[u][i][i+jump-1]) ;
				if(u-(s[i-1]!=s[i+jump-1])>=0)
					dp[u][i][i+jump] = max(dp[u][i][i+jump], dp[u-(s[i-1]!=s[i+jump-1])][i+1][i+jump-1]+2) ;
			}
		}
	}
	cout << dp[k][1][n] ;
}

Measured memory_bytes: 108928
#include <iostream>

using namespace std;

int main()
{
	int N;
	int C[510], S[510], F[510];
	cin >> N;
	for(int i = 0; i < N - 1; i++) cin >> C[i] >> S[i] >> F[i];
	for(int i = 0; i < N; i++) {
		int time = 0;
		for(int j = i; j < N - 1; j++) {
			while(! (S[j] <= time && time % F[j] == 0)) time++;
			time += C[j];
		}
		cout << time << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
	int M1, D1, M2, D2;
	cin >> M1 >> D1 >> M2 >> D2;
	if (M1 == M2) {
		cout << "0" << endl;
	}
	else {
		cout << "1" << endl;
	}
}


Measured memory_bytes: 256
import heapq

if __name__ == "__main__":
    # 入力
    N = int(input())
    v = list(map(int, input().split()))

    heapq.heapify(v)
    for i in range(N-1):
        a = heapq.heappop(v)
        b = heapq.heappop(v)
        heapq.heappush(v, float((a+b)/2))
    
    print(v[0])

Measured memory_bytes: 3060
row, col = map(int, raw_input().split())

ret = []
for _ in range(row):
    _row = map(int, raw_input().split())
    _row += [sum(_row)]
    ret.append(_row)

for i in ret: 
    print ' '.join(map(str, i))

ret_sum = []
for i in range(col+1):
    work = 0
    for j in ret: 
        work += j[i] 
    ret_sum.append(work)

print ' '.join(map(str, ret_sum))

Measured memory_bytes: 6376
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<math.h>
#include<map>
#include<iterator>

#define rep(i,n) for(int i = 0; i != n; i++)

using namespace std;

int main(){
	int A,B,C; cin >> A >> B >> C;
	if(A*B*C % 2 == 0)
		cout << 0 << endl;
	else{
		vector<int> sorted;
		sorted.push_back(A); sorted.push_back(B); sorted.push_back(C);
		sort(sorted.begin(), sorted.end());
		cout << (long long) sorted[0]*sorted[1] << endl; 
	}
}

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

#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
#define endl        "\n"
#define repp(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a,b) 	for(int i=a;i<=b;i++)
#define IOS         ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const int N=1e5 + 5;
const int M=1e9 + 7;

string inttos(int num)
{
    return to_string(num);
}

int stoint(string sss)
{
    return stoi(sss);
}

int32_t main()
{
	IOS;
	//memset(dp,-1,sizeof(dp));	
	int n,k;
	cin >> n >> k;
	int a[n+5];
	rep(i,1,n)
		cin >> a[i];
	mi mp;
	int cycle = 0;
	int cur = 1;
	int kk = k;
	int c;
	while(kk>0)
	{
		int next = a[cur];
		cycle++;
		if(mp[cur]!=0)
		{
			c = cycle - mp[cur];
			break;
		}
		mp[cur]= cycle;
		cur = next;
		kk--;
	}
	if(kk==0)
	{
		cout << cur << endl;
		return 0;
	}
	else
	{
		//cout << cycle-1 << endl;
		//cycle--;
		//cout << c << endl;
		//cout << cur << endl;
		k = kk;
		k = k%c;
		while(k--)
		{
			int next = a[cur];
			cur = next;
		}
		cout << cur << endl;
	}
}


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

int main() {
  int A,B,C,D;
  cin >> A >> B >> C >> D;
  int L = A + B, R = C + D;
  if (L > R) cout << "Left";
  else if (L == R) cout << "Balanced";
  else if (L < R) cout << "Right";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n;
string st;
int main() {
	cin>>n;
	cin>>st;
	int ans=0;
	int sum=0;
	for(int i=0;i<(int)st.size();i++) 
		if(st[i]=='W') sum++;
	if(!sum) {
		cout<<0<<endl;
		return 0;
	}
	for(int i=(int)st.size()-sum;i<(int)st.size();i++) {
		if(st[i]=='R') ans++;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3736
# 169A

# 1.入力を受け取ること
# ex:[2 5] -> a=2, b=5 みたいにしないといけない
a, b = map(int, input().split())

# 2.目的通りの計算をする
# ex：2つの整数AとBの掛け算をやる

answer = a * b

#  3.計算の結果を出力する

print(answer)

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

using namespace std;
typedef long long ll;

int main(){
    ll k, n;
    cin >> n >> k;
    vector<ll> l(n);
    for(int i = 0; i < n; ++i){
        cin >> l.at(i);
    }
    sort(l.begin(), l.end());
    ll ans = 0;
    for(int i = 0; i < k; ++i){
        ans += l.at(l.size() - i - 1);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
//raja1999

//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string> 
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
//setbase - cout << setbase (16)a; cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 <<endl;prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val

using namespace std;
using namespace __gnu_pbds;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (998244353)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
#define int ll

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

//std::ios::sync_with_stdio(false);
int power(int a,int b){
	int res=1;
	while(b>0){
		if(b%2){
			res*=a;
			res%=mod;
		}
		a*=a;
		a%=mod;
		b/=2;
	}
	return res;
}
int a[200005],cnt[1000005],ans[1000005];
main(){
	std::ios::sync_with_stdio(false); cin.tie(NULL);
	int t,t1;
	//cin>>t;
	t=1;
	t1=t;
	while(t--){
		int n,i,val,sum,gg,res=0,j;
		cin>>n;
		rep(i,n){
			cin>>a[i];
			cnt[a[i]]++;
		}
		sort(a,a+n);
		fd(i,1000000,1){
			val=0;
			sum=cnt[i]*i;
			for(j=2*i;j<=1000000;j+=i){
				sum+=j*cnt[j];
				sum%=mod;
				val+=ans[j];
			}
			val%=mod;
			gg=0;
			for(j=i;j<=1000000;j+=i){
				gg+=(((sum-j)*cnt[j])%mod)*j;
				gg%=mod;
			}
			gg-=val;
			gg+=mod;
			gg%=mod;
			ans[i]=gg;
			res+=gg*power(i,mod-2);
			res%=mod;
			//cout<<gg<<endl;
		}
		res*=power(2,mod-2);
		res%=mod;
		cout<<res<<endl;
	}
	return 0;
} 
	

Measured memory_bytes: 17408
#include "bits/stdc++.h"

using ll = long long;
using namespace std;

const int N = 2e9;

void solveCase() {

   int n, a, b;
   cin >> n >> a >> b;

   int d = abs(a - b);

   if(d % 2 == 0) {
      cout << "Alice" << endl;
   } else {
      cout << "Borys" << endl;
   }

}


int main() {
   cin.tie(0);
   cin.sync_with_stdio(0);
   
   int testcase = 1;
   // cin >> testcase;
 
   for(int i = 0; i < testcase; i++) {
      solveCase();
   }
 
   return 0;
}


Measured memory_bytes: 3668
N=int(input())
INF=10**20
 
X=[]
for i in range(N):
  x,l=map(int,input().split())
  X.append((x-l,x+l-1))
  
X = sorted(X,key=lambda x:x[1])

last=0
ans=1
for i in range(1,N):
  if X[last][1]<X[i][0]:
    ans += 1
    last=i
  else:
    continue
    
print(ans)

Measured memory_bytes: 24612
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

/**
 * Created by Harry on 4/2/20.
 */
//https://atcoder.jp/contests/dp/tasks/dp_k
public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scanner.nextInt();
        int K = scanner.nextInt();
        int[] A = new int[N];
        for(int i=0; i<N; i++){
            A[i] = scanner.nextInt();
        }

        boolean[][] dp = new boolean[K+1][2];
        dp[0][0] = dp[0][1] = false;
        for(int i=1; i<=K; i++){
            for(int p=0; p<2; p++){
                for(int num : A){
                    if(num<=i && !dp[i-num][(p+1)%2]){
                        dp[i][p] = true;
                        break;
                    }
                }
            }
        }
        if(dp[K][0]){
            System.out.print("First");
        }
        else{
            System.out.print("Second");
        }
    }

}


Measured memory_bytes: 24788
#include <bits/stdc++.h>
using namespace std;
int main()
{
  ios::sync_with_stdio(0);cin.tie(0);ios_base::sync_with_stdio(0);
   int n,c,sum=0,ans;
   cin>>n>>c;
   int v[n+5],w[n+5];
   for(int i=1;i<=n;i++)
   {
       cin>>w[i]>>v[i];
       sum+=v[i];
   }
   long long dp[n+5][sum+10];
   for(int i=0;i<n+5;i++)
   {
       for(int j=0;j<sum+10;j++)
       {
           if(j==0)
            dp[i][j]=0;
           else
            dp[i][j]=1e18;
       }
   }
   for(int i=1;i<=n;i++)
   {
       for(int j=1;j<=sum;j++)
       {
           if(v[i]<=j)
            dp[i][j]=min(dp[i-1][j],dp[i-1][j-v[i]]+w[i]);
           else
            dp[i][j]=dp[i-1][j];
       }
   }
   for(int i=0;i<=n;i++)
   {
       for(int j=0;j<=sum;j++)
       {
           if(dp[i][j]<=c)
            ans=j;
       }
   }
   cout<<ans;
    return 0;
}


Measured memory_bytes: 82304
using System;

class A{
	public static void Main(){
		for (int i=1; i<10001; i++) {
			int x = int.Parse (Console.ReadLine ());
			if (x != 0) {
				Console.WriteLine ("Case {0}: {1}", i, x);
			} else {
				break;
			}
		}
	}
}

Measured memory_bytes: 9192
import java.util.*;
import java.util.ArrayDeque;
import java.util.Queue;
import java.math.RoundingMode;
import java.math.BigDecimal;
 
 
 
public class Main{
	 public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		Queue<Long> q = new ArrayDeque<>();
		for(long i = 1; i <= 9; i++) {
			q.add(i);
		}
		for(int i = 0; i < k-1; i++) {
			long temp = q.poll();
			long a = temp%10;
			if(a!= 0) {
				long b = temp*10+a-1;
				q.add(b);
			}
			long b = temp*10+a;
			q.add(b);
			if(a!=9) {
				long c = temp*10+a+1;
				q.add(c);
			}
			//System.out.println(temp);
		}
		System.out.println(q.poll());
	 }
}

Measured memory_bytes: 29140
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define F first
#define S second
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b?gcd(b, a%b):a;}
ll lcm(ll a, ll b) { return a*b/gcd(a,b);}
ll MOD=1000000007;

int main(){
  string s;
  cin>>s;
  string ans="Yes";
  int n=s.size();
  for(int i=0;i<n/2;i++){
    if(s.at(i) != s.at(n-1-i)) ans="No";
  }
  for(int i=0;i<n/4;i++){
    if(s.at(i) != s.at(n/2-1-i)) ans="No";
    if(s.at(i+n/2+1) != s.at(n-1-i)) ans="No";
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
import sys
fin = sys.stdin.readline
from random import randint
from heapq import heappush, heappop


class Node(object):
    def __init__(self, val):
        self.val = val
        self.left = None
        self.right = None
        self.parent = None


# Meldable Heap implementation
def merge(h1, h2):
    if h1 is None:
        return h2
    if h2 is None:
        return h1
    if h2.val < h1.val:
        h1, h2 = h2, h1
    if randint(0, 1):
        h1.left = merge(h1.left, h2)
        h1.left.parent = h1
    else:
        h1.right = merge(h1.right, h2)
        h1.right.parent = h1
    return h1


def push(root, x):
    u = Node(x)
    root = merge(u, root)
    root.parent = None
    return root


def pop(root):
    x = root.val
    root = merge(root.left, root.right)
    if root is not None:
        root.parent = None
    return x, root


def find_min(root):
    return root.val if root else float('inf')


def find_second_min(root):
    return min(find_min(root.left), find_min(root.right)) if root else float('inf')


INF = 2**64 - 1
N = int(fin())
w_list = [int(elem) for elem in fin().split()]

hpq = [0] * (N + 1)
mpq = []
rig = [0] * (N + 1)
cst = [0] * (N + 1)
lef = [0] * (N + 1)

for i in range(N - 1):
    hpq[i] = None
    rig[i] = i + 1
    lef[i] = i - 1
    cst[i] = w_list[i] + w_list[i + 1]
    heappush(mpq, (cst[i], i))

ans = 0
for k in range(N - 1):
    c, i = heappop(mpq)
    while rig[i] == -1 or cst[i] != c:
        c, i = heappop(mpq)
    
    ml = mr = False
    if w_list[i] + find_min(hpq[i]) == c:
        _, hpq[i] = pop(hpq[i])
        ml = True
    elif w_list[i] + w_list[rig[i]] == c:
        ml = mr = True
    elif find_min(hpq[i]) + find_second_min(hpq[i]) == c:
        _, hpq[i] = pop(pop(hpq[i])[1])
    else:
        _, hpq[i] = pop(hpq[i])
        mr = True
    
    ans += c
    hpq[i] = push(hpq[i], c)
    if ml:
        w_list[i] = INF
    if mr:
        w_list[rig[i]] = INF
    if ml and i > 0:
        j = lef[i]
        hpq[j] = merge(hpq[j], hpq[i])
        rig[j] = rig[i]
        rig[i] = -1
        lef[rig[j]] = j
        i = j
    if mr and rig[i] + 1 < N:
        j = rig[i]
        hpq[i] = merge(hpq[i], hpq[j])
        rig[i] = rig[j]
        rig[j] = -1
        lef[rig[i]] = i
    cst[i] = w_list[i] + w_list[rig[i]]
    cst[i] = min(cst[i], min(w_list[i], w_list[rig[i]]) + find_min(hpq[i]))
    cst[i] = min(cst[i], find_min(hpq[i]) + find_second_min(hpq[i]))
    heappush(mpq, (cst[i], i))

print(ans)


Measured memory_bytes: 9872
#include<stdio.h>
void quicksort(int a[],int s,int t){
  if(s<t){
    int i=s,j=t,p=a[s];
    while(1){
      while(a[i]<p)i++;
      while(p<a[j])j--;
      if(i>=j)break;
      a[i]^=a[j]^=a[i]^=a[j];
      i++;j--;
    }
    quicksort(a,s,i-1);quicksort(a,j+1,t);
  }
}
int main(){
  int n,x[100],s=0,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){scanf("%d",&x[i]);s+=x[i];}
  if(s%10){printf("%d",s);return 0;}
  quicksort(x,0,n-1);
  for(i=0;i<n;i++)if(x[i]%10){printf("%d",s-x[i]);return 0;}
  printf("0");
}

Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define ll long long
int main()
{
    ll q,h,s,d;
    ll n;
    scanf("%lld%lld%lld%lld",&q,&h,&s,&d);
    scanf("%lld",&n);
    h=min(q*2,h);
    s=min(h*2,s);
    d=min(s*2,d);
    if(n%2)
    printf("%lld\n",n/2*d+s);
    else
        printf("%lld\n",n/2*d);
    return 0;
}


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

using namespace std;

const long long MOD = 1e9 + 7;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<int,pii> iii;
typedef vector<pii> vii;
typedef vector<vi> vvi;
typedef priority_queue<pii, vector<pii>, greater<pii>> fila_prioridade;
typedef priority_queue<iii, vector<iii>, greater<iii>> fila_prioridade_grids;

#define nl '\n'
#define INF 1000000000
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define NeedForSpeed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

int oversea = 0, qtd_passados = 0;
int a,b,n;
string s;

int main() {
        NeedForSpeed

        cin >> n >> a >> b;

        cin >> s;

        for (int i = 0; i < n; i++) {
                if (s[i] == 'a') {
                        if (qtd_passados < a + b) {
                                cout << "Yes" << nl;
                                qtd_passados++;
                        } else {
                                cout << "No" << nl;
                        }
                } else if (s[i] == 'b') {
                        if (qtd_passados < a + b && oversea < b) {
                                cout << "Yes" << nl;
                                oversea++;
                                qtd_passados++;
                        } else {
                                cout << "No" << nl;
                        }
                } else {
                        cout << "No" << nl;
                }
        }

        return 0;
}


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

using namespace std;

typedef long long ll;

typedef double T;
typedef pair<int, int> P;

typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<T> VT; 
typedef vector<VT> VVT;
typedef vector<P> VP;

const ll MOD = 1e9+7;
const T EPS = 1e-7;

int main() {
    int n, K, q;
    cin >> n >> K >> q;
    VI a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }

    int ans = 2e9;
    for (int i = 0; i < n; ++i) {
        VI b (1, -1);
        for (int j = 0; j < n; ++j) {
            if (a[j] < a[i]) b.push_back(j);
        }
        VI glob;
        b.push_back(n);
        for (int j = 0; j < b.size() - 1; ++j) {
            int l = b[j] + 1;
            int r = b[j+1];
            if (r - l < K) continue;
            VI st;
            for (int k = l; k < r; ++k)
                st.push_back(a[k]);
            sort(st.begin(), st.end());
            for (int k : st) {
                if ((r--) - l < K) break;
                glob.push_back(k);
            }
        }
        sort(glob.begin(), glob.end());
        if (glob.size() < q || glob[0] > a[i]) continue;
        ans = min(ans, glob[q-1] - glob[0]);
    }
    cout << ans << "\n";
}


Measured memory_bytes: 256
//g++ -std=c++14 test.cpp -o test.out
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (LL)(1e18)+1;
const int INF_INT = 2147483647-1e6;
const LL mod = 1000000007ll;
 
LL A,B;
 
LL ans = -1;
 
void solve(){
	LL start = 10*B;
	LL end = 12.5*A + 12;
	for(LL i=start;i<end;i++){
		if(((LL)(i*0.08))==A && ((LL)(i*0.1))==B){
			ans = i;
			return;
		}
	}
}
 
int main(){
	cin >> A >> B;
 
	solve();
 
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
using vi=vector<int>;
using pii=pair<int,int>;
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define SZ(c) ((int)c.size())
#define CONTAIN(c,x) (c.find(x)!=end(c))
#define OUTOFRANGE(y,x,h,w) (y<0||x<0||y>=h||x>=w)
#define dump(...)
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
#define INF (1001001001)
#define INFLL (1001001001001001001ll)
template<class T> ostream& operator << (ostream &os,const vector<T> &v) {
    ITR(i,begin(v),end(v)) os << *i << (i==end(v)-1 ? "" : "\n"); return os; }
template<class T> istream& operator >> (istream &is,vector<T> &v) {
    ITR(i,begin(v),end(v)) is >> *i; return is; }
template<class T> istream& operator >> (istream &is, pair<T,T> &p) {
        is >> p.first >> p.second; return is; }
template<class T>bool chmax(T &a,const T &b) {if(a<b) {a=b;return 1;} return 0;}
template<class T>bool chmin(T &a,const T &b) {if(b<a) {a=b;return 1;} return 0;}
//------------------------------------------------------------------------------
struct before_main_function {
    before_main_function() {
        #ifdef int
            #undef INF
            #define INF INFLL
            #define stoi stoll
        #endif
        cin.tie(0);ios::sync_with_stdio(false);
        cout<<setprecision(15)<<fixed;
        // #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

const int MOD=1e9+7;
const int MAX_N=200005;
long long fact[MAX_N];
long long fact_inv[MAX_N];
long long bin_pow_mod(long long x,long long y) {
      if(x==0) return 0;
      long long prod=1;
      while(y>0) {
          if(y&1) {
              prod=(prod*x)%MOD;
          }
          x=(x*x)%MOD;
          y>>=1;
      }
      return prod%MOD;
}
struct init_fact {
    init_fact() {
        fact[0]=1, fact_inv[0]=1;
        for(int i=1;i<MAX_N;++i) {
            fact[i]=(fact[i-1]*i)%MOD;
            fact_inv[i]=bin_pow_mod(fact[i],MOD-2);
        }
    }
} init_fact;

signed main() {
    int H,W,A,B;
    cin>>H>>W>>A>>B;

    int ans=0;
    for(int i=B;i<W;i++) {
        int a=((fact[H-A-1+i]*fact_inv[H-A-1])%MOD*fact_inv[i])%MOD;
        int b=((fact[A-1+W-i-1]*fact_inv[A-1])%MOD*fact_inv[W-i-1])%MOD;
        ans+=(a*b)%MOD;
        ans%=MOD;
    }
    cout<<ans<<endl;
    return 0;
}


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

int main(){
  int k,x; cin >> k >> x;
  int left=0, right=0;
  left = x-(k-1);
  for(int i=0; i<2*k-1; i++){
    cout << left ;
    if(i!=2*k-2){
      cout << " ";
    }else{
      cout << endl;
    }
    left++;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>

using namespace std;

typedef struct {
    int x;
    int y;
    int h;
}posi_t;

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

    vector<posi_t> posi(N);
    for (int i = 0; i < N; i++)
        cin >> posi[i].x >> posi[i].y >> posi[i].h;

    int X, Y, H;
    int flag;
    int kaku;
    for (X = 0; X <= 100; X++) {
        for (Y = 0; Y <= 100; Y++) {
            flag = 0;
            kaku = 0;
            H = 1e9;
            for (int i = 0; i < N; i++) {
                if (kaku == 0) {
                    if (H - abs(posi[i].x - X) - abs(posi[i].y - Y) > 0) {
                        H = posi[i].h + abs(posi[i].x - X) + abs(posi[i].y - Y);
                        if (posi[i].h != 0)
                            kaku = 1;
                    }
                    else {
                        H = min(H, abs(posi[i].x - X) + abs(posi[i].y - Y));
                    }
                }
                if (posi[i].h != max(H - abs(posi[i].x - X) - abs(posi[i].y - Y), 0)) {
                    flag = 0;
                    break;
                }
                    
                //cout << "X=" << X << "  Y=" << Y << "  H=" << H << endl;
                flag++;
            }
            //if (flag == 0)break;
            if (flag == N)break;
        }
        if (flag == N)break;
    }
    
    cout << X <<" "<< Y <<" "<< H << endl;
}


Measured memory_bytes: 256
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using TP = tuple<ll,ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(18);
}
signed main(){
  init_io();
  ll n;
  cin >> n;
  vector<ll> dp(n,0);
  vector<ll> a(n),sum(n,0);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  sum[n-1] = a[n-1];
  for(int i=n-2;i>=0;i--){
    sum[i] = sum[i+1];
    if((i%2==0)^(n%2==0)) sum[i] += a[i];
  }
  dp[n-1] = 0;
  dp[n-2] = max(a[n-1],a[n-2]);
  for(int i=n-3;i>=0;i--){
    if(n%2){
      if(i%2==0){
        dp[i] = max(dp[i+1],dp[i+2]+a[i]);
      }else{
        dp[i] = max(sum[i+1],dp[i+2]+a[i]);
      }
    }else{
      if(i%2==0){
        dp[i] = max(sum[i+1],dp[i+2]+a[i]);
      }else{
        dp[i] = max(dp[i+1],dp[i+2]+a[i]);
      }
    }
  }
  cout << dp[0]<<endl;
}


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

int main(){
  map<int, bool> memo;

  int n;
  cin >> n;

  int cnt=0;

  for(int i=0; i<n; i++){
    int p[3];
    cin >> p[0] >> p[1] >> p[2];

    sort(p, p+3);

    int k=((p[0]-1)*1000+(p[1]-1))*1000+(p[2]-1);

    if(memo.find(k)==memo.end()){
      memo[k]=true;
    }else{
      cnt++;
    }
  }

  cout << cnt <<endl;

  return 0;
}



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

#define MULT(x,y) ((x*y)%1000000007L)
#define llint long long int

int main(void){
  int n;
  std::cin >> n;

  llint power = 1;
  for(int i=1; i<=n; i++){
    power = MULT(power, i);
  }
  std::cout << power << std::endl;
  return 0;
}







Measured memory_bytes: 256