akhauriyash/Code-Regression huggingface dataset:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

a,b = [list(map(int, s.split())) for s in open(0)][0]

al = set(prime_factorize(a))
bl = set(prime_factorize(b))
print(len(al & bl)+1)

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

int main() {
  int a;
  cin >> a;
  if(a % 2 == 0){
    cout << (a / 2) * (a / 2);
  }
  else{
    cout << (a / 2) * ((a / 2) + 1);
  }
  return 0;
}

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

int main()
{
    int n;
    cin >> n;
    unordered_map<ll, ll> sum;
    unordered_map<ll, ll> sub;
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        int a;
        cin >> a;
        ans += sub[i + a];
        ans += sum[i - a];
        sum[i + a]++;
        sub[i - a]++;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 33944
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)
#define PI 3.14159265359
#define EPS 0.0000000001
#define MOD 1000000007
//cout << std::fixed << std::setprecision(15) << y << endl;


int main(){
    string A, B;
    cin >> A >> B;

    ll ans = 0;
    if(A.size() > B.size()){
        ans = -1;
    }else if(A.size() < B.size()){
        ans = 1;
    }else{
        rep(i, A.size()){
            if(A[i] > B[i]){
                ans = -1;
                break;
            }else if(A[i] < B[i]){
                ans = 1;
                break;
            }
        }
    }

    if(ans == -1){
        cout << "GREATER" << endl;
    }else if(ans == 0){
        cout << "EQUAL" << endl;
    }else{
        cout << "LESS" << endl;
    }

    return 0;
}

Measured memory_bytes: 3596
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		System.out.println((s.charAt(2) == s.charAt(3) && s.charAt(4) == s.charAt(5)) ? "Yes" : "No");

	}

}

Measured memory_bytes: 22612
N = int(input())

ans = 0

for i in range(N):

    i += 1
    Npn = 0
    
    for j in range(i):

        j += 1

        if i % j == 0:

            Npn += 1

    if Npn == 8 and i % 2 == 1:
        #print (i ,"の役数は8ko")
        ans += 1


print (ans)
            

Measured memory_bytes: 3060
n,m=map(int,input().split())
edge=[[] for _ in range(n)]
arrive=[0]*n
ready=[]
for i in range(m):
    x,y=map(int,input().split())
    edge[x-1].append(y-1)
    arrive[y-1]+=1
for i in range(n):
    if arrive[i]==0:
        ready.append(i)

path_num=[0]*n
while ready:
    depart=ready.pop()
    for to in edge[depart]:
        path_num[to]=max(path_num[to],path_num[depart]+1)
        arrive[to]-=1
        if arrive[to]==0:
            ready.append(to)
print(max(path_num))

Measured memory_bytes: 87192
#include<stdio.h>
int main()
{
	int w,a,b,max,min,minl,minr,maxl,maxr;
	scanf("%d %d %d",&w,&a,&b);
	if(a > b)
		max = a,min = b;
	else
		max = b,min = a;
	maxr = max + w;
	maxl = max;
	minr = min + w;
	minl = min;
	if(maxr - minl <= 2 * w)
		printf("0\n");
	else
		printf("%d\n",maxl - minr);
	return 0;
}




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

int main(){
    int n;
    cin >> n;
    int temp;
    int maxv = 0;
    vector<int> v(n);
    vector<int> u(n);
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
        u[i] = v[i];
    }
    sort(u.begin(), u.end());
    for (int i = 0; i < n; i++)
    {
        if (u[n-1] == v[i])
        {
            cout << u[n - 2] << endl;
        }
        else
        {
            cout << u[n - 1] << endl;
        }
    }
    return 0;

}

Measured memory_bytes: 3200
#include <iostream>

using namespace std;

int n,a,b,c,d;
string s;


int main(){
  cin >> n >> a >> b >> c >> d;
  cin >> s;
  a--;b--;c--;d--;
  

  int ar[200002] = {};
  ar[c] = 1;
  for(int i = c - 1; i >= a; --i){
    if(s[i] == '#')continue;
    if(i + 2 <= c) ar[i] += ar[i + 2];
    ar[i] += ar[i + 1];
  }
  if(ar[a] ==0 ){cout << "No\n"; return 0;}


  fill(ar, ar+200002, 0);
  ar[d] = 1;
  for(int i = d - 1; i >= b; --i){
    if(s[i] == '#')continue;
    if(i + 2 <= d) ar[i] += ar[i + 2];
    ar[i] += ar[i + 1];
  }
  if(ar[b] ==0 ){cout << "No\n"; return 0;}

  if(c < d){
    cout << "Yes\n";
    return 0;
  }

  
  for(int i = b; i <= d; ++i){
    if(s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.'){
      cout << "Yes\n";
      return 0;
    }
  }

  cout << "No\n";
  return 0;
}


Measured memory_bytes: 1284
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
  public static void main(String args[]) throws IOException{
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

   int n = Integer.parseInt( br.readLine() );
   String[] string=  br.readLine().split(" ");
   int [] Progression = new int[n];


   for(int i = 0; i < n ; i++){
       Progression[i] = Integer.parseInt(string[i] );
   }

   int min;
   int tmp;
   int flag = 0;
   int changecount = 0;

   for(int i = 0; i < n;i++){
	   min = i;
       for(int j = i; j < n; j++){
    	   flag = 0;
    	   if( Progression[j] < Progression[min] ){
    		   min = j;
    		   flag = 1;
    	   }

       }


       tmp = Progression[i];
       Progression[i] = Progression[min];
       Progression[min] = tmp;

       if(tmp != Progression[i]){
    	   changecount++;
       }

   }

   for(int k = 0;k < n; k++){
	   System.out.print( Progression[k] );
	   if(k < n-1){
		   System.out.print(" ");
	   }else{
		   System.out.println();
	   }
   }

   System.out.println(changecount);

 }
}

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

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine();
            var Length = (input.Length-2).ToString();
            Console.WriteLine(input[0]+Length+input[input.Length-1]);
        }

    }

}



