akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <numeric>
#include <string.h>
#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define repn(i, x) for (int i = 1; i <= (int)(x); i++)
#define repr(i, x) for (int i = ((int)(x) - 1); i >= 0; i--)
#define reprn(i, x) for (int i = ((int)(x)); i > 0; i--)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long int64;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long  INFL = 1e18;
const int MOD = 1000000007;
void solve() {
	string n; cin >> n;
	string rev_n = n; reverse(all(rev_n));
	cout << (n == rev_n ? "Yes" : "No") << endl;
	return;
}

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

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

int a[10000000];

int main()
{
    int n,c=0,b=1,i,j;
    scanf("%d",&n);
    for(i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
    }
    sort(a,a+n);
    for(i=0; i<n-1; i++)
    {
        if(a[i]==a[i+1])
        {
            ++b;
        }
        else
        {
            if(b%2==1)
                ++c;
            b=1;
        }
    }
    b = b-1;
    if(a[n-1]!=a[n-2])
        ++c;
    else if(a[n-1]==a[n-2] && (b%2==0))
        ++c;

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


Measured memory_bytes: 640
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;


class Program
{
    static void Main(string[] args)
    {
        // 入力
        //var s = Console.ReadLine();
        var n = long.Parse(Console.ReadLine());
        char[] s = Console.ReadLine().ToCharArray();

        var ans = long.MaxValue;

        long[] b = new long[n];
        long[] w = new long[n];
        if (s[0] == '.') w[0] = 1;
        if (s[0] == '#') b[0] = 1;
        for (int i = 1; i < n; i++)
        {
            if (s[i] == '.') w[i] = w[i - 1] + 1;
            else w[i] = w[i - 1];

            if (s[i] == '#') b[i] = b[i - 1] + 1;
            else b[i] = b[i - 1];
        }

        ans = Math.Min(ans, w[n - 1]);
        ans = Math.Min(ans, b[n - 1]);
        for (int i = 1; i < n; i++)
        {
            var a = (b[n - i - 1]);
            var c = (w[n - 1] - w[n - i - 1]);
            ans = Math.Min(ans, (b[n - i - 1]) + (w[n - 1] - w[n - i - 1]));
        }


        // 出力
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 31844
#include<cstdio>
#include<vector>
#include<algorithm>
#define N (int)1e6
using namespace std;

int main(){
  int n,tmp,dp[N+1],dp_odd[N+1];
  vector<int> plc;

  for(int i=0;i<=N;i++)dp[i] = dp_odd[i] = N+1;
  dp[0] = dp_odd[0] = 0;

  tmp = 1;
  for(int i=1;;i++){
    plc.push_back(tmp);
    tmp *= i+3; tmp /= i;
    if(tmp>N)break;
  }
  
  for(int i=0;i<=N;i++){
    for(int j=0;j<(int)plc.size();j++){
      if(i<plc[j])break;
      dp[i] = min(dp[i],dp[i-plc[j]]+1);
      if(plc[j]&1)dp_odd[i] = min(dp_odd[i],dp_odd[i-plc[j]]+1);
    }
  }

  while(scanf("%d",&n) && n)printf("%d %d\n",dp[n],dp_odd[n]);
}

Measured memory_bytes: 8500
n, m, l = map(int, input().split())

a = [0 for i in range(n)]
b = [0 for i in range(m)]
c = [[0 for i in range(l)] for j in range(n)]

for i in range(n):
    a[i] = list(map(int, input().split()))

for i in range(m):
    b[i] = list(map(int, input().split()))

for i in range(n):
    for j in range(l):
        for k in range(m):
            c[i][j] += a[i][k] * b[k][j]

for i in range(n):
    for j in range(l):
        if j != l - 1:
            print("%d " % (c[i][j]), end="")
        else:
            print("%d" % (c[i][j]), end="")
    print()




Measured memory_bytes: 7072
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();
		int c=sc.nextInt();
		int count=0;
		for(int i=a;i<=b;i++) {
			if(c%i==0) {
				count ++;
			}
		}		
		System.out.println(count);
	}
}


Measured memory_bytes: 26332
#include <iostream>
#include <algorithm>
#include <string>
#include <functional>
using namespace std;
int main(){
    int N;
    long long int H, W, count = 0;
    long long int A[1000], B[1000];
    cin >> N >> H >> W;
    for(int i = 0; i < N; i++){
        cin >> A[i] >> B[i];
        if(A[i] >= H && B[i] >= W){
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string.h>

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

using namespace std;

typedef long long ll;

int N, H[100];

int main() {
    cin >> N;
    REP(i,N) {
        cin >> H[i];
    }
    int result = 0;
    int max = 0;
    REP(i,N) {
        if (i == 0) {
            result++;
            max = H[i];
            continue;
        }
        if ((H[i - 1] <= H[i]) && max <= H[i]) {
            result++;
            max = H[i];
        }
    }
    
    cout << result << endl;
    
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define int             long long
#define pb              push_back
#define mp              make_pair
#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define nl			    "\n"
#define w(x)            int x; cin>>x; while(x--)
#define fr(i,n)         for (int i = 0; i < n; ++i)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)


int n, weight;
int dp[105][100004];
int v[105], w[105];

int solve(int pos, int wgh  ) {
	//base
	//if (wgh <0) return 0;
	if (pos < 0) return 0;
	//lookup case
	if (dp[pos][wgh] != -1) return dp[pos][wgh];
	//rec
	int rel, op1 = INT_MIN;
	if (wgh - w[pos] >= 0)	op1 = v[pos] + solve(pos - 1, wgh - w[pos]);
	int op2 = solve(pos - 1, wgh);
	rel = max(op1, op2);
	dp[pos][wgh]=rel;
	return rel;
}

int32_t main()
{
	FIO;


	cin >> n >> weight;

	fr(i, n) {cin >> w[i] >> v[i];}
	memset(dp, -1, sizeof dp);
	cout << max(solve(n - 2, weight), v[n - 1] + solve(n - 2, weight - w[n - 1]));
    


}


Measured memory_bytes: 82304
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#define speedX ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cout<< name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
int begtime = clock();
#define end_time() cout << "\n\nTime of execution: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define trace(...)
#define end_time()
#endif


#define int long long 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef vector<int> vi;
typedef vector<pii> vii;
inline bool equals(ld a, ld b) {return fabs(a - b) < 1e-9;}
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define uset unordered_set
#define umap unordered_map
#define all(x) x.begin(), x.end()
#define mod 1000000007


void solve(){
	string a,b;
	cin>>a>>b;
	int n,m;
	cin>>n>>m;
	string t;
	cin>>t;
	if(t==a) cout<<n-1<<" "<<m<<"\n";
	else cout<<n<<" "<<m-1<<"\n";
}
signed main(){
	speedX;
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
	int t=1;
	//cin>>t;
	while(t--){
		solve();
	}
	end_time();
	return 0;
}

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

void insertionSort(int A[], int n, int g, int *cnt)
{
	int i, j, v;
	for (i = g; i < n; i++)
	{
		v = A[i];
		j = i - g;
		while (j >= 0 && A[j] > v)
		{
			A[j + g] = A[j];
			j = j - g;
			(*cnt)++;
		}
		A[j + g] = v;		
	}
	
}

int main()
{
	int i, n, m, cnt;
	int *A;
	int G[100];

	scanf("%d", &n);
	A = (int*)malloc(sizeof(int)*n);
	for (i = 0; i < n; i++) scanf("%d", &A[i]);

	i = n;
	m = 0;
	while ((i = i / 2) > 1)	G[m++] = i;
	G[m++] = 1;

	cnt = 0;
	for (i = 0; i < m; i++) insertionSort(A, n, G[i], &cnt);
	
	printf("%d\n", m);
	for (i = 0; i < m; i++)
	{
		printf("%d", G[i]);
		if (i < m - 1) printf(" ");
	}
	printf("\n");

	printf("%d\n", cnt);

	for (i = 0; i < n; i++)
	{
		printf("%d\n", A[i]);
	}

	free(A);

	return 0;
}

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

int main() {
  int N;
  cin >> N;
  
  int sum=0, l, r;
  for (int i=0; i<N; i++){
    cin >> l >> r;
    
    sum += (r-l+1);
  }
  
  cout << sum << endl;
}


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

int main(){
	set<char> s;
	int N;
	cin >> N;
	
	char now = ' ';
	int count = 0;
	rep(i, N){
		char S;
		cin >> S;
		if(now != S){
			count++;
		}
		now = S;
	}
	cout << count << endl;
	return 0;
}


Measured memory_bytes: 256
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto ii = readln.split.to!(long[]);
    auto A = ii[0];
    auto B = ii[1];
    auto C = ii[2];
    auto X = ii[3];
    auto Y = ii[4];

    writeln(min(
        A*X + B*Y,
        C*X*2 + max(0, (Y-X)*B),
        C*Y*2 + max(0, (X-Y)*A)
    ));
}

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

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int N=Integer.parseInt(in.next()),W=Integer.parseInt(in.next());
		List<mono> A=new ArrayList<>();
		
		int sum=0;
		for(int i=0;i<N;i++) {
			mono m=new mono();
			m.v=Integer.parseInt(in.next());m.w=Integer.parseInt(in.next());
			A.add(m);
		}
		
		int DP[][]=new int[N+1][W+1];
		
		for(int i=1;i<=N;i++) {
			mono m=A.get(i-1);
			for(int j=0;j<=W;j++) {
				if(j<m.w)DP[i][j]=DP[i-1][j];
				else DP[i][j]=Math.max(DP[i-1][j], DP[i-1][j-m.w]+m.v);
			}
		}
		
		int res=-1;
		for(int i=0;i<=W;i++)res=Math.max(res, DP[N][i]);
		
		System.out.println(res);
	}

}

class mono{
	int v=0,w=0;
}



Measured memory_bytes: 31104
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from collections import deque

def agc033_a():
    H, W = map(int, readline().split())
    dist = [[-1] * W for _ in range(H)]
    que = deque()
    for i, ln in enumerate(read().split()):
        for j, c in enumerate(ln.strip().decode('UTF-8')):
            if c == '#':
                que.append((i, j))
                dist[i][j] = 0

    while que:
        x, y = que.popleft()
        for i, j in ((x-1, y), (x, y-1), (x, y+1), (x+1, y)):
            if i < 0 or H-1 < i or j < 0 or W-1 < j: continue
            if dist[i][j] != -1: continue
            dist[i][j] = dist[x][y] + 1
            que.append((i, j))

    ans = 0
    for row in dist:
        ans = max(max(row), ans)
    print(ans)

agc033_a()

Measured memory_bytes: 82980
n = gets.strip.to_i
a = gets.strip.split.map(&:to_i)

result = [0]*n

half =  n/2
half +=1 if n.odd?

(n-1).downto(0) do |index|
  current_sum = 0
  (2..(n/(index+1))).each do |search_index|
    current_sum += result[(index+1)*search_index-1]
  end
  current_sum %= 2

  result[index] = (current_sum + a[index])%2
end


boxes = result.map.with_index {|n,i| [n, i+1] }.select {|n,i| n==1 }.map(&:last)
p boxes.length
puts boxes.join(' ') unless boxes.length.zero?



Measured memory_bytes: 33292
//#include <ext/pb_ds/assoc_container.hpp>
#include <bits/stdc++.h>
using namespace std;
//using namespace __gnu_pbds;
//template <class c, class cmp = less<c> > using ordered_set = tree<c, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 
#endif
template<class T> ostream& operator<<(ostream &os, vector<T> V) {os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {return os << "(" << P.first << "," << P.second << ")";}
template <typename T,typename U>pair<T,U> operator+(const pair<T,U> & l,const std::pair<T,U> & r) { return {l.first+r.first,l.second+r.second};}
typedef long long int ll;
const ll mod =1e9+7;
const int maxn = 300002;
#define endl '\n'
#define int ll
#define ld long double
#define all(x) (x).begin(),(x).end()
vector<int> gl[maxn],gr[maxn];
int vis[maxn],ans[maxn];
vector<int> s;
void dfs(int u){
  vis[u] = true;
  s.push_back(u);
  for(auto v:gl[u]){
    if(!vis[v]) dfs(v);
  }
}
void dfs1(int u){
  vis[u] = true;
  s.push_back(u);
  for(auto v:gr[u]){
    if(!vis[v]) dfs1(v);
  }
}
 struct DSU{
    vector<ll>par,sz;
    DSU(ll n)
    {
      par.resize(n);
      sz = vector<ll>(n,1);
      iota(par.begin(),par.end(),0);
    }
    ll find(ll x){
        if(x==par[x])
          return x;
        return par[x] = find(par[x]);
    }
    void unite(ll a, ll b){
        a = find(a);
        b = find(b);
        if(a==b)
          return ;
        if(sz[a]<sz[b])
          swap(a,b);
        par[b] = a;
        sz[a]+=sz[b];
        return ;
    }

  };
int id = 0;
map<int,int> m;
void solve(){
  id++;
  for(auto u:s){
    m[u] = id;
  }
}

void solve1(){

  map<int,int> h;
  for(auto u:s){
    h[m[u]]++;
  }
  for(auto u:s) ans[u] = h[m[u]];
}
int32_t main()
{ 
   IOS


  int n,k,l;
  cin >> n >> k >> l;
  for(int i = 0;i<k;i++){
    int u,v;
    cin >> u >> v;
    gr[u].push_back(v);
    gr[v].push_back(u);
  }

  for(int i  = 0;i<l;i++){
    int u, v;
    cin >> u >> v;
    gl[u].push_back(v);
    gl[v].push_back(u);
  }

  for(int i = 1;i<=n;i++){
    if(!vis[i]){
      s.clear();
      dfs(i);
      solve();
    }
  }

  memset(vis,0,sizeof(vis));
  for(int i = 1;i<=n;i++){
    if(!vis[i]){
      s.clear();
      dfs1(i);
      solve1();
    }
  }



  for(int i = 1;i<=n;i++)  cout<< ans[i] <<" ";
  


  
  
    
    




  
}

Measured memory_bytes: 43704
#include <stdio.h>
#include <iostream>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <vector>
#include <string.h>
#define inf 0x7fffffff
using namespace std;
// 1692 1684 1234
long long a,b,c,n,i,m,k,l[100100],o[10010],d,e[102000],dx[10]={0,-1,1,0,0,-1,-1,1,1},dy[10]={0,0,0,-1,1,-1,1,-1,1};
long long x,y,z;
stack<int> s;
struct P
{
    int x,y;
    bool operator<(const P &a)const
    {
        return y>a.y;
    }
};
queue<int> q;
string r[200],r2,p,h;
vector<int> v[50010];

//packing  NUMB3RS


int main()
{
    for(int t=1;t<=7;t++) scanf("%lld",&o[t]);
    k=o[2];
    o[2]=o[4];
    o[3]=o[5];
    if(o[1]==0||o[2]==0||o[3]==0)
    {
        printf("%lld",k+o[1]/2*2+o[2]/2*2+o[3]/2*2);
        return 0;
    }
    k+=max(3+(o[1]-1)/2*2+(o[2]-1)/2*2+(o[3]-1)/2*2,o[1]/2*2+o[2]/2*2+o[3]/2*2);
    printf("%lld",k);
    return 0;

}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int MD = 1e9 + 7;
map<pair<ll, ll>, ll> ma;
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll quick_pow(ll a, ll b) {
    ll res=1;
    for(;b;b>>=1){
        if(b&1) res=res*a%MD;
        a=a*a%MD;
    }
    return res;
}



int main() {
    int n, s = 0;
    scanf("%d", &n);
    for(int i = 0; i < n; i++) 
	{
        ll fz,fm;
        scanf("%lld%lld",&fz,&fm);
        ll gc=gcd(fz,fm);
        if(gc==0){s++;continue;}

        fz/=gc,fm/=gc;
        if(fz<0) fm=-fm,fz=-fz;
        ma[{fz,fm}]++;

    }
    ll ans = 1;
    for(auto it : ma) {
        if(it.second == 0) continue;
        ll a = it.first.first, b = it.first.second;
        ll d = quick_pow(2, ma[{a, b}]);
        b = -b;
        if(b < 0) a = -a, b = -b;
        if(ma.count({b, a})) {
            d = (d + quick_pow(2, ma[{b, a}]) - 1) % MD;
            ma[{b, a}] = 0;
        }
        //printf("d:%lld\n\n",d);
        ans = ans * d % MD;
    }
    ans = (ans - 1 + s + MD) % MD;
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 16204
INF = float('inf')
N, K = map(int, input().split())
h = list(map(int, input().split()))

dp = [INF] * N
dp[0] = 0

for i in range(1, N):
    for j in range(1, min(i, K) + 1):
        dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]))

print(dp[N - 1])

Measured memory_bytes: 84848
abcd = input()


def dfs(i, f, sum):
  if i == 3:
    if sum ==7:
      print(f + '=7')
      exit()
    
  else:
    dfs(i+1, f + '+' + abcd[i+1], sum + int(abcd[i+1]))
    dfs(i+1, f + '-' + abcd[i+1], sum - int(abcd[i+1]))


dfs(0, abcd[0], int(abcd[0]))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define pb push_back
typedef long long ll;
using namespace std;
ll n;
vector<ll> a;
bool isp[200005];
void sieve()
{
        memset(isp, true , sizeof isp);
        //for(ll i=0;i<=100002;i++) sign[i] = 1;
        isp[1] = isp[0] = false;
        for(ll i=2;i<=100002;i++)
        {
                if(isp[i]){

                        for(ll j=i+i;j<=100002;j+=i){
                                //ll x = j/i;
                                ///if(x%i == 0) sign[j] = 0;
                                //else sign[j] = sign[j]*-1;
                                isp[j] = false;
                        }
                }
        }
}
int main()
{
        sieve();
        cin >> n;
        /*a.push_back(2);
        a.push_back(3);
        a.push_back(5);
        a.push_back(7);
        a.push_back(11);*/
        //n -= 5;
        //cout << isp[13] << endl; return 0;
        for(ll i = 1 ; a.size() < n ; i++)
        {
                //cout << 3*i - 26 << endl;
                if(isp[5*i - 1]) {
                        //cout << i << endl;
                        a.pb(5*i - 1);
                }
        }
        for(auto i : a) cout << i << " ";
        /*for(ll mask = 0 ; mask < (1LL << 20) ; mask++)
        {
                if(__builtin_popcountll(mask) != 5) continue;
                ll sum = 0;
                vector<ll> X;
                for(ll j = 0 ; j < 20 ; j++) {
                        if(mask&(1LL << j)) {
                                sum += a[j];
                                X.pb(a[j]);
                        }
                }
                if(isp[sum]) {
                        cout << sum << endl;
                        for(auto j : X) cout << j << " ";
                        return 0;
                }
        }*/
        return 0;
}


Measured memory_bytes: 384
# import numpy as np
import sys
# import copy


def xnxn(n=0, flag="v"):
    """
    args:
        int n: a number of lows to read
    example:
        input   1
        retrun  1

        input   1 2 3
        return  [1,2,3]
        input   1 2 3
                4 
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        temp = list(map(int, input().split()))
        if len(temp) == 1:
            if flag == "l":
                return temp
            else:
                return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        temp = [list(map(int, input().split())) for _ in range(n)]
        return temp


n, k = xnxn()
a = xnxn(flag="l")
for _ in range(k):
    tmp = [0]*(n+1)
    for i in range(0, n):
        l = max(0, i - a[i])
        r = min(n, i + a[i]+1)
        tmp[l] += 1
        tmp[r] -= 1
    for i in range(1, n):
        tmp[i] += tmp[i - 1]
    if a == tmp:
        break
    a = tmp

for i in a[:n]:
    print(i, end=" ")


Measured memory_bytes: 152332
N, X, Y = map(int, input().split())

A = [0] * N
for i in range(1, N):
    for j in range(i + 1, N + 1):
        minimum_distance = min(j - i, abs(i - X) + abs(j - Y) + 1)
        A[minimum_distance] += 1
for i in range(1, N):
    print(A[i])

Measured memory_bytes: 3444
package main

import (
	"bufio"
	_ "container/heap"
	"fmt"
	"os"
	_ "sort"
	"strconv"
)

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func lcm(a, b int) int {
	return a / gcd(a, b) * b
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
const MOD = int(1e+9) + 7
const INF = 1 << 60

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	defer wtr.Flush()
	S, K := sc.nextStr(), sc.nextInt()
	n := len(S)
	var dp [101][4][2]int
	dp[0][0][0] = 1
	for i := 0; i < n; i++ {
		for j := 0; j < K+1; j++ {
			for k := 0; k < 2; k++ {
				nd := int(S[i] - '0')
				for x := 0; x < 10; x++ {
					ni, nj, nk := i+1, j, k
					if x != 0 {
						nj++
					}
					if K < nj {
						continue
					}
					if k == 0 {
						if nd < x {
							continue
						}
						if x < nd {
							nk = 1
						}
					}
					dp[ni][nj][nk] += dp[i][j][k]
				}
			}
		}
	}

	fmt.Fprintln(wtr, dp[n][K][0]+dp[n][K][1])
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(int i = a;i < b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(int i = b-1;i >= a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;

const ll INF=(1LL<<50);

set<pll> black;
vector<vector<bool>> used;
bool in_range(ll i,ll l,ll r){
    return l<=i&&i<r;
}
void solve(long long H, long long W, std::vector<std::string> A){
    used.resize(H);
    set<pll> tonari;
    tonari.insert(pll(1,0));
    tonari.insert(pll(-1,0));
    tonari.insert(pll(0,1));
    tonari.insert(pll(0,-1));
    For(i,H){
        used[i].resize(W);
        fill(used[i].begin(),used[i].end(),false);
    }
    For(i,H)For(j,W){
        if(A[i][j]=='#'){
            black.insert(pll(i,j));
            used[i][j]=true;
        }
    }
    set<pll> next;
    ll ans=0;
    while(!black.empty()){
        next.clear();
        for (auto &&i : black)
        {
            for (auto &&j : tonari)
            {
                if(in_range(i.first+j.first,0,H)&&in_range(i.second+j.second,0,W)&&used[i.first+j.first][i.second+j.second]==false){
                    used[i.first+j.first][i.second+j.second]=true;
                    next.insert(pll(i.first+j.first,i.second+j.second));
                }
            }
        }
        if(next.empty())break;
        ans++;
        dump(next.size());
        black=next;
    }
    cout<<ans<<endl;
}

int main(){
    long long H;
    scanf("%lld",&H);
    long long W;
    scanf("%lld",&W);
    std::vector<std::string> A(H);
    for(int i = 0 ; i < H ; i++){
        std::cin >> A[i];
    }
    solve(H, W, std::move(A));
    return 0;
}


Measured memory_bytes: 65280
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int a[n],b[n];
for(int i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);
for(int i=0;i<n;i++)
{
     if(a[i]==a[i+1]){cout<<"NO";   return 0; }
}
cout<<"YES";
return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int ara[n+2];
    for(int i=1;i<=n;i++)
    {
        cin>>ara[i];
    }
    int count=0;

    for(int i=1;i<=n;i++)
    {
        if((ara[i]%2)==1&&(i%2)==1)
        {
                count++;
        }
    }
    cout<<count<<endl;

    return 0;

}


Measured memory_bytes: 3592
#include "bits/stdc++.h"
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/dynamic_bitset.hpp>

namespace adaptor = boost::adaptors;
using namespace std;

void Main()
{
   int64_t N;
   int64_t p0, p = -1;
   int i;
   cin >> N;

   for (i = 0; i < 5; i++)
   {
      cin >> p0;
      if (p < 0 || p > p0)
         p = p0;
   }
   int64_t t;
   if (N % p == 0)
      t = (N / p) + 4;
   else
      t = (N / p + 1) + 4;
   cout << t << endl;
}

int main()
{
   std::cin.tie(nullptr);
   std::ios_base::sync_with_stdio(false);
   std::cout << std::fixed << std::setprecision(15);
   Main();
   return 0;
}

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

int main(){
    int N;cin>>N;
    vector<int> A(N);
    for (int i = 0; i < N; i++)
    {
        cin>>A[i];
        if(A[i]%2==0&&(A[i]%3!=0)&&(A[i]%5!=0))T=false;
    }
    if(T)cout<<"APPROVED";
    else cout<<"DENIED";
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int i,j,k;
  
  int N;
  
  scanf("%d",&N);
  
  int A[N];
  for(i=0;i<N;i++)
    scanf("%d ",&A[i]);
  k=0;
  for(int s=0;s<10000000;s++){
    for(i=0;i<N;i++){
      if(A[i]!=0){
        for(;i<N;i++){
          if(A[i]==0){
            k++;
            break;
          }
          else
            A[i]--;
          if(i==N-1)
            k++;
        }
      }
    }
    for(i=0;i<N;i++){
      if(A[i]!=0){
        j=1;
        break;
      }
    }
    if(j!=1)
      break;
  }
  printf("%d\n",k);
  return 0;
}
          



Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;
int mod = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
    int N,K;
    string S;
    cin >> N >> K >> S;
    int cnt = 0;
    int ans = 0;
    for(int i = 1; i < N; i++) {
        if(S[i] != S[i-1]) {
            cnt++;
        }
        else {
            ans++;
        }
    }
    cout << min(N-1,ans+2*min(cnt,K)) << endl;
}


Measured memory_bytes: 3624
# 2020/02/29
# AtCoder Beginner Contest 097 - B

# Binary Search
def binSearch (tlis, tval):
    lf = 0
    rg = len(tlis)
    while(lf <= rg):
        ct = int((lf + rg) / 2)
        if tlis[ct] < tval:
            lf = ct + 1
        elif tlis[ct] > tval:
            rg = ct - 1
        else:
            return ct
    if tlis[ct] != tval:
        if tlis[ct] < tval:
            return ct
        else:
            return ct - 1
    else:
        return ct

# Input
x = int(input())
pl = list()

pl.append(1)
for i in range(2, 32):
    j = 2
    wkv = i ** j
    while(wkv <= 1000):
        pl.append(wkv)
        j = j + 1
        wkv = i ** j

# Search
pl.sort()
idx = binSearch(pl, x)
ans = pl[idx]

# Output
print(ans)


Measured memory_bytes: 3064
#include <algorithm>  //min, max, sort, unique, fill
#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>  //pair, swap,
#include <vector>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using VI = vector<ll>;

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) for (ll i = 0; i < (n); i++)

static const ll kIntMax = numeric_limits<ll>::infinity();
static const double kFloatMax = numeric_limits<double>::infinity();

vector<ll> vi;

int main() {
  ll n, x, min = 1000;
  cin >> n >> x;
  VI m(n, 0);

  REP(i, n) {
    cin >> m[i];
    x -= m[i];
    if (min > m[i]) min = m[i];
  }

  cout << n + x / min << 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 a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
		if(a < b){
			if(b < c){
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		} else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 26160
module Main where
import Debug.Trace
import Data.List
import Data.Maybe
import Data.Ord
import Control.Monad

solve :: [[Int]] -> [String]
solve [] = []
solve ([h,w]:xs) = (replicate h $ replicate w '#') ++ [""] ++ solve xs

readLine:: IO [Int]
readLine = fmap (map read . words) getLine

readUntil :: ([Int] -> Bool) -> IO [[Int]]
readUntil eof = iter where
    iter = readLine >>=
            (\a -> if eof a then return [] else fmap (a:) iter)

eof :: [Int] -> Bool
eof (x0:x1:xs) = [x0, x1] == [0, 0]

main :: IO() 
main = do
    l <- readUntil eof
    mapM_  putStrLn (solve l)
    


Measured memory_bytes: 4028
n = int(input())
a = [0 for n in range(n)]
for i in range(n):
  a[i] = int(input())
a_max = max(a)
b = sorted(a)
a_second = b[n-2]
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    print(a_second)

Measured memory_bytes: 14128
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static System.Console;
class Z { static void Main() => new K(); }
class K
{
	int F => int.Parse(Str);
	int[] G => Strs.Select(int.Parse).ToArray();
	string Str => ReadLine();
	string[] Strs => Str.Split();
	public K()
	{
		SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Solve();
		Out.Flush();
	}
	void Solve()
	{
		var M = 100000;
		var m = (M - 1) >> 1;
		var ps = new List<int>(9592) { 2 };
		var c = new bool[m];
		for (var p = 0; p < m; p++)
			if (!c[p])
			{
				var q = 2 * p + 3;
				ps.Add(q);
				for (var k = 3 * p + 3; k < m; k += q) c[k] = true;
			}
		var pset = new HashSet<int>(ps);
		var bit = new BinaryIndexedTree(M + 1);
		foreach (var p in ps.Where(x => pset.Contains((x + 1) / 2))) bit.Add(p, 1);
		var Q = F;
		for (var i = 0; i < Q; i++)
		{
			var I = G;
			WriteLine(bit.Sum(I[0], I[1] + 1));
		}
	}
}
class BinaryIndexedTree
{
	public readonly int Size;
	readonly int[] bit;
	public BinaryIndexedTree(int size) { Size = size; bit = new int[size + 1]; }
	public void Add(int index, int value) { for (var i = index + 1; i <= Size; i += i & (-i)) bit[i] += value; }
	public int Sum(int from, int to) => Sum(to) - Sum(from);
	int Sum(int to) { var sum = 0; for (var i = to; i > 0; i -= i & (-i)) sum += bit[i]; return sum; }
}


Measured memory_bytes: 16452
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll=long long;
using vi = vector<int>;
using Graph = vector<vi>;
using P = pair<int,int>;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;

double dp[310][310][310];
int n;

double fnc(int c1,int c2,int c3){
    if(c1==0 && c2==0 && c3==0) return 0;
    if(dp[c1][c2][c3]!=INF) return dp[c1][c2][c3];
    double tmp = (double)1/(1-(double)(n-c1-c2-c3)/n);
    double res = tmp;
    
    if(c1>0) res += fnc(c1-1,c2,c3)*(double)c1/n*tmp;
    if(c2>0) res += fnc(c1+1,c2-1,c3)*(double)c2/n*tmp;
    if(c3>0) res += fnc(c1,c2+1,c3-1)*(double)c3/n*tmp;
    return dp[c1][c2][c3] = res;
}

int main(){
    cin >> n;
    vi a(n);
    rep(i,n) cin >> a[i];
    rep(i,310) rep(j,310) rep(k,310) dp[i][j][k] = INF;
    vi c(3);
    rep(i,n){
        c[a[i]-1]++;
    }
    double ans = fnc(c[0],c[1],c[2]);
    cout << fixed << setprecision(12) << ans << endl;
}

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

int main(){
  string str;
  cin >> str;
  if(str=="SUN"){
    cout << 7 << endl;
    return 0;
  }
  else if(str=="MON"){
    cout << 6 << endl;
    return 0;
  }
  else if(str=="TUE"){
    cout << 5 << endl;
    return 0;
  }
  else if(str=="WED"){
    cout << 4 << endl;
    return 0;
  }
  else if(str=="THU"){
    cout << 3 << endl;
    return 0;
  }
  else if(str=="FRI"){
    cout << 2 << endl;
    return 0;
  }
  else if(str=="SAT"){
    cout << 1 << endl;
    return 0;
  }
}


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

#define ll long long
ll ara[3005],dp[3005][3005];

/**
See session 25.1 55:00 to write tutorial

Obj-1: Here, TARO tries to maximize X-Y, JIRO tries to minimize X-Y means both of them
tries to maximize his score!

dp[i][j] = score of 1st player - score of 2nd player for the sub-array a[i...j].

Here, 1st player means who can give first move for this sub-array(not TARO). That means
after each move 1st player will become 2nd player & 2nd player will become 1st!
For this reason, dp[i][j] = max(ara[i]-dp[i+1][j] , ara[j]-dp[i][j-1])

ara[i]-dp[i+1][j] means
= ara[i] - (1st player score for a[i+1..j] - 2nd player score for a[i+1...j]
= ara[i] - 1st player score for a[i+1...j] + 2nd player score for a[i+1...j]
= (ara[i] + 2nd player score for a[i+1...j]) - 1st player score for a[i+1...j]
= 1st player score for a[i...j] - 2nd player score for a[i...j]

you can see 2nd player of previous state now become 1st player!

we'll try to build DP from small to large size sub-array
**/

int main()
{
    ll i,j,k,n,ans;
    cin>>n;
    for(i=1 ; i<=n ; i++)   cin>>ara[i];

    for(ll sz = 1 ; sz <= n ; sz++){
        for(ll start=1 ; start <= n-sz+1 ; start++){
            ll ed = start+sz-1;
            dp[start][ed] = max(ara[start]-dp[start+1][ed] , ara[ed]-dp[start][ed-1]);
        }
    }

    cout<<dp[1][n]<<endl;

    return 0;
}


Measured memory_bytes: 49716
n = gets.chomp.to_i
K = gets.chomp.to_i
answer = 0
a = Array.new(0)
if K == 1
    while n > 10
        n /= 10
        answer += 9
    end
    answer += n
elsif K == 2
    if n <= 10
        answer = 0
    elsif n <= 100
        answer += (n/10-1)*9
        answer += n%10
    else
        while n >= 10
            a.push(n%10)
            n /= 10
        end
        a.push(n)
        s = a.size
        answer += (s-1)*(s-2)/2*81 + (s-1)*(a[-1]-1)*9
        l = 1
        m = 2
        while l < 2 && m <= s
            if a[-m] != 0
                answer += a[-m] + (s-m)*9
                l += 1
            end
            m += 1
        end 
    end 
else
    if n <= 100
        answer = 0
    else
        while n >= 10
            a.push(n%10)
            n /= 10
        end
        a.push(n)
        s = a.size
        answer += (s-1)*(s-2)*(s-3)/6*729 + (s-1)*(s-2)/2*(a[-1]-1)*81
        l = 1
        m = 2
        while l < 3 && m <= s
            if a[-m] != 0
                if l == 1
                    answer += (s-m)*(s-m-1)/2*81 + (a[-m]-1)*(s-m)*9
                else
                    answer += a[-m] + (s-m)*9
                end
                l += 1
            end 
            m += 1
        end
    end
end
puts answer

Measured memory_bytes: 3836
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)

ll mod = 1e09;

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

  ll a[3];
  REP(i, 3) cin >> a[i];
  SORT(a, 3);
  if(a[2] == a[0] + a[1]) cout << "Yes";
  else cout << "No";
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.math.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int K = sc.nextInt();
    String s = "ACL";
    StringBuilder out = new StringBuilder();
    for (int i = 0; i < K; i++) out.append(s);
    System.out.println(out);
  }
}


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

int main(){
int n;
cin >> n;
string str;
cin >> str;
char c[n];
for(int i=0;i<n;i++){
 c[i] = str[i];
}

int strlen = str.size();


for(int i=0;i<n;i++){
if(c[i]==c[i+1]){
strlen--;
}
}

cout << strlen << endl;
return 0;
}






Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include<algorithm>
#include<iomanip>
#include<queue>
#include<map>
#include<bitset>
#include<math.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
typedef pair<int,int> pint;
typedef pair<long long,pint> p3;
typedef long long ll;
const int inf   = 1e9+7;
const ll  longinf = 1LL<<60;
const int mod=1e9+7;
int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};

int main(){
  int n,m;
  cin>>n>>m;
  queue<int> q[n];
  rep(i,n)rep(j,m){
    int x;cin>>x;
    q[i].push(x-1);
    }
  bool used[m];
  int cnt[m],ans=inf;
  rep(i,m)used[i]=false;
  rep(k,m){
    int res=0;
    rep(i,m)cnt[i]=0;
    rep(i,n){
      bool flag=true;
      while(flag){
        int x=q[i].front();
        if(used[x])q[i].pop();
        else {
          cnt[x]++;
          flag=false;
          }
        }
      }
    int use=1;
    rep(i,m){
      if(cnt[i]>res){
        res=cnt[i];
        use=i;
        }
      }
    used[use]=true;
    ans=min(ans,res);
    }
  cout<<ans<<endl;
  return 0;
  }

Measured memory_bytes: 768
a = [i for i in input()]
b = [i for i in input()]
c = [i for i in input()]

next = a

while True:
    try:
        temp = next.pop(0)
        if temp == "a":
            next = a
        if temp == "b":
            next = b
        if temp == "c":
            next = c
    except:
        break
    

print(temp.upper())

Measured memory_bytes: 3060
/*input
ABC
*/

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

int main() {
    string S;
    cin >> S;
    if (S[1] == 'B') cout << "ARC" << endl;
    else cout << "ABC" << endl;
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;cin>>N;
  vector<int> a(N);
  for(int i=0;i<N;i++)cin>>a.at(i);
  int sub=accumulate(a.begin(),a.end(),0);
  
  int suba,subb,ans=100000;
  for(int i=0;i<N;i++){
    suba=0;subb=0;
    for(int j=0;j<N;j++)
      if(j<=i)suba+=a.at(j);
    subb=sub-suba;
    ans=min(ans,abs(suba-subb));
    if(suba>subb)break;
  }
  
  cout<<ans<<endl;
}

Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
money=1000
stock=0
updown=[0 for i in range(n)]
flag=False

for i in range(1,n):
  if a[i]>a[i-1]:
    updown[i]=1
  if a[i]<a[i-1]:
    updown[i]=2
if a[0]<a[1]:
  buy=money//a[0]
  money-=buy*a[0]
  stock+=buy
  flag=True
for i in range(1,n):
  if updown[i]==1 and flag==False:
    buy=money//a[i-1]
    money-=buy*a[i-1]
    stock+=buy
    flag=True
  if updown[i]==2 and flag==True:
    sell=stock
    money+=sell*a[i-1]
    stock-=sell
    flag=False
if stock>0:
  money+=stock*a[n-1]
print(money)

Measured memory_bytes: 61988
#include<cstdio>
#include<cstring>
int main(){
    char num[5];
    int n;
    int a=0,b=0,ab=0,o=0;
    while(scanf("%d,%s\n",&n,num)!=-1){
        if(strcmp(num,"A")==0)a++;
        else if(strcmp(num,"B")==0)b++;
        else if(strcmp(num,"AB")==0)ab++;
        else o++;
    }
    printf("%d\n%d\n%d\n%d\n",a,b,ab,o);
}

Measured memory_bytes: 0
import math
N,M = map(int,input().split())

if N > 0:
  A = N * (N-1) / 2
elif N ==0:
  A = 0

if M > 0:
  B = M * (M-1) / 2
elif M ==0:
  B = 0

out = int(A) + int(B)
print(out)

Measured memory_bytes: 3060
n = int(input())
s = [input() for _ in range(n)]
ans = [0,0,0,0]
for i in s:
    if i=="AC":
        ans[0] += 1
    elif i=="WA":
        ans[1] += 1
    elif i=="TLE":
        ans[2] += 1
    else:
        ans[3] += 1
print("AC x " + str(ans[0]))
print("WA x " + str(ans[1]))
print("TLE x " + str(ans[2]))
print("RE x " + str(ans[3]))



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

int main()
{
    int n;
    cin >> n;
    int result = n % 1000 == 0 ? 0 : 1000 - (n % 1000);
    cout << result << endl;
    return 0;
}

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

int main(){
    int n;
    cin >> n;
    vector<int> b(n-1);
    rep(i,n-1) cin >> b[i];
    vector<int> a(n);
    int i;
    int sum = 0;
    a[0] = b[0];
    for(i=1;i<n-1;i++){
        a[i] = min(b[i-1],b[i]);
    }
    a[n-1] = b[n-2];
    rep(i,n) sum += a[i];
    cout << sum << endl;

    
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using static System.Console;
using static System.Math;
using static Atcoder.IO;

namespace Atcoder
{
    class Program
    {
        static StreamWriter sw = new StreamWriter(OpenStandardOutput()) { AutoFlush = false };
        static void Main(string[] args)
        {
            try
            {
                SetOut(sw);
                Solve.Answer();
                Out.Flush();
            }
            catch (Exception ex)
            {
                WriteLine(ex.ToString());
                Out.Flush();
            }
        }
    }

    public class Solve
    {
        public static void Answer()
        {
            var s = ReadLine();

            int wk = 0;
            for (int i = 0; i < s.Length; i++)
            {
                wk += int.Parse(s[i].ToString());
                wk %= 9;
            }
            WriteLineYes_or_No(wk == 0);
        }
    }

    public class IO
    {
        #region Input
        public static int RInt => int.Parse(ReadLine());
        public static long RLong => long.Parse(ReadLine());
        public static double RDouble => double.Parse(ReadLine());

        public static string[] RSString => ReadLine().Split();
        public static int[] RSInt => ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        public static long[] RSLong => ReadLine().Split().Select(s => long.Parse(s)).ToArray();
        public static double[] RSDouble => ReadLine().Split().Select(s => double.Parse(s)).ToArray();
        #endregion

        #region Output
        public static void OutJoinSpace<T>(IEnumerable<T> list) => WriteLine(string.Join(" ", list));
        public static void WriteLineYes_or_No(bool flag) => WriteLine(flag ? "Yes" : "No");
        public static void WriteLineYES_or_NO(bool flag) => WriteLine(flag ? "YES" : "NO");
        #endregion
    }

    public class Mod
    {
        #region
        private readonly static long M = 1000000007;

        public static long Add(long a, long b) => (a * b) % M;
        public static long Sub(long a, long b) => (a - b) % M >= 0 ? (a - b) % M : (a - b) % M + M;
        public static long Multi(long a, long b) => (a * b) % M;
        #endregion
    }
}

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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
using ll = long long;
using ld = long double;
const int MOD = 1e9+7;
const ll INF = 1LL << 60;


int main() {
    int n; cin >> n;
    V<ll> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];

    sort(ALL(a), greater<ll>());
    int p = n - 1;
    ll pre = a[p];
    ll sum = 0;
    for(int i = 0; i < n / 2; i++){
        sum += abs(a[i] - pre);
        if(n / 2 <= p - 1) sum += abs(a[i] - a[p - 1]);
        pre = a[p];
        p--;
    }
    p = n - 1;
    pre = a[p];
    ll sum2 = 0;
    for(int i = 0; i < (n + 1) / 2; i++){
        sum2 += abs(a[i] - pre);
        if(n / 2 < p - 1) sum2 += abs(a[i] - a[p - 1]);
        pre = a[p];
        p--;
    }
    cout << max(sum, sum2) << endl;


    return 0;
}


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

bool pal(int n){
    string str = to_string(n);
    if(str[0] == str[4] && str[1] == str[3]) return true;
    else return false; 
}

int main(){
    int a, b, cnt;
    cin >> a >> b;
    cnt = 0;
    for(int i = a; i <= b; i++){
        if(pal(i)) cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
def less_digits(A, B):
    return max(len(str(A)), len(str(B)))


N = int(input())
ans = float("inf")

for i in range(1, int(N**0.5)+2):
    if N % i == 0:
        ans = min(ans, less_digits(i, int(N/i)))

print(ans)

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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll,ll>;

#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define REV(x) reverse(ALL((x)))
#define ASC(x) sort(ALL((x)))
#define DESC(x) ASC((x)); REV((x))
#define pb push_back
#define eb emplace_back


int main()
{
    ll H, N;
    cin >> H >> N;
    vec A(N+1, 0), B(N+1, 0);
    REP(i,1,N+1) cin >> A[i] >> B[i];

    mat dp(N+1, vec(H+1, INF));
    REP(i,0,N+1) dp[i][0] = 0;
    REP(i,1,N+1) {
        REP(j,1,H+1) {
            dp[i][j] = MIN(dp[i][j],dp[i-1][j]);
            if(j >= A[i]) dp[i][j] = MIN(dp[i][j],dp[i][j-A[i]]+B[i]);
            else dp[i][j] = MIN(dp[i][j],B[i]);
        }
    }
    PR(dp[N][H]);

    return 0;
}

/*



*/

Measured memory_bytes: 81592
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
const int N=300010,M=1000010,P=1e9+7;
const int inf=0x3f3f3f3f;
const int INF=0xcfcfcfcf;
const double eps=1e-9,pi=asin(1)*2;
inline ll read();
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
inline int ADD(int a,int b) { return a+b>=P?a+b-P:a+b; }
inline int MINUS(int a,int b) { return a-b<0?a-b+P:a-b; }
#define plus(a,b) a=ADD(a,b)
#define minus(a,b) a=MINUS(a,b)
#define mul(a,b) a=(1ll*a*(b))%P
#define mem(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define pll pair<ll,ll>
#define mp(x,y) make_pair(x,y)

int n,m;
int l[N],r[N];
int c[N];

#ifdef FILE
const int READ_SIZE=1<<20;
char buf[READ_SIZE],*p1=buf,*p2=buf;
#define getchar() p1==p2&&(p2=(p1=buf)+fread(buf,1,READ_SIZE,stdin),p1==p2)?EOF:*p1++
#endif
inline ll read()
{
	ll s=0;
	bool flag=false;
	char ch=getchar();
	for(;ch<'0'||ch>'9';ch=getchar()) if(ch=='-') flag=true;
	for(;'0'<=ch&&ch<='9';ch=getchar()) s=(s<<3)+(s<<1)+(ch^'0');
	if(flag) return -s;
	return s;
}

int main()
{
#ifdef FILE
	freopen(FILE ".in","r",stdin);
	freopen(FILE ".out","w",stdout);
#endif
	n=read(),m=read();
	for(int i=1;i<=n;i++)
	{
		int L=read()-1,R=read();
		for(int l=1,r=0;l<=L;l=r+1)
		{
			r=min(L/(L/l),R/(R/l));
			if(L/l<R/l) c[l]++,c[r+1]--;
		}
		c[L+1]++,c[R+1]--;
	}
	for(int i=1;i<=m;i++) c[i]+=c[i-1];
	for(int i=1;i<=m;i++) printf("%d\n",c[i]);
	return 0;
}

Measured memory_bytes: 1280
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	    // input S := {ABC|ARC}
        // return ABC or ARC
        Scanner sc = new Scanner(System.in);
        if(sc.nextLine().equals("ABC")){
            System.out.println("ARC");
        } else {
            System.out.println("ABC");
        }
    }
}


Measured memory_bytes: 35692