akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
using namespace std;

int main(){
    enum{
        STARTMULTITABLE = 1,
        ENDMULTITABLE = 9
    };
    
    int i;
    for(i = STARTMULTITABLE; i <= ENDMULTITABLE; i++){
        int k;
        for(k = STARTMULTITABLE; k <= ENDMULTITABLE; k++){
            cout << i << "x" << k << "=" << (i*k) << endl;
        }
    }
    return 0;
}

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

#if debug
#include "printer.hpp"
#define dump(a) cerr << #a << "(" << __LINE__ << ") = " << a << endl;
#else
#define dump(...)
#endif

#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define repr(i, a, b) for (int i = (b)-1; i >= a; i--)
#define all(x) (x).begin(), (x).end()

using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
const ll mod = 1000000007;

ll pow(ll x, ll y) {
  ll ret = 1, tmp = x;
  while (y) {
    if (y % 2) ret = ret * tmp % mod;
    tmp = tmp * tmp % mod;
    y /= 2;
  }
  return ret;
}

ll inverse(ll x) { return pow(x, mod - 2); }

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(8);

  ll X;
  cin >> X;
  rep(i, X, 10000000) {
    bool ok = true;
    for (ll j = 2; j * j <= X; j++) {
      if (i % j == 0) ok = false;
    }
    if (ok) {
      cout << i << endl;
      return 0;
    }
  }
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long llint;
const llint MOD = 998'244'353;

int main() {
    std::ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> A(N);
    map<int, int> mapa;
    llint ans = 0;
    for(int i = 0; i < N; i++) {
        cin >> A[i];
        mapa[i - A[i]]++;
    }
    for(int i = 0; i < N; i++) {
        mapa[i - A[i]]--;
        ans += mapa[A[i] + i];
    }
    cout << ans;
}




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