Measured memory_bytes: 11092
#include <stdio.h>

#define MAX 100000

struct TRAMP{
	char mark;
	int number;
};

TRAMP cards[MAX];

struct Node{
	Node(){
		number = 0;
		mark_array_index = 0;
		l_p = r_p = p_p = -1;
	}
	int number, mark_array_index,l_p,r_p,p_p;
	char mark_array[5];
};

class Tree{
public:
	Tree(int n){
		num_of_nodes = 0;
		nodes = new Node[n];
	};
	~Tree(){
		delete[] nodes;
	}
	void push(TRAMP data){
		int t = 0;
		while(true){
			if(num_of_nodes == 0){
				nodes[num_of_nodes].number = data.number;
				nodes[num_of_nodes].mark_array[nodes[num_of_nodes].mark_array_index++] = data.mark;
				num_of_nodes++;
				break;
			}else{
				if(nodes[t].number == data.number){
					nodes[t].mark_array[nodes[t].mark_array_index++] = data.mark;
					break;
				}else if(nodes[t].number > data.number){
					if(nodes[t].l_p == -1){
						nodes[t].l_p = num_of_nodes;
						nodes[num_of_nodes].p_p = t;
						nodes[num_of_nodes].number = data.number;
						nodes[num_of_nodes].mark_array[nodes[num_of_nodes].mark_array_index++] = data.mark;
						num_of_nodes++;
						break;
					}else{
						t = nodes[t].l_p;
					}
				}else{
					if(nodes[t].r_p == -1){
						nodes[t].r_p = num_of_nodes;
						nodes[num_of_nodes].p_p = t;
						nodes[num_of_nodes].number = data.number;
						nodes[num_of_nodes].mark_array[nodes[num_of_nodes].mark_array_index++] = data.mark;
						num_of_nodes++;
						break;
					}else{
						t = nodes[t].r_p;
					}
				}
			}
		}
	}

	bool compare(int cards_index){
		int k = 0,number = cards[cards_index].number,t=0;

		while(true){
			if(nodes[t].number == number)
				break;
			else{
				t = (nodes[t].number > number) ? nodes[t].l_p:nodes[t].r_p;
			}
		}

		while(number == cards[cards_index].number){
			if(cards[cards_index].mark != nodes[t].mark_array[k])
				return false;
			else{
				cards_index++;
				k++;
			}
		}
		return true;
	}

private:
	int num_of_nodes;
	Node* nodes;
};


int n;

int Partition(int left,int right){
	int i = left-1,pivot = cards[right].number;
	TRAMP tmp;
	for(int start = left; start < right; start++){
		if(cards[start].number <= pivot){
				i++;
				tmp = cards[i];
				cards[i] = cards[start];
				cards[start] = tmp;
		}
	}

	tmp = cards[right];
	cards[right] = cards[i+1];
	cards[i+1] = tmp;

	return i+1;
}

void quickSort(int left,int right){
	if(left < right){
		int q = Partition(left,right);
		quickSort(left,q-1);
		quickSort(q+1,right);
	}
}


int main(){


	bool stableFLG = true;
	scanf("%d",&n);
	Tree tree(n);

	for(int i = 0; i < n; i++){
		scanf("%s %d",&cards[i].mark,&cards[i].number);
		tree.push(cards[i]);
	}

	quickSort(0,n-1);

	int history = 0;
	for(int i = 1; i < n; i++){
		if(cards[history].number != cards[i].number || i == n-1){
			if(!tree.compare(history)){
				stableFLG = false;
				break;
			}else{
				history = i;
			}
		}
	}

	if(stableFLG){
		printf("Stable\n");
	}else{
		printf("Not stable\n");
	}

	for(int i = 0; i < n; i++)	printf("%c %d\n",cards[i].mark,cards[i].number);
}

Measured memory_bytes: 4368
while 1:
   H, W = map(int,raw_input().split())
 
   if H ==0 and W == 0:
      break
   for i in range(H):
      if i%2 == 0:
        if W%2 == 0:
           print "#."*(W/2)
        elif W%2 == 1:
           print "#."*(W/2)+"#"
      elif i%2 == 1:
         if W%2 == 0:
            print ".#"*(W/2)
         elif W%2 == 1:
            print ".#"*(W/2)+"."
   print ""

Measured memory_bytes: 6448
#include <bits/stdc++.h>
#include <algorithm>
#include <stack>
using namespace std; 
int R, C, N; 
bool border(int x, int y){
	return (x == 0 || x == R || y == 0 || y == C);
}
int gaishu(int x, int y){
	if(y == 0) return x; 
	else if(y == C) return 2 * R + C - x; 
	else if(x == 0) return 2 * R + 2 * C - y; 
	else if(x == R) return R + y; 
}
int main(){	
	cin >> R >> C >> N; 
	vector<pair<int, int>> A; 
	for(int i = 0; i < N; i++){
		int a, b, c, d; 
		cin >> a >> b >> c >> d; 
		if(!border(a, b) || !border(c, d)) continue; 
		A.push_back(pair<int, int> (gaishu(a, b), i)); 
		A.push_back(pair<int, int> (gaishu(c, d), i));
	}
	sort(A.begin(), A.end()); 
	string ans = "YES"; 
	stack<int> guruguru; 
	for(int i = 0; i < A.size(); i++){
		if(!guruguru.size() || guruguru.top() != (A.at(i)).second)
			guruguru.push((A.at(i)).second); 
		else guruguru.pop(); 
	}
	if(guruguru.size()) ans = "NO"; 
	cout << ans << endl; 
}

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

#define REP(i, n) for (ll (i) = 0 ; (i) < (ll)(n) ; ++(i))
#define REPN(i, m, n) for (ll (i) = m ; (i) < (ll)(n) ; ++(i))
#define REP_REV(i, n) for (ll (i) = (ll)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (ll (i) = (ll)(n) - 1 ; (i) >= m ; --(i))

#define INF 2e9
#define INF_LL 1LL<<60
#define ll long long
typedef pair<int, int> P;

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

    REPN(i, 1, sqrt(m) + 1) {
        if(m % i == 0) {
            if((m/i) * n <= m) {
                cout << m / i << endl;
                return 0;
            }
        }
    }

    REPN_REV(i, 1, sqrt(m) + 1) {
        if(m % i == 0) {
            if(i * n <= m) {
                cout << i << endl;
                return 0;
            }
        }
    }


    return 0;
}



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

signed
main(){
	ll N;
	cin >> N;
	vector<ll> a(N);
	for(int i=0;i<N;i++)
		cin >> a[i];

	sort(a.begin(), a.end());

	ll cnt = 0;
	ll before = a[0];

	for(int i=1;i<N;i++)
	{
		if(before == a[i])
			cnt++;

		before = a[i];
	}
	if(cnt % 2 == 0) cout << N - cnt << endl;
	else cout << N - cnt - 1 << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;

int main(void)
{
    //string a,b;
    int a,b,c,d;
    //char a,b,c;
    int i=0,sum=0;
    //char a,b='.';
    cin>>a>>b;
    if(a%b==0) cout<<"0";
    else cout<<"1";
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int H,W;
  cin>>H>>W;
  string a[H];
  for(int i = 0;i<H;i++){
    cin>>a[i];
  }
  int t = 0;
  int nm[H][W],nh[H][W],nu[H][W],ns[H][W];
  for(int i = 0;i<H;i++){
    for(int k = 0;k<W;k++){
      nm[i][k] = 0;
      nh[i][k] = 0;
      nu[i][k] = 0;
      ns[i][k] = 0;
    }
  }
  
  for(int i = 0;i<H;i++){
    t = 0;
    for(int k = 0;k<W;k++){
      if(a[i][k] == '.'){
        t++;
        nm[i][k] = t;
      }
      if(a[i][k] == '#'){
        t = 0;
        nm[i][k] = 0;
      }
    }
  }
  for(int i = 0;i<H;i++){
    t = 0;
    for(int k = W-1;k>=0;k--){
      if(a[i][k] == '.'){
        t++;
        nh[i][k] = t;
      }
      if(a[i][k] == '#'){
        t = 0;
        nh[i][k] = 0;
      }
    }
  }
  
  for(int i = 0;i<W;i++){
    t = 0;
    for(int k = 0;k<H;k++){
      if(a[k][i] == '.'){
        t++;
        nu[k][i] = t;
      }
      if(a[k][i] == '#'){
        t = 0;
        nu[k][i] = 0;
      }
    }
  }
  
  for(int i = 0;i<W;i++){
    t = 0;
    for(int k = H-1;k>=0;k--){
      if(a[k][i] == '.'){
        t++;
        ns[k][i] = t;
      }
      if(a[k][i] == '#'){
        t = 0;
        ns[k][i] = 0;
      }
    }
  }
  
  int ans = 0;
  for(int i = 0;i<H;i++){
    for(int k = 0;k<W;k++){
      ans = max(ans,nm[i][k]+nh[i][k]+nu[i][k]+ns[i][k]-3);
    }
  }
  cout << ans << endl;
  return 0;
}

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

const int mod = 1e9+7;
void tlfclwx(){ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
const int maxn=1e6+10;


int main()
{
   int a, b, c;
   cin >> a >> b;
   map<int,int> mp;
   mp[a] = 1;
   mp[b] = 1;
   for(int i = 1; i <= 3; i++) {
    if(!mp[i]) {
        cout << i << endl;
        break;
    }
   }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
  rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define debug2(x, y)                       \
  cerr << "(" << #x << "," << #y << ") = " \
       << "(" << x << "," << y << ")\n"
#define all(x) x.begin(), x.end()
#define int long long
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int MX = 1e5 + 5, INF = 5LL << 60, MOD = 1e9 + 7;

int N, M;
string S;
vi va, vb;

void input() {
  ;
  ;
  cin >> N;
  va.resize(N);
  rep(i, 0, N - 1) { cin >> va[i]; }
  int ans = 0;
  rep(i, 0, N - 1) {
    rep(j, i + 1, N - 1) { ans += va[i] * va[j]; }
  }
  cout << ans << endl;
}
void solve() {
  ;
  ;
}
signed main() {
  input();
  solve();
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

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

  ll modinv(ll x){
    return modpow(x, MOD-2);
  }

  bool was_output = false;
  template<class t>
  void output(t a){
    if(was_output)cout << " ";
    cout << a;
    was_output = true;
  }
  void outendl(){
    was_output = false;
    cout << endl;
  }
  ll in(){
    ll res;
    scanf("%lld", &res);
    return res;
  }

  template<class t>
  istream& operator>>(istream&is, vector<t>&x){
    for(auto &i:x)is >> i;
    return is;
  }

  template<class t, class u>
  istream& operator>>(istream&is, pair<t, u>&x){
    is >> x.first >> x.second;
    return is;
  }

  template<class t>
  void in(t&x){
    cin >> x;
  }

  template<class t>
  t in(){
    t res; cin >> res; return res;
  }

  template<class t>
  void out(t x){
    cout << x;
  }

  template<class t>
  vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
    sort(line.begin(),line.end(),comp);
    return line;
  }

  template<class t>
  vector<t> reversed(vector<t> line){
    reverse(line.begin(),line.end());
    return line;
  }
}

using namespace templates;


int main(){
    int n = in();
    int k = in();
    vector<ll> line(n);
    foreach(i,line)i=in();
    rep(i,k,n){
        if(line[i-k]<line[i]){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
  return 0;
}


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

int abs(int a,int b){
	if (a>b) return a-b;
	return b-a;
}

int min(int a,int b){
	if (a>b) return b;
	return a;
}

int main(){
	int n,i;
	cin>>n;
	int h[n],dp[n];
	for(i=0;i<n;i++)cin>>h[i];
	dp[0]=0;
	dp[1]=abs(h[0],h[1]);
	dp[2]=abs(h[0],h[2]);
	for(i=3;i<n;i++){
		dp[i]=min(dp[i-1]+abs(h[i],h[i-1]),dp[i-2]+abs(h[i],h[i-2]));
		//cout<<"ok"<<endl;
	}
	cout<<dp[n-1]<<endl;
	return 0;
}

Measured memory_bytes: 1024
import java.lang.reflect.Array;
import java.util.*;
import java.util.function.*;
import java.util.stream.Collectors.*;
public class Main {
    public static void main(String[] args) {
        new Main().solve();
    }
    IO io = new IO();

    /// ********** 本体 ********** ///

    void solve() {
        String[] s = new String[3];
        REP(3,integer -> s[integer]=io.String());
        String ans = "";
        for(int i=0;i<3;++i)ans+=s[i].charAt(0);
        ans=ans.toUpperCase();
        System.out.println(ans);
    }

    void FOR(int a, int b, Consumer<Integer>act) { for(int i = a; i < b; ++i) act.accept(i); }
    void REP(int a, Consumer<Integer>act) { FOR(0, a, act); }
}
class IO{
    String[] nextBuff;
    int      buffCnt;
    Scanner  sc = new Scanner(System.in);
    public IO(){
        nextBuff = new String[0];
        buffCnt = 0;
    }
    String next() {
        if (buffCnt < nextBuff.length) return nextBuff[buffCnt++];
        String line = sc.nextLine();
        while (line == "") line = sc.nextLine();
        nextBuff = line.split(" ");
        buffCnt = 0;
        return nextBuff[buffCnt++];
    }
    public String String() { return next(); }
    public char   Char()   { return next().charAt(0);}
    public int    Int()    { return Integer.parseInt(next());}
    public long   Long()   { return Long.parseLong(next());}
    public double Double() { return Double.parseDouble(next());}
}

Measured memory_bytes: 27860
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int a, b, c;
		String buf = br.readLine();
		StringTokenizer st = new StringTokenizer(buf, " ");

		a = Integer.parseInt(st.nextToken());
		b = Integer.parseInt(st.nextToken());
		c = Integer.parseInt(st.nextToken());
		ArrayList<Num> al = new ArrayList<Num>();
		al.add(new Num(a));
		al.add(new Num(b));
		al.add(new Num(c));

		Collections.sort(al,new NumComparator());

		System.out.println( al.get(0).getNo() + " " + al.get(1).getNo() + " " + al.get(2).getNo());

	}
}

class Num {
	private int no;

	public Num(int a) {
		this.no = a;
	}

	public int getNo() {
		return this.no;

	}

}

class NumComparator implements Comparator<Num> {

	// ??????????????????????????????????????????????????????-1, 0, 1???????????????????¨???°?????????
	public int compare(Num a, Num b) {
		int no1 = a.getNo();
		int no2 = b.getNo();

		// ??????????????¨???????????????????????§??????????????????
		if (no1 > no2) {
			return 1;

		} else if (no1 == no2) {
			return 0;

		} else {
			return -1;

		}
	}
}

Measured memory_bytes: 24344
import sys
from bisect import bisect_left
sys.setrecursionlimit(10**7)
def lmi(): return list(map(int, input().split()))

h, w = lmi()
s = [input() for i in range(h)]

a = [[] for i in range(h)]
al = [[] for i in range(h)]
b = [[] for i in range(w)]
bl = [[] for i in range(w)]
for i in range(h):
    k = 0
    for j in range(w):
        if s[i][j] == '.':
            k += 1
            if j == w-1:
                a[i].append(k)
                al[i].append(j)
        elif j != 0 and s[i][j-1] == '.':
            a[i].append(k)
            al[i].append(j-1)
            k = 0

for i in range(w):
    k = 0
    for j in range(h):
        if s[j][i] == '.':
            k += 1
            if j == h-1:
                b[i].append(k)
                bl[i].append(j)
        elif j != 0 and s[j-1][i] == '.':
            b[i].append(k)
            bl[i].append(j-1)
            k = 0
'''
print(a)
print(al)
print(b)
print(bl)
'''

ans = 0
for i in range(h):
    k = 0
    c = -1
    for j in range(w):
        if s[i][j] == '.':
            c = a[i][k]
            d = b[j][bisect_left(bl[j], i)]
            #print(c,d)
            ans = max(ans, c+d-1)
        elif j != 0 and s[i][j-1] == '.' and c != -1:
                k += 1
print(ans)


Measured memory_bytes: 101080
#![allow(non_snake_case, unused_macros, unused_imports)]

// Input
macro_rules! input { (source = $s:expr, $($r:tt)*) => { let mut iter = $s.split_whitespace(); let mut next = || { iter.next().unwrap() }; input_inner!{next, $($r)*} }; ($($r:tt)*) => { let stdin = std::io::stdin(); let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock())); let mut next = move || -> String{ bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect() }; input_inner!{next, $($r)*} }; }
macro_rules! input_inner { ($next:expr) => {}; ($next:expr, ) => {}; ($next:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($next, $t); input_inner!{$next $($r)*} };}
macro_rules! read_value { ($next:expr, ( $($t:tt),* )) => { ( $(read_value!($next, $t)),* ) }; ($next:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() }; ($next:expr, chars) => { read_value!($next, String).chars().collect::<Vec<char>>() }; ($next:expr, bytes) => { read_value!($next, String).into_bytes() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; }

// Module
use std::cmp::{min,max};
use std::collections::{HashSet,BTreeMap};

// Main
fn main(){
    input!{
        s: chars,
    }
    if s.first()==Some(&'0') || s.last()==Some(&'1') {
        println!("{}", -1);
        return;
    }
    let l = s.len();
    for i in 1..l/2 {
        if s[i] != s[l-2-i] {
            println!("{}", -1);
            return;
        }
    }
    let mut pv = 1;
    for i in 0..l-1{
        let mut nv = i+2;
        if s[i]=='1'{
            println!("{} {}", pv,nv);
            pv = nv
        }else{
            println!("{} {}", pv,nv);
        }
    }
}




Measured memory_bytes: 5500
import java.io.*;
import java.math.*;
import java.util.*;
import java.util.regex.*;


public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static long cnt=0;
	public static PrintWriter pw = new PrintWriter(System.out);
	public static void main(String[] args) throws Exception {
		solutionA(args);
		if(in!=null){
			in.close();
		}
		pw.flush();
		pw.close();
	}

	public static void solutionA(String[] args) throws Exception{
		String s = nextString();
		pw.println(s.substring(0,3));

	}
	public static void solutionB(String[] args) throws Exception{

	}
	public static void solutionC(String[] args) throws Exception{
	}
	public static void solutionD(String[] args) throws Exception{
	}
	public static void solutionE(String[] args) throws Exception{
	}



	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}

}