int main(){
    int a, b, c;

    cin >> a >> b >> c;
    
    int result = a + b + c;

    if(result >= 22){
        cout << "bust" << endl;
    }
    else{
        cout << "win" << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1000000007LL;
const int INF = LLONG_MAX;

signed main(){
    
    int n, m; cin >> n >> m;
    vector<int> p(n);
    for(int i = 0; i < m; i++){
        cin >> p[i];
        p[i]--;
    }
    vector<int> a(n - 1);
    vector<int> b(n - 1);
    vector<int> c(n - 1);
    for(int i = 0; i < n - 1; i++) cin >> a[i] >> b[i] >> c[i];
    
    vector<int> imos(n, 0);
    for(int i = 1; i < m; i++){
        int r = max(p[i], p[i - 1]);
        int l = min(p[i], p[i - 1]);
        imos[l]++;
        imos[r]--;
    }

    for(int i = 0; i < n - 1; i++) imos[i + 1] += imos[i];
    int ans = 0;
    for(int i = 0; i < n - 1; i++){
        ans += min(imos[i] * a[i], imos[i] * b[i] + c[i]);
    }

    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 6800
#include <stdio.h>

void	printArray(int *A, int N)
{
	int	i;

	i = 0;
	while(i < N)
	{
		if (i == N - 1)
			printf("%d", A[i]);
		else
			printf("%d ", A[i]);
		i++;
	}
	printf("\n");
}

int	main(void)
{
	int	N;
	int	A[1001];
	int	v;
	int	j;

	scanf("%d", &N);
	for(int i=0; i<N; i++)
		scanf("%d", &A[i]);
	printArray(A, N);
	for(int i=1; i<N; i++)
	{
		v = A[i];
		j = i - 1;
		while (j >= 0 && A[j] > v)
		{
			A[j+1] = A[j];
			j--;
		}
		A[j+1] = v;
		printArray(A, N);
	}
	return (0);
}




Measured memory_bytes: 2040
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
//}}}
const ll maxn=100005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=2000000000;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll P=880301;
//const ll P=31;
 
ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}
int p[maxn],P[maxn];
int main()
{
    string s,t;
    cin>>s>>t;
    REP(i,SZ(s)){
        if(s[i]=='A') p[i+1]=p[i]+1;
        else p[i+1]=p[i]-1;
    }
    REP(i,SZ(t)){
        if(t[i]=='A') P[i+1]=P[i]+1;
        else P[i+1]=P[i]-1;
    }
    int q;
    cin>>q;
    while(q--){
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        a--,c--;
        //cout<<p[b]-p[a]<<' '<<P[d]-P[c]<<'\n';
        if(((p[b]-p[a])-(P[d]-P[c]))%3==0) cout<<"YES\n";
        else cout<<"NO\n";
    }
}

Measured memory_bytes: 1792
h,w = map(int,input().split())
s = 0
li = []
lire = []
linew = []
for i in range(h):
    li.append(input())
for i in range(w):
    for j in range(h):
        if li[j][i] == ".":
            s = 1
        else:
            s = 0
            break
    if s == 1:
        lire.append(i)
        s = 0
for i in range(h):
    a = ""
    for j in range(w):
        if j not in lire:
            a += li[i][j]
    linew.append(a)
for i in range(len(linew)):
    if "#" not in linew[i]:
        continue
    else:
        print(linew[i])

Measured memory_bytes: 9084
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cstring>
using namespace std;
#define MAXN 100000
int A,B;
int n;
int main()
{
	scanf("%d%d%d",&n,&A,&B);
	printf("%d",min(n*A,B));
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
char s[10];
int a[1005];
#define ll long long
int  main(){
	ll n,k;
	cin>>n>>k;
	ll a1=n;
	ll a2=abs(n-n/k*k);
	ll a3=abs(n-(n/k+1)*k);
	cout<<min(a1,min(a2,a3));
	return 0;
}

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

int main(){
    long N;
    cin >> N;
    if(N > 4){
        if(N & 1){
            cout << 2 * (N - 1) << endl;
            cout << "1 " << N << "\n" << N - 1 << " " << N << endl;
            cout << N / 2 << " " << N << "\n" << (N + 1) / 2 << " " << N << endl;
            for(long i = 1; i * 2 + 1 != N; ++i){
                cout << i << " " << i + 1 << endl;
                cout << i << " " << N - (i + 1) << endl;
                cout << N - i << " " << i + 1 << endl;
                cout << N - i << " " << N - (i + 1) << endl;
            }
        }else{
            cout << 2 * N << endl;
            cout << "1 " << N / 2 << "\n1 " << (N + 2) / 2 << endl;
            cout << N << " " << N / 2 << "\n" << N << " " << (N + 2) / 2 << endl;
            for(long i = 1; i * 2 != N; ++i){
                cout << i << " " << i + 1 << endl;
                cout << i << " " << N - i << endl;
                cout << N - i + 1 << " " << i + 1 << endl;
                cout << N - i + 1 << " " << N - i << endl;
            }
        }
    }else if(N == 3){
        puts("2\n1 3\n2 3");
    }else if(N == 4){
        puts("4\n1 2\n2 4\n3 4\n3 1");
    }
}

Measured memory_bytes: 256
// https://atcoder.jp/contests/abc051/tasks/abc051_b

#include <iostream>

using namespace std;

int k, s;
int sum = 0;

int main() {
    cin >> k >> s;

    if (k * 3 == s)
    {
        cout << 1 << endl;
        return 0;
    }
    else if ( k * 3 < s)
    {
        cout << 0 << endl;
        return 0;
    }

    for (int x = 0; x <= k; x++)
    {
        for (int y = 0; y <= min(k, s - x); y++)
        {
            int z = s - x - y;
            if (0 <= z && z <= k) { sum++; }
        }
    }

    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [$t:tt]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}


#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    ($arg:expr) => (println!("{:?}",$arg));
}


#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}


use std::cmp;
use std::collections::HashMap;


static INF_I64 :i64 = 9223372036854775807;


fn main() {

    input! { 
       n: usize,
       a: i64,
       b: i64,
       x : [i64;n],
    }

    let mut ans = INF_I64;
    
    let mut x = x;
    x.push(0);
    let mut cost = vec![0;n-1];
    for i in 0..n-1{
        cost[i] = x[i+1]-x[i];
    }

    cost.sort();


    let mut dp = vec![0;n];
    dp[n-1] = ((n-1) as i64)*b;
    ans = dp[n-1];
    let mut index = 0;
    for i in (0..n-1).rev(){
        dp[i] = dp[i+1] -b + cost[index]*a;
        ans = cmp::min(ans , dp[i]);
        index+=1;
    }
    




    
    println!("{}",ans);


}


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

int main(){
    int64_t ans=0,temp;
    int n;
    cin >> n;
    int data[5]={};
    string s;

    for (int i = 0; i < n; i++){
        cin >>s;

        switch (s[0]){
        case 'M':
            data[0]++;
            break;
        case 'A':
            data[1]++;
            break;
        case 'R':
            data[2]++;
            break;
        case 'C':
            data[3]++;
            break;
        case 'H':
            data[4]++;
            break;
        default:
            break;
        }
    }
    
    for (int i = 0; i < 5; i++){
        for (int j = 0; j < 5; j++){
            if(j==i)continue;
            temp=1;
            for (int k = 0; k < 5; k++){
                if(k==j || k==i)continue;
                temp *= data[k];
            }
            ans += temp;
        }
        
    }
    

    //cout <<fixed<<setprecision(16)<< << endl;
    cout << ans/2 << endl;

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

Measured memory_bytes: 256
import java.util.*;

public class Main{
	static public void  main(String[] args){
		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int M = scan.nextInt();
		int C = scan.nextInt();

		int[] b = new int[M];
		int[][] a = new int[N][M];

		for(int i = 0; i < M;i++){
			b[i] = scan.nextInt();
		}
		int ret = 0;
		for(int i = 0; i < N;i++){
			int sum = C;
			for(int j = 0; j < M;j++){
				sum += b[j] * scan.nextInt();
			}
			if(sum > 0) ret++;
		}
		System.out.println(ret);
	}
}


Measured memory_bytes: 22612
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace AtCoder.C
{
    public class Program
    {
        public static void Main() { var r = GetResult(); Debug.WriteLine(r); Console.Write(r); }

        private static object GetResult()
        {
            var N = ReadLong();
            var a = ReadLongs();
            var amax = a.Max();
            var amin = a.Min();
            var lcost = new List<long>();
            for (var i = amin; i <= amax; i++)
            {
                lcost.Add((long)a.Sum(x => Math.Pow((x - i), 2)));
            }
            return lcost.Min();
        }

        #region Console.Read

        public static string ReadText() { return Console.ReadLine(); }
        public static List<string> ReadTexts() { return Console.ReadLine().Split(' ').ToList(); }
        public static long ReadLong() { return long.Parse(Console.ReadLine()); }
        public static (long, long) Read2Longs() { var ls = ReadLongs(); return (ls[0], ls[1]); }
        public static (long, long, long) Read3Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2]); }
        public static (long, long, long, long) Read4Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3]); }
        public static (long, long, long, long, long) Read5Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3], ls[4]); }
        public static List<long> ReadLongs() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); }

        #endregion
    }
}


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