Measured memory_bytes: 25416
/*
  The Island Was Silent before.
  .....
  And One day again it became Silent.
*/
#include<bits/stdc++.h>
using namespace std;
 
#define endl '\n'
#define ll  long long
#define modd(a,b) ((a+2*b)%b)
#define debug(a) cout << #a << ": " << (a) << "\n"
#define ioso ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define rtt cerr << "Time: " << clock()*1.0 / CLOCKS_PER_SEC << endl;
#define ffe freopen("input.txt","r",stdin), freopen("output.txt","w",stdout);
 
int main() {
  ioso
  #ifndef ONLINE_JUDGE
  ffe
  #endif
  ll a,b,c,d; cin >> a >> b >> c >> d;
  ll ax = a*c;
  ll bx = b*c;
  ll cx = a*d;
  ll dx = b*d;
  cout << (ll)(max({ax,bx,cx,dx})) << endl;
}

Measured memory_bytes: 3684
"""
https://abc071.contest.atcoder.jp/tasks/abc071_b
"""
s=input()
e="abcdefghijklmnopqrstuvwxyz"
a=0
for i in range(len(e)):
    if s.find(e[i])==-1:
        print(e[i])
        break
    a=a+1
if a==len(e):
    print("None")


Measured memory_bytes: 3188
// This amazing code is by Eric Sunli Chen.
#include<bits/stdc++.h>
using namespace std;
template<typename T> bool get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'&&t!=EOF; t=getchar());
	if(t=='-')neg=true,t=getchar();if(t==EOF)return false;
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;return true;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) (get1(a)&&get1(b))
#define get3(a,b,c) (get1(a)&&get2(b,c))
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
typedef vector<int> vi;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

const int maxn=100111;
vector<int>g[maxn];char s[maxn];
int n,dgr[maxn],q[maxn];
bool vis[maxn];

int dep[maxn],w[maxn];
void dfs(int x,int f=0,int d=0)
{
	d+=w[x];
	dep[x]=d;
	for(int i=0;i<(int)g[x].size();i++)if(g[x][i]!=f&&!vis[g[x][i]])dfs(g[x][i],x,d);
}

int main()
{
	get1(n);
	for(int i=1,u,v;i<n;i++)
	{
		get2(u,v);
		g[u].pb(v);
		g[v].pb(u);
		dgr[u]++;dgr[v]++;
	}
	scanf("%s",s+1);
	int piv=1;while(piv<=n&&s[piv]=='B')piv++;
	if(piv>n)
	{
		puts("0");
		return 0;
	}
	
	int fr=0,rr=0;
	for(int i=1;i<=n;i++)if(dgr[i]==1&&s[i]=='B')q[rr++]=i;
	for(;fr<rr;fr++)
	{
		int x=q[fr];
		vis[x]=1;
		for(int i=0;i<(int)g[x].size();i++)
		{
			dgr[g[x][i]]--;
			if(dgr[g[x][i]]==1&&s[g[x][i]]=='B')q[rr++]=g[x][i];
		}
	}
	
	if(rr==n-1)
	{
		puts("1");
		return 0;
	}
	int sum=-2;
	for(int i=1;i<=n;i++)if(!vis[i])
	{
		sum+=2;
		if((dgr[i]%2)!=(s[i]=='W'))// need one
		{
			sum++;
			w[i]=2;
		}
		else w[i]=0;
	}
	
	dfs(piv);piv=max_element(dep+1,dep+n+1)-dep;
	dfs(piv);printf("%d\n",sum-*max_element(dep+1,dep+n+1));
	
	return 0;
}

Measured memory_bytes: 14848
object Main extends App {
  var read = scala.io.StdIn.readLine()
  val array =  read.split(" ").map(_.toInt).toVector
  var a = array(0)
  var b = array(1)
  var t = array(2)
  var count = 0
  var sec = 0
  while((a + sec) < (t + 0.5) ) {
    sec = a + sec
    count += b
  }
  print(count)
}


Measured memory_bytes: 27072
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<vector<int>> Matrix;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
static const int INF = 2000000000;