//#pragma gcc optimize("O3,unroll-loop")
//#pragma gcc target("sse,sse2,sse3,ssse3,sse4,avx,avx2,fma,abm,mmx,popcnt,tune=native")
//#define int long long
//#define double long double

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

    int x, n, t;
    set<int> s;
    cin >> x >> n;
    while (n--)
        cin >> t, s.insert(t);
    
    int a = 0;
    while (true)
    {
        if (!s.count(x - a))
            cout << x - a << '\n', exit(0);
        if (!s.count(x + a))
            cout << x + a << '\n', exit(0);
        a++;
    }

    return 0;
}

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

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


Measured memory_bytes: 3648
#include<bits/stdc++.h>
#define fo(i,a,b) for((i)=(a);i<=(b);i++)
#define rfo(i,a,b) for((i)=(a);i>=(b);i--)
#define inrange(x,y,z) (((x)>=(y))&&((x)<=(z)))
#define ALL(vec) ((vec).begin(),(vec).end())
#define SOR(vec) sort(ALL(vec))
#define UNI(vec) (vec).erase(unique(ALL(vec)),(vec).end())
using namespace std;
int n,popc,cpop,rmd1,rmd2,res[200100],ff[200100];
string s;
int main(){
	#ifdef FILIN
		#ifndef DavidDesktop
			freopen(FILIN,"r",stdin);
			freopen(FILOUT,"w",stdout);
		#endif
	#endif
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>n>>s;
	for(int i=0;i<s.size();i++)
		if(s[i]=='1') popc++;
	if(popc!=1){
	rmd1=0;
	for(int i=0;i<s.size();i++)
		rmd1=(rmd1*2+s[i]-'0')%(popc-1);
	}
	rmd2=0;
	for(int i=0;i<s.size();i++)
		rmd2=(rmd2*2+s[i]-'0')%(popc+1);
	int x1=1,x2=1;
	for(int i=s.size()-1;i>=0;i--){
		if(s[i]=='0'){
			res[i]=(rmd2+x2+popc+1)%(popc+1);
		}
		if(s[i]=='1'){
			if(popc!=1) res[i]=(rmd1-x1+popc-1)%(popc-1);
			else res[i]=-1;
		}
		if(popc!=1) x1=(x1*2)%(popc-1);
		x2=(x2*2)%(popc+1);
	}
	int cc=*max_element(res,res+s.size());
	ff[0]=0;
	for(int i=1;i<=cc;i++) ff[i]=ff[i%__builtin_popcount(i)]+1;
	for(int i=0;i<s.size();i++)
		if(res[i]!=-1) cout<<ff[res[i]]+1<<endl;
		else cout<<0<<endl;
	return 0;
}


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

using namespace std;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int MOD = 1e9+7;
const long long INF = 1LL << 60;
const int inf = 1e9;
typedef long long ll;
/* 
int max_v(vector<int> v){
    int max = 0;
    for(auto it = v.begin(); it != v.end(); it++){
        max = std::max(max, *it);
    }
    return max;
}
*/
int main(){
    int N; cin >> N;
    vector<int> a(N);
    rep(i,N) cin >> a[i];
    vector<int> cp(a);
    sort(cp.begin(), cp.end(), greater<int>());
    //cout<<cp[0]<<endl;
    //puts("---ans---");
    for(int i=0; i<N;i++){
        bool flag = false;
        int cnt=0;
        for(int j=0;j<N;j++){
            if(a[i]!=cp[j]){
                cout<<cp[j]<<endl;
                flag = true;
                break;
            }else if(a[i]==a[j]) {
                if(cnt==1){
                    cout<<a[i]<<endl;
                    flag = true;
                }
                cnt++;
            }
            if(cnt==2)break;
        }
        if(!flag){
            cout<<a[i]<<endl;
        }
    }
    /* 
    for(int i=0;i<N;i++){
        int data=a[i];
        a.erase(a.begin()+i);
        int ans=max_v(a);
        cout<<ans<<endl;
        a.insert(a.begin()+i, data);
    }
    */
}

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

//ある#マスを選び、その上下左右に隣接する#が無ければアウト
//
int main(){
  int H,W;
  cin >> H >> W;
  vector<vector<char>> data(H+2, vector<char>(W+2,'.'));
  bool flag = true;
  vector<int> x = {1,0,-1,0};
  vector<int> y = {0,1,0,-1};
  
  for(int i = 1;i<=H;i++){
    for(int j = 1;j<=W;j++){
      cin >> data[i][j];
    }
  }
  int cnt = 0;
  for(int i = 1;i<=H;i++){
    for(int j = 1;j<=W;j++){
      
      if (data[i][j] == '#' && data[i][j - 1] != '#' 
      && data[i - 1][j] != '#' && data[i][j + 1] != '#' && data[i + 1][j] != '#') cnt++;
    }
  }
  if(cnt == 0) cout << "Yes" <<endl;
  else cout << "No" <<endl;
  
 }

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <utility>
#include <set>
#include <map>
#include <tuple> 
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <list>
using namespace  std;
typedef pair<long long , long long> P;
typedef long long ll;
typedef long long lint;
#define REP(i, n) for(long long (i)=0; (i)<(n); ++i)
#define FOR(i, a, b) for(long long (i)=(a); (i)<(b); ++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
const long long MOD = static_cast<long long>(1e9) + 7LL;
const long long INF = 1234567891234567890LL;
signed main(){
    ll N; cin>>N;
    vector<ll> A(N);
    REP(i, N) cin>>A[i];
    sort(ALL(A));
    ll res = 0;
    if(N%2==0){
        ll l, r;
        l = A[N/2 -1], r = A[N/2];
        if(l!=r)res = r-l;
    }
    else {
        res = 0;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, n) for(int i= 0; i < (n); i++)
using ll= long long int;
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;}
ll mod= 1e9 + 7;


ll dp[20020];