int main(){
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  if (k <= a) {
    cout << k << endl;
    return 0;
  }
  int ans = a;
  k -= a + b;
  if (k > 0) ans -= k;
  cout << ans << endl;
} 

Measured memory_bytes: 3604
#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[i];
  }
  int temp;
  int count=0;
  bool flag=1;
  while(flag){
    flag=0;
    for (int j=N-1;j>0;j--){
      if(A[j]<A[j-1]){
        temp=A[j-1];
        A[j-1]=A[j];
        A[j]=temp;
        count++;
        flag=1;
      }
    }
  }
  for (int i=0;i<N-1;i++){
    cout<<A[i]<<" ";
  }
  cout<<A[N-1]<<endl;
  cout<<count<<endl;
  return 0;
}


        



Measured memory_bytes: 3088
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		if(n<3) {
			System.out.println(0);
		}
		else {
			System.out.println(n/3);
		}
	}

}


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

using namespace std;
int main(){
    int N=0,x=0;
    cin>>N>>x;
    vector<int> vec(N);

    for(auto &&t:vec){
        cin>>t;
    }

    sort(vec.begin(),vec.end());

    long ans=0;
    for(int i=0;i<N;i++){
        x-=vec[i];
        if(x<0){
            break;
        }
        ans++;
    }

    if(x>0){
        --ans;
    }

    cout<<ans<<endl;
}

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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { cout << #a << " = " << a << endl; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }

typedef long long ll;
int const inf = 1<<29;

map<int, vector<char>> mp = {
  {2, {'a', 'b', 'c'}}, {6, {'m', 'n', 'o'}},
  {3, {'d', 'e', 'f'}}, {7, {'p', 'q', 'r', 's'}},
  {4, {'g', 'h', 'i'}}, {8, {'t', 'u', 'v'}},
  {5, {'j', 'k', 'l'}}, {9, {'w', 'x', 'y', 'z'}}
};

map<char, vector<string>> MS;
vector<int> S;
int N;
deque<string> out;

bool check(string const& word, int idx) {
  int n = word.size();
  rep(i, n) {
    if(idx + i >= N) return false;
    auto& v = mp[S[idx + i]];
    if(find(v.begin(), v.end(), word[i]) == v.end()) return false;
  }
  return true;
}

void output() {
  rep(i, out.size()) {
    if(i) cout << ' ';
    cout << out[i];
  }
  cout << "." << endl;
}

void dfs(int idx) {
  int num = S[idx];
  auto& chrs = mp[num];
  for(auto c: chrs) {
    for(auto word: MS[c]) {
      if(check(word, idx)) {
        int temp = idx;
        idx += word.size();
        out.push_back(word);
        if(idx == N) output();
        else dfs(idx);
        out.pop_back();
        idx = temp;
      }
    }
  }
}

int main() {

  for(int n; cin >> n && n;) {
    MS.clear();
    S.clear();
    rep(i, n) {
      string s; cin >> s;
      MS[s[0]].push_back(s);
    }
    string s; cin >> s;
    N = s.size();
    rep(i, N) S.push_back(s[i]-'0');
    dfs(0);
    cout << "--" << endl;
  }
  
  return 0;
}

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

int main() {
	int a, b;
	char op;
	while (1) {
		cin >> a >> op >> b;
		if (op == '+')
			cout << a + b << endl;
		if (op == '-')
			cout << a - b << endl;
		if (op == '*')
			cout << a * b << endl;
		if (op == '/')
			cout << a / b << endl;
		if (op == '?')
			break;
	}
}



Measured memory_bytes: 3072
#include<bits/stdc++.h>
#define ll long long
#define fr(a,b) for(int i = a; i < b; i++)
#define mod 1000000007
#define triplet pair<int,pair<int,int>>
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
using namespace std;

ll dp[(1<<16)];
ll sums[(1<<16)];

inline bool SET(int num, int bit)
{
   int p2 = 1<<bit;
   return !((p2 & num) == 0);
}

ll solve(vector<vector<int>>& score,int mask)
{
    ll ans = 0;
    if(dp[mask]!=-1)
        return dp[mask];

    for(int subset = mask; subset != 0; subset = (subset - 1)&mask)
    {
        ll temp = sums[subset];
        temp += solve(score, (mask & (~subset)));
        ans = max(ans, temp);
    }
    return dp[mask] = ans;
}

int main(){
    ll i,j,t,n,m,p,k;
    //fast_io;
    //cin>>t;
    t=1;
    while(t--)
    {
        cin>>n;
        vector<vector<int>> score(n, vector<int> (n));
        for(int i = 0; i < n; i++)
        {
            for(int j =0; j < n; j++)
                cin>>score[i][j];
        }
        for(int mask = 0; mask < (1<<n); mask++){
        ll temp = 0;
        for(int bit = 0 ; bit <= 16; bit++)
        {
            if(SET(mask, bit))
                for(int b2 = bit + 1; b2 <= 16; b2++)
                {
                    if(SET(mask, b2))
                        temp += score[bit][b2];
                }
        }
        sums[mask] = temp;
        }
        memset(dp, -1, sizeof dp);
        cout<<solve(score, (1<<n) - 1);
    }
    return 0;
}


Measured memory_bytes: 1280
#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<stack>
#include<map>
#include<list>
#include<string>
#include<algorithm>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back

#define ll __int64
#define P pair<ll,ll>
//#define __int64 long long
int a,b;

int main(){	
	cin>>a>>b;
	cout<<(a+b)%24<<endl;
	return 0;

}


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

int main(){
  int x1,x2,y1,y2;
  cin >> x1 >> y1 >> x2 >> y2;
  
  int x3,y3;
  
  x3 = y1 - y2 + x2;
  y3 = x2 - x1 + y2;
  
  int x4,y4;
  x4 = y1 - y2 + x1;
  y4 = x2 - x1 + y1;
  
  cout << x3 << " " <<  y3 << " " << x4 << " " << y4 << endl;
  
}

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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define all(x) begin(x), end(x)
typedef long long ll;
typedef pair<int, int> pii;
const int inf=1010001000;
const ll  INF=1001000100010001000;
const int mod=(int)1e9+7;

int dp[100009];
vector<int>v;

int main(){
    int n;
    cin>>n;
    int a=1,b=1;
    rep(i,0,10){
        if(pow(6,i)<=n)v.push_back(pow(6,i));
        if(pow(9,i)<=n)v.push_back(pow(9,i));
    }
    rep(i,0,100001)dp[i]=100000;
    dp[0]=0;
    rep(i,0,n+1){
        for(auto j:v){
            if(i+j<100001) dp[i+j]=min(dp[i+j],dp[i]+1);
        }
    }
    cout<<dp[n]<<endl;
return 0;
}

Measured memory_bytes: 1024
x, y = map(int, input().split())
ans = 0
if x * y >= 0:
    if x > y:
        ans = x - y + 2
        if x * y == 0:
            ans = x - y + 1
    else:
        ans = abs(y - x)
else:
    ans = abs(abs(x) - abs(y)) + 1
print(ans)

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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vs = vector<string>;
using vvs = vector<vs>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
    os << "{";
    rep(i, (int)v.size()) {
        if (i)
            os << ",";
        os << v[i];
    }
    os << "}";
    return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
    for (auto val : array)
        std::cout << val << ", ";
    std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

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

    ll n; std::cin >> n;
    rrep(i, n) {
        ll ans = 0;
        for (ll x = 1; x*x <= n; x++) {
            for (ll y = 1; y*y <= n; y++) {
                if (x*x+y*y+x*y > i) break;
                for (ll z = 1; z*z <= n; z++) {
                    if (x*x+y*y+z*z+x*y+y*z+z*x > i) break;
                    if (x*x+y*y+z*z+x*y+y*z+z*x == i) ans++;
                }
            }
        }
        std::cout << ans << "\n";
    }
}


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

int main()
{
  int N;
  int *t, *x, *y;

  cin >> N;

  t = (int*)malloc(sizeof(int)*(N+1));
  x = (int*)malloc(sizeof(int)*(N+1));
  y = (int*)malloc(sizeof(int)*(N+1));

  t[0]=0;
  x[0]=0;
  y[0]=0;
  
  for(int i=1;i<=N;i++){
    cin >> t[i] >> x[i] >> y[i];
  }

  int dt;
  int dist;
  bool is_possible = true;
  for(int i=1;i<=N;i++){
    dt = t[i]-t[i-1];
    dist = abs(x[i]-x[i-1])+abs(y[i]-y[i-1]);
    if(dt%2==0 && dist%2==1 || dt%2==1 && dist%2==0 || dt < dist)
      is_possible = false;
  }
  if(is_possible){
      cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}



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

typedef long long ll;
int N;
int main(){
	cin >> N;
	int A[N+1][20] = {{0}};
	int B[N+1][20] = {{0}};
	ll a;
	for(int i=0;i<N;i++){
		cin >> a;
		for(int j=0;j<20;j++){
			if(a & (1<<j)) A[i][j] = 1;
			if(i>0) B[i][j] = A[i][j] + B[i-1][j];
			else B[i][j] = A[i][j];
		}
	}
/*	for(int i=0;i<N;i++){
		for(int j=0;j<22;j++){
			if(j!=21) cout << A[i][j] <<" ";
			else cout << A[i][j] << endl;
		}
	}*/
	ll ans = 0;
	for(int i=0;i<N;i++){
		int l = i,r = N;
		while(l+1<r){
			int m = (l+r)/2;
			bool judge = true;
			for(int j=0;j<20;j++){
				if(A[i][j]==1){
					if(B[i][j]<B[m][j]) judge = false;
				}else if(A[i][j]==0){
					if(B[i][j]+1<B[m][j]) judge = false;
				}
			}
			if(judge) l = m;
			else r = m;
		}
		ans += l-i+1;
	}
	cout << ans << endl;
}

Measured memory_bytes: 31488
#B
s = input()
t = input()
Min = len(t)

for i in range(len(s)-len(t)+1):
    cont = len(t)
    for j in range(len(t)):
        if s[i+j] == t[j]:
            cont -= 1
            
    if cont < Min:
        Min = cont


print(Min)
        

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

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;
using str = string;

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

long int M = 1e+9+7;
int inf = 1e+9;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << std::setprecision(10);

    int e5 = 100000;
    int n;
    cin >> n;
    int v;
    vi c0(e5+1),c1(e5+1);
    rep(i,n){
        cin >> v;
        if(i%2) c1[v]++;
        else c0[v]++;
    }

    int mxf0=0,mxs0=0,mxf1=0,mxs1=0;
    rep(i,e5+1){
        if(c0[mxf0] < c0[i]){
            mxs0=mxf0;
            mxf0=i;
        }else if(c0[mxs0] < c0[i]){
            mxs0=i;
        }
        if(c1[mxf1] < c1[i]){
            mxs1=mxf1;
            mxf1=i;
        }else if(c1[mxs1] < c1[i]){
            mxs1=i;
        }
    }
    
    int ans;

    if(mxf0 != mxf1) ans = n - (c0[mxf0]+c1[mxf1]);
    else ans = n - max(c0[mxf0]+c1[mxs1], c0[mxs0]+c1[mxf1]);
    cout << ans << endl;
    return 0;
}

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

int main()
{

   long int i, a=0, z=0, results=0;

   char data[200000];

   scanf("%[^\n]c", &data);


   i=0;

   while(data[i]!='A')
   {

       i++;
   }

   a=i;

   while(data[i]!='\0')
   {

        if(data[i]=='Z')
        {
           z=i;
        }
        i++;

   }


   results=(z-a)+1;

    printf("%ld\n", results);
    return 0;
}