int main(){
    rep(j,20020)dp[j]=1e18;
  int h,n;
  cin >>h >>n;
  ll ma=0;
  dp[0]={};
  rep(i,n){
    ll a,b;
    cin >> a >>b;
    chmax(ma,a);
    rep(j,20010){
      if(j<a){dp[j]=min(dp[j],b);}else{
        dp[j]=min(dp[j],dp[j-a]+b);
      }
    }
  }
  ll ans=1e18;
  rep(i,ma){
    chmin(ans,dp[i+h]);
  }
  cout << ans << endl;
}

Measured memory_bytes: 3792
#include <stdio.h>
#include <algorithm>
using namespace std;

const int N = 1e5 + 10;

int a[N];

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
  }
  sort(a, a + n);
  int ans = 1;
  for (int i = 1; i * i <= a[0]; i++) {
    if (a[0] % i == 0) {
      int d = 0;
      for (int j = 0; j < n; j++) {
        d += (a[j] % i == 0);
      }
      if (d >= n - 1) {
        ans = max(ans, i);
      }
      d = 0;
      for (int j = 0; j < n; j++) {
        d += (a[j] % (a[0] / i) == 0);
      }
      if (d >= n - 1) {
        ans = max(ans, a[0] / i);
      }
    }
  }
  for (int i = 1; i * i <= a[1]; i++) {
    if (a[1] % i == 0) {
      int d = 0;
      for (int j = 0; j < n; j++) {
        d += (a[j] % i == 0);
      }
      if (d >= n - 1) {
        ans = max(ans, i);
      }
      d = 0;
      for (int j = 0; j < n; j++) {
        d += (a[j] % (a[1] / i) == 0);
      }
      if (d >= n - 1) {
        ans = max(ans, a[1] / i);
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 512
h,w=map(int,input().split())
a=[]
for i in range(h):
  a.append(list(map(int,input().split())))
carry=0
ans=[]
for i in range(h):
  for j in range(w-1):
    if i%2==0:
      if (carry+a[i][j])%2==1:
        ans.append([i+1,j+1,i+1,j+2])
        carry=1
      else:
        carry=0
    if i%2==1:
      if (carry+a[i][w-1-j])%2==1:
        ans.append([i+1,w-j,i+1,w-1-j])
        carry=1
      else:
        carry=0
  if i%2==0 and i!=h-1:
    if (carry+a[i][w-1])%2==1:
      ans.append([i+1,w,i+2,w])
      carry=1
    else:
      carry=0
  if i%2==1 and i!=h-1:
    if (carry+a[i][0])%2==1:
      ans.append([i+1,1,i+2,1])
      carry=1
    else:
      carry=0
print(len(ans))
for b in ans:
  t=[]
  for i in b:
    t.append(str(i))
  print(' '.join(t))


Measured memory_bytes: 93044
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>

using namespace std;

int main()
{
    string s;
    cin >> s;
    int n = 0;
    int l = s.length();
    for (int i=0; i<l; ++i){
        if(s[i] == '2'){
            n++;
        }
    }
    cout << n << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cstdlib>  // abs() for integer 絶対値求めやつ
#include <cmath>    // abs() for float, and fabs()
#include <algorithm>
#include <vector>
#include <string>
#define rep(i,n) for(int i = 0; i < (n);i++)
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
using namespace std;
#define INF 2000000000
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; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;

int a,b,c;//aの倍数のもの＋何かをbで割ったあまりがcになるようにできるかどうか
int main(){
	//とりあえずaにa*-1 で0にできる
	cin>> a >> b >> c ;
	bool ans =true;
	for(int i = 0 ; i < 110 ; i++){
	int k =0;
	k+=a*i;
	if(k%b==c){
		cout<<"YES"<<endl;
		ans = false;
		break;
	}
	}
	if(ans){
		cout<<"NO"<<endl;
	}
		
}



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

int main()
{
    long long N, M;
    cin >> N >> M;

    priority_queue<long long> q;
    long long A;
    for (int i = 0; i < N; i++)
    {
        cin >> A;
        q.push(A);
    }
    for (int i = 0; i < M; i++)
    {
        A = q.top();
        q.pop();
        q.push(A / 2);
    }
    long long ans = 0;
    while (!q.empty())
    {
        ans += q.top();
        q.pop();
    }
    cout << ans << endl;
}


Measured memory_bytes: 1400
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)

// functions
template <class T> T ceil(T a, T b) {
    return (a + b - 1) / b;
}
template <class T> T round(T a, T b) {
    return (a + b / 2) / b;
}
template <class T> T gcd(T a, T b) {
    return b ? gcd(b, a % b) : a;
}
template <class T> T lcm(T a, T b) {
    return a * b / gcd(a, b);
}
template <class T> bool amax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

// main
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, X[500][3];
    cin >> N;
    int res = 0;
    REP(i, N - 1) {
        REP(j, 3) {
            cin >> X[i][j];
        }
    }
    REP(i, N - 1) {
        int res = 0;
        FOR(j, i, N - 1, 1) {
            int t = max(0, ceil(res - X[j][1], X[j][2]));
            res = X[j][1] + X[j][2] * t + X[j][0];
        }
        cout << res << endl;
    }
    cout << 0 << endl;
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
const int N=200005;
int n,i,j,k,head[N],adj[N*2],nxt[N*2],dep[N],p[N],q[N],cnt1,cnt2,id[N];
bool v[N];
void dfs(int x,int dad)
{
	if(dep[x]&1)
		p[++cnt1]=x;
	else
		q[++cnt2]=x;
	for(int y=head[x];y;y=nxt[y])
		if(adj[y]!=dad)
		{
			dep[adj[y]]=dep[x]+1;
			dfs(adj[y],x);
		}
}
int main()
{
	scanf("%d",&n);
	for(i=1;i<n;++i)
	{
		scanf("%d%d",&j,&k);
		adj[i*2-1]=k;
		nxt[i*2-1]=head[j];
		head[j]=i*2-1;
		adj[i*2]=j;
		nxt[i*2]=head[k];
		head[k]=i*2;
	}
	dfs(1,-1);
	if(cnt1>n/3&&cnt2>n/3)
	{
		for(i=1,j=1;i<=n;i+=3,++j)
			id[p[j]]=i;
		for(i=2,j=1;i<=n;i+=3,++j)
			id[q[j]]=i;
		for(i=1;i<=n;++i)
			v[id[i]]=true;
		for(i=1,j=1;i<=n;++i)
			if(!id[i])
			{
				while(v[j])
					++j;
				id[i]=j++;
			}
	}
	else
	{
		if(cnt1<cnt2)
		{
			for(i=3,j=1;j<=cnt1;i+=3,++j)
				id[p[j]]=i;
		}
		else
		{
			for(i=3,j=1;j<=cnt2;i+=3,++j)
				id[q[j]]=i;
		}
		for(i=1;i<=n;++i)
			v[id[i]]=true;
		for(i=1,j=1;i<=n;++i)
			if(!id[i])
			{
				while(v[j])
					++j;
				id[i]=j++;
			}
	}
	for(i=1;i<=n;++i)
		printf("%d ",id[i]);
	return 0;
}


Measured memory_bytes: 14336
#include<iostream>
#include<cmath>
#include<algorithm>

using namespace std;

int main(){

    int n;

    cin >> n;

    long long int a[n],b[n],c[n];

    for(int i=0;i<n;i++)cin >> a[i];
    for(int i=0;i<n;i++)cin >> b[i];
    for(int i=0;i<n;i++)cin >> c[i];

    sort(a,a+n);
    sort(c,c+n);

    long long int s=0;

    for(int i=0;i<n;i++){
     long long int l = lower_bound(a,a+n,b[i])-a;
     long long int m = upper_bound(c,c+n,b[i])-c;
     s += l*(n-m);
    }

    cout << s <<  endl;



}

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

int main()
{

	for (int i = 1; i <= 9; i++) {
		for (int j = 1; j <= 9; j++) {
			printf("%dx%d=%d\n", i, j, i * j);
		}
	}
		return (0);
	
}

Measured memory_bytes: 1096
import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True
x=int(input())
for i in range(x):
  if(is_prime(x+i)):
    break
print(x+i)

Measured memory_bytes: 3060
#include<stdio.h>
int main(){
	int i,j,k;
	int r,g,b,n;
	int xp,cnt=0;
	scanf("%d%d%d%d",&r,&g,&b,&n);
	for(i=0;i<=3000;i++){
		for(j=0;j<=3000;j++){
			if((n-(i*r)-(j*g))>=0 && (n-(i*r)-(j*g))%b==0){
				cnt++;
			}
		}
	}
	printf("%d\n",cnt);
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
template <class T> void chmin(T &a, const T &b) noexcept { if (b < a) a = b; }
template <class T> void chmax(T &a, const T &b) noexcept { if (a < b) a = b; }
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cout << H << " "; debug_out(T...); }
#ifdef _DEBUG
  #define debug(...) debug_out(__VA_ARGS__)
#else
  #define debug(...) 
#endif

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  bool win = true;
  while(true) {
    c -= b;
    if (c <= 0) break;
    a -= d;
    if (a <= 0) {
      win = false;
      break;
    }
  }
  cout << (win ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 3636
/*input
20 20
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................

*/
/*

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

*/
#include<bits/stdc++.h>
#define lld          long long int
#define pb          push_back
#define ppb         pop_back
#define	endl		'\n'
#define mii         map<lld,lld>
#define msi         map<string,lld>
#define mis         map<lld, string>
#define mpi         map<pair<lld ,lld >,lld >
#define pii         pair<lld,lld>
#define vi          vector<lld>
#define vpi 		vector<pii>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (lld)x.size()
#define hell        1000000007
#define rep(i,m,n)	for(lld i=m;i<n;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define what_is(x)  cerr << #x << " is " << x << endl;
#define pr(x) 		cout<< x << " ";
#define pre(x)		cout<< x << endl ;
using namespace std;
#define N  1005
lld dp[N][N];
lld h,w;
char a[N][N];
void init()
{
	rep(i,0,N)
	{
		rep(j,0,N)
		{
			dp[i][j]=-1;
		}
	}
}
lld func(lld x,lld y)
{
	if(x>=h || y>=w)
	{
		return 0;
	}
	if(a[x][y]!='.')
	{
		return 0;
	}
	if(x==h-1 && y==w-1)
	{
		return 1;
	}
	if(dp[x][y]!=-1)
	{
		return dp[x][y];
	}
	lld ans=0;
	ans=(ans+func(x+1,y))%hell;
	ans=(ans+func(x,y+1))%hell;
	dp[x][y]=ans;
	return ans;
}
inline void solve()
{
	init();
	cin >> h >> w;
	rep(i,0,h)
	{
		rep(j,0,w)
		{
			cin >> a[i][j];
		}
	}
	cout << func(0,0) << endl;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int tests=1;
	//cin>>tests;
	while(tests--)
	{
		solve();
	}
}

Measured memory_bytes: 9216
/*
  B - Comparison
  <http://abc059.contest.atcoder.jp/tasks/abc059_b>
*/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, char const *argv[]) {

  char A[101], B[101];
  char a[2], b[2];
  int i;

  scanf("%s", A);
  scanf("%s", B);

  if(strlen(A) > strlen(B)){
    printf("GREATER");
    return 0;
  }else if(strlen(A) < strlen(B)){
    printf("LESS");
    return 0;
  }else{
    for( i=0; i<strlen(A); i++ ){
      a[0] = A[i];
      a[1] = '\0';
      b[0] = B[i];
      b[1] = '\0';
      if( atoi(a) > atoi(b) ){
        printf("GREATER");
        return 0;
      }else if( atoi(a) < atoi(b) ){
        printf("LESS");
        return 0;
      }
    }
    printf("EQUAL");
    return 0;
  }

}


Measured memory_bytes: 128
h,w,ke = map(int,input().split())
c = [list(input()) for _ in range(h)]

ans = 0
for i in range(2**h):
    red1 = []
    for k in range(h):
        if ((i>>k)&1):
            red1.append(k)

    for j in range(2**w):
        red2 = []
        for l in range(w):
            if ((j>>l)&1):
                red2.append(l)
        
        cnt = 0
        for a in range(h):
            for b in range(w):
                if (c[a][b]=='#')and(a in red1)and(b in red2):
                    cnt +=1

        if cnt==ke:
            ans += 1
         
        
print(ans)

Measured memory_bytes: 9156
import math
A, B, H, M = map(int, input().split())

da = (H + M / 60) * 30  #deg
db = 6 * M
da = math.radians(da)
db = math.radians(db)

xa = A * math.cos(da)
ya = A * math.sin(da)
xb = B * math.cos(db)
yb = B * math.sin(db)

print(((xa-xb)**2+(ya-yb)**2)**0.5)

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

int main(void) {
    int A,B;
    cin>>A>>B;
    map<int, int> mp;
    mp[A] = 1;
    mp[B] = 1;
    if (mp.find(1) == mp.end()) cout << 1 << endl;
    else if (mp.find(2) == mp.end()) cout << 2 << endl;
    else cout << 3 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <map>
#include <algorithm> 
#include <vector> 
#include <string.h> 
#include <math.h> 
#include <stdio.h> 
#include <stdlib.h> 
#include <chrono> 
#include <thread> 
#include <iomanip>
#include <typeinfo>

//define
#define trav(i,v)   for(auto i: v)
#define rep(i,n)    for(int i=0;i<n;i++)
#define repu(i,k,n) for(int i=k;i<=n;i++)
#define repd(i,k,n) for(int i=k;i>=n;i--)
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define all(v)  v.begin(), v.end()

//typedef
typedef long long int ll;
typedef long double ld;
typedef std::pair<int, int> pii;
typedef std::vector<int> vi;
typedef std::vector< pii > vii;
typedef std::vector< ll > vll;
typedef std::vector< std::pair < pii, int > > vpp;
 
const long long MOD = 1000000007;
const long long inf = 1e18;
 
using namespace std;

int root_n;

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

ll power(ll x, ll n)
{
    ll res=1;
    while(n>0){
        if(n&1) res=res*x;
        x=x*x;
        n>>=1;
    }
    return res;
}

void always_ignore_function_name()
{
    int d, l, r;
    cin>>l>>r>>d;
    int cnt=0;
    repu(i,l,r)
    {
        if(i%d==0)
            cnt++;
    }    
    cout<<cnt<<endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    int t = 1, tt=1;
    // cin>>t;
    while(tt<=t)
    {
        // cout<<"Case #"<<tt<<": ";
        always_ignore_function_name();
        tt++;
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}

Measured memory_bytes: 3768
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] L = new long[N+1];
        L[0] = 2;
        L[1] = 1;
        for(int i = 2; i <= N; ++i) {
            L[i] = L[i-1]+L[i-2];
        }
        System.out.println(L[N]);
    }
}

Measured memory_bytes: 22732
#include <cmath>
#include <iostream>
#include <string>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <algorithm>

#define rep(i, n) for(long long i = 0; i < n; i++)
#define rep_map(it, m) for(map<string, int>::iterator it = m.begin(); it != m.end(); it++)
#define rep_vector(it, v) for(vector<GuideBook>::iterator it = v.begin(); it != v.end(); it++)

const int MIN = 200001;
const int MOD = 1000000007;
const long long MAX = 1e15 + 9;

using namespace std;

template <class T>
T even(T n)
{
	return !(n % 2);
}
template <class T>
T div_three(T n)
{
	return !(n % 3);
}
template <class T>
T div_five(T n)
{
	return !(n % 5);
}

struct GuideBook {
	string title;
	int score, index;
};

bool option(const GuideBook &a, const GuideBook &b) {
	if (a.title != b.title) {
		return a.title < b.title;
	}
	
	return b.score < a.score;
}

int main() {
	int n, p;
	string s;
	GuideBook r;
	vector<GuideBook> v;
	
	cin >> n;
	
	rep(i, n) {
		cin >> s >> p;
		r.title = s;
		r.score = p;
		r.index = i + 1;
		v.push_back(r);
	}
	
	sort(v.begin(), v.end(), option);
	
	for (int i = 0; i < n; i++) {
		cout << v[i].index << endl;
	}
	
	return 0;
}

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

#define int long long
#define MOD7 1000000007
#define MOD9 1000000009

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

using namespace std;

int nextInt() {int a; cin >> a; return a;}
char nextChar() {char a; cin >> a; return a;}
double nextDouble() {double a; cin >> a; return a;}
string nextString() {string a; cin >> a; return a;}

void inputVector(vector<int> &v, int &n) {rep(i,n){v.push_back(nextInt());}}
void inputVector(vector<double> &v, int &n) {rep(i,n){v.push_back(nextDouble());}}
void inputVector(vector<string> &v, int &n) {rep(i,n){v.push_back(nextString());}}

signed main() {
    string S;
    cin >> S;

    int ret = 0;
    for (int i = 1; i < S.size(); i++) {
	ret += S[i - 1] != S[i];
    }
    cout << ret << endl;

    return 0;
}


Measured memory_bytes: 512
// بِسمِ اللہِ  الرَّحم?نِ  الرَّ حِیم
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define MOD 1000000007
#define ll long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define INF 1e18
#define N 100100
#define PI 3.141592653589793238
typedef pair<ll,ll> pll;
ll power(ll a,ll b)
{
    if(b==1)return a;
    if(b==0)return 1;
    ll temp=power(a,b/2);
    ll ans=temp*temp;
    if(b&1)
        ans*=a;
    return ans;
}
ll power(ll a,ll b,ll p)
{
    a=a%p;
    if(b==1)return a;
    if(b==0)return 1;

    ll temp=power(a,b/2,p);
    ll ans=(temp*temp)%p;
    if(b&1)
        ans=(a*ans)%p;
    return ans%p;
}
ll inv(ll a,ll m)
{
    return power(a,m-2,m);
}
//code begins
void solve(){
    ll n;cin>>n;
    string s;cin>>s;
    ll cntr=0;
    for(auto it:s)if(it=='R')cntr++;
    ll ans=0;
    for(ll i=0;i<cntr;i++)
        if(s[i]=='W')ans++;
    cout<<ans<<endl;
}
signed main()
{
//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);

    ios_base::sync_with_stdio(false);
//    cin.tie(NULL);cout.tie(NULL);

//    ll t;cin>>t;while(t--)
    solve();
    return 0;
}


Measured memory_bytes: 3764
import math
def main():
  N = int(input())
  if (N < 1 or N > 50000):
    print(":(")

  estimatedX1 = math.floor(N / 1.08)
  estimatedX2 = math.ceil(N / 1.08)
  
  if (math.floor(estimatedX1 * 1.08) == N):
    print(math.floor(estimatedX1))
  elif (math.floor(estimatedX2 * 1.08) == N):
    print(math.floor(estimatedX2))
  else:
    print(":(")

main()

Measured memory_bytes: 3060
//diverta2019_d.cpp
//Sat May 11 20:39:56 2019

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

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

	ll ans;
	for (ll i=1;i*i<n;i++){
		if (n%i==0 && n%((n-i)/i)==i){
			ans += (n-i)/i;
		}
	}

	cout << ans << endl;
//	printf("%.4f\n",ans);
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		long k=sc.nextLong();
		long d=sc.nextLong();
		x=Math.abs(x);
		long p=x%d;
		long q=x/d;
		if(q>k){System.out.println(x-(d*k)+"");}
		else{
			k=k-q;
			if(k%2==0){System.out.println(p+"");}
			else{System.out.println(""+Math.abs(p-d));}
		}
	}
}

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