Measured memory_bytes: 384
import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		int W, H;
		int x, y, r;

		Scanner stdIn = new Scanner(System.in);

		W = stdIn.nextInt();
		H = stdIn.nextInt();
		x = stdIn.nextInt();
		y = stdIn.nextInt();
		r = stdIn.nextInt();

		if (0 <= (y - r) && H >= (y + r) && 0 <= (x - r) && W >= (x + r)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
}

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

int main(int argc, char **argv)
{
	ll X; cin >> X;
	ll n500 = X / 500;
	X %= 500;
	ll n5 = X / 5;
	std::cout << n500 * 1000 + n5 * 5 << std::endl;
}

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

int main( void )
{
  int N;
  cin >> N;
  vector<int> a( N );
  int point = 0;
  bool can = false;
  int count = 0;

  for( int i = 0; i < N; i++ ) 
    cin >> a.at( i );

  for( int i = 0; i < N; i++ ) {
    point = a.at( point ) - 1;
    count++;
    if( point == 1 ) {
      can = true;
      break;
    }
  }

  if( can )
    cout << count << endl;
  else
    cout << -1 << endl;
}
    

Measured memory_bytes: 3772
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int w = sc.nextInt();
    int h = sc.nextInt();
    int n = sc.nextInt();
    int[] x = new int[n];
    int[] y = new int[n];
    int[] a = new int[n];
    int[][] result = new int[w][h];
    int count = 0;
    for (int i = 0; i < n; i++) {
      x[i] = sc.nextInt();
      y[i] = sc.nextInt();
      a[i] = sc.nextInt();
    }
    for (int i = 0; i < n; i++) {
      if (a[i] == 1) {
        for (int j = 0; j < x[i]; j++) {
          for (int k = 0; k < h; k++) {
            result[j][k] = 1;
          }
        }
      }
      if (a[i] == 2) {
        for (int j = x[i]; j < w; j++) {
          for (int k = 0; k < h; k++) {
            result[j][k] = 1;
          }
        }
      }
      if (a[i] == 3) {
        for (int j = 0; j < w; j++) {
          for (int k = 0; k < y[i]; k++) {
            result[j][k] = 1;
          }
        }
      }
      if (a[i] == 4) {
        for (int j = 0; j < w; j++) {
          for (int k = y[i]; k < h; k++) {
            result[j][k] = 1;
          }
        }
      }
    }
    for (int i = 0; i < w; i++) {
      for (int j = 0; j < h; j++) {
        if (result[i][j] == 0) {
          count++;
        }
      }
    }
    System.out.println(count);
  }
}

Measured memory_bytes: 37552
#include <cstdio>
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#define rep(i,n) for (int i=0;i<n;i++)
using ll = long long;
using namespace std;


void solve(){

}
int main (){
    ios::sync_with_stdio(0);
    cin.tie(0);
    unsigned long long n;
    cin >> n;
    string ans = " ";
    rep(i,100){
        unsigned long long m = 1;
        // rep(j,i+1){
        //     m*=26;
        // }
        if(n%26==0){
            char q = 'z';
            ans = q + ans;
            n-=m;
            n/=26;

        }
        else{
            char q = n%26 - 1 +'a';
            ans = q + ans;
            n-=n%26;
            n/=26;
        }
        if(n==0){
            break;
        }

    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 3652
import math
import numpy as np

def cost(x,y):
  return (x-y)**2

def solve(lst):
  avg = math.floor(np.mean(lst))
  ans = min(sum([cost(i, avg) for i in lst]), sum([cost(i, avg+1) for i in lst]))
  return ans


if __name__ == "__main__":
  n = int(input())
  a_list = [int(i) for i in input().split()]
  print(int(solve(a_list)))


Measured memory_bytes: 21104
#include <bits/stdc++.h>
using namespace std;
#define ll int64_t

const ll mod=1e9+7;

bool isprime(int x){
	if(x<2) return false;
	for(int i=2;i*i<=x;++i)
		if(x%i==0) return false;
	return true;
}

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	int n;
	cin>>n;
	ll res=1;
	for(int i=2;i<=n;++i)
		if(isprime(i)){
			ll t=n,cnt=0;
			while(t>0) cnt+=t/i,t/=i;
			res=res*(cnt+1ll)%mod;
		}
	cout<<res<<'\n';
}



Measured memory_bytes: 3624
import java.util.*;

class Main
{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long [] dp = new long[3];
        for(int i = 0; i < n; i++)
        {
            long [] c = new long[3];
            for(int j = 0; j < 3; j++)
                c[j] = sc.nextInt();
            long [] b = new long[3];
            b[0] = b[1] = b[2] = -1;
            for(int j = 0; j < 3; j++)
            {
                for(int k = 0; k < 3; k++)
                    if(k != j)
                        b[j] = Math.max(dp[k] + c[j], b[j]);
            }
            for(int j = 0; j < 3; j++)
                dp[j] = b[j];
        }
        System.out.println(Math.max(dp[0], Math.max(dp[1], dp[2])));
    }
}

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

int main() {
  int N,minx=1000000,Ans=0;
  cin>>N;
  vector<int> P(N);
  rep(i,N){cin>>P.at(i);
          if(P.at(i)<=minx){minx=P.at(i);Ans++;}
          }
  cout<<Ans<<endl;
}


Measured memory_bytes: 4024
import sys
input = sys.stdin.readline

def main():
    n = list(map(int, input().split()))
    if n[0] > n[1]:
        n[0], n[1] = n[1], n[0]
    ans = 0
    for i in range(n[1]):
        ans += n[0] * 10**i
    print(ans)
main()


Measured memory_bytes: 2940