int main(){
    int n, a, b;
    cin >> n >> a >> b;
    if((b-a)%2 == 0){
        cout << "Alice" << endl;
    }else{
        cout << "Borys" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int H =sc.nextInt();
      int A =sc.nextInt();
      
      int a =H/A;
      int b =a+1;
      
      if(H%A==0){
      System.out.println(a);
      }
      else if(H%A!=0){
      System.out.println(b);
      }   
    }
}

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

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

const int INT_INF = 2147483646;
const ll LL_INF = 9223372036854775807;

bool SecondCompare(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second<b.second;
}
 
bool SecondCompareDes(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second>b.second;
}

ll minll(ll a, ll b){
    if(a >= b)  return b;
    else    return a;
}

ll maxll(ll a, ll b){
    if(a >= b)  return a;
    else    return b;
}

ll gcd(ll a, ll b){
    ll tmp;
    if(a%b == 0){
        return b;
    }
    else{
        return gcd(b, a%b);
    }
}

const ll SIZE = 1e5+10;

ll n,r;

int main(){
    cin >> n >> r;
    ll ans = 0;
    if(n >= 10) ans = r;
    else{
        ans = r+100*(10-n);
    }
    cout << ans << endl;
}

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

using namespace std;
typedef long long ll;

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

	vector<bitset<10>> combs(m, bitset<10>(0));

	for (int i = 0; i < m; i++) {
		int cnt;
		cin >> cnt;

		for (int j = 0; j < cnt; j++) {
			int toggle;
			cin >> toggle;

			combs[i][toggle-1] = 1;
		}
	}

	vector<int> cong(m, 0);
	for (int i = 0; i < m; i++) {
		cin >> cong[i];
	}

	int cnt = 0;
	int maxNum = pow(2, n) - 1;
	for (int i = 0; i <= maxNum; i++) {
		bitset<10> test(i);
		int onCnt = 0;
		for (int j = 0; j < m; j++) {
			int switchOn = 0;
			for (int k = 0; k < n; k++) {
				if (test[k] == 1 && combs[j][k] == 1) switchOn++;
			}

			if (switchOn % 2 == cong[j]) onCnt++;
		}

		if (onCnt == m) cnt++;
	}

	cout << cnt;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define sz(x) (int)(x).size()
using namespace std;

ll binpow(ll a, ll b) {
    if (b == 0)
    {
        return 1;
    }
    ll res = binpow(a, b / 2);
    res*=res;
    if (b % 2)
    {
        return res * a;
    }
    return res;
}

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

string to_upper(string a)
{
    for (int i=0;i<(int)a.size();++i) if (a[i]>='a' && a[i]<='z') a[i]-='a'-'A';
    return a;
}
 
string to_lower(string a)
{
    for (int i=0;i<(int)a.size();++i) if (a[i]>='A' && a[i]<='Z') a[i]+='a'-'A';
    return a;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n,k,s;
    cin>>n>>k>>s;
    for (int i=0;i<n;++i)
    {
        if (i<k)
            cout<<s<<" ";
        else if (s!=1e9)
            cout<<s+1<<" ";
        else
            cout<<s-1<<" ";
    }
    return 0;
}

Measured memory_bytes: 1280
#include <stdio.h>
int main(void){
    int W,H,x,y,r;
    scanf("%d%d%d%d%d",&W,&H,&x,&y,&r);
    printf(r>x||W<x+r||r>y||H<y+r?"No\n":"Yes\n");
return 0;
}

Measured memory_bytes: 2752
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] pasta = new int[3];
		int[] juice = new int[2];
		int low_p = 2001, low_j = 2001;
		for(int i=0; i<pasta.length; i++) {
			pasta[i] = sc.nextInt();
			if(low_p > pasta[i]) {
				low_p = pasta[i];
			}
		}
		for(int i=0; i<juice.length; i++) {
			juice[i] = sc.nextInt();
			if(low_j > juice[i]) {
				low_j = juice[i];
			}
		}
		System.out.println(low_p+low_j-50);
	}
}

Measured memory_bytes: 17164
#include <iostream>

using namespace std;

int main()
{
	int month, day, youbi;

	while(cin >> month >> day)
	{
		if(month == 0 && day == 0)    break;

		int year = 2004;
		
		if(month == 1){
			year = 2003;
			month = 13;
		}
		if(month == 2){
			year = 2003;
			month = 14;
		}

		year %= 100;

		youbi = (day + ((26*(month+1))/10) + year + (year/4) - 2*(year/100) + (year/100)/4);

		switch(youbi%7)
		{
			case 1: cout << "Sunday" << endl; break;
			case 2: cout << "Monday" << endl; break;
			case 3: cout << "Tuesday" << endl; break;
			case 4: cout << "Wednesday" << endl; break;
			case 5: cout << "Thursday" << endl; break;
			case 6: cout << "Friday" << endl; break;
			case 0: cout << "Saturday" << endl; break;
		}
	}

	return 0;
}

Measured memory_bytes: 1152
using System;

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        var s = Console.ReadLine().Trim();
        var k = int.Parse(Console.ReadLine().Trim());
        var t = s[k - 1];
        var ans = "";
        for (int i = 0; i < n; i++)
            ans += t == s[i] ? t : '*';
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 11092
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;

public class Main implements Runnable {
	public static void main(String[] args) {
		new Thread(null, new Main(), "", Runtime.getRuntime().maxMemory()).start();
		// new Main().run();
	}

	final long MODULO = (long) (1e9 + 7);
	int n, c;
	int[] a, b;

	public void run() {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		c = sc.nextInt();
		a = new int[n];
		b = new int[n];
		for (int i = 0; i < n; ++i) {
			a[i] = sc.nextInt();
		}
		for (int i = 0; i < n; ++i) {
			b[i] = sc.nextInt();
		}

		long[][] pow = new long[c + 1][401];
		Arrays.fill(pow[0], 1);
		for (int i = 1; i <= c; ++i) {
			for (int j = 0; j < pow[i].length; ++j) {
				pow[i][j] = pow[i - 1][j] * j % MODULO;
			}
		}
		long[][] sum = new long[c + 1][401];
		for (int i = 0; i <= c; ++i) {
			for (int j = 0; j < pow[i].length; ++j) {
				sum[i][j] += (j > 0 ? sum[i][j - 1] : 0) + pow[i][j];
				if (sum[i][j] >= MODULO)
					sum[i][j] -= MODULO;
			}
		}

		long[][] g = new long[c + 1][n];
		for (int i = 0; i <= c; ++i) {
			for (int j = 0; j < n; ++j) {
				g[i][j] = sum[i][b[j]] - (a[j] > 0 ? sum[i][a[j] - 1] : 0);
				g[i][j] = (g[i][j] + MODULO) % MODULO;
			}
		}

		long[][] f = new long[n][c + 1];
		for (int i = 0; i <= c; ++i) {
			f[0][i] = g[i][0];
		}

		for (int i = 1; i < n; ++i) {
			for (int preC = 0; preC <= c; ++preC) {
				for (int curC = 0; preC + curC <= c; ++curC) {
					f[i][preC + curC] += f[i - 1][preC] * g[curC][i] % MODULO;
					f[i][preC + curC] %= MODULO;
				}
			}
		}

		System.out.println(f[n - 1][c] % MODULO);
	}

	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}

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

using namespace std;
 
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

typedef int64_t ll; typedef vector<int> VI; typedef pair<int,int> pii;
const ll mod = 1e9+7;

void dbg(){ cerr << "\n"; }  
template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }


int main()
{
 
	//cin.tie(0); ios_base::sync_with_stdio(false);
	ll n,k;
	cin >>n >>k;
	VI a(n);
	map<int,int> mp;
	rep(i,n) cin >>a[i];
	rep(i,n) mp[a[i]]++;
	int cc=0;
	VI seq;
	for(auto x :mp) if(x.second>0) seq.push_back(x.second);
	
	sort(all(seq));
	int kz = sz(seq);
	if(kz <= k){ puts("0"); return 0;}
	ll ans =0;
	rep(i, kz-k) ans +=seq[i];
	
	
	cout << ans <<"\n";
	
	return 0;
}

Measured memory_bytes: 11516
#include <bits/stdc++.h>
#define ld long double
#define F first
#define S second
#define pb push_back
#define pii pair <int, int>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define reunique(x) (x).resize(std::unique(all(x)) - (x).begin())
#define int long long
using namespace std;

void Solve(){
  //1 2 3 4 5 6 7 8 9 10 11 12 13
  int n;
  cin >> n;
  n--;
  int res = (n * (n + 1)) / 2;
  cout << res;
}

signed main(){
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
  Solve();
  
  return 0;
}
/*



*/

Measured memory_bytes: 256