akhauriyash/Code-Regression huggingface dataset:
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var N int
	fmt.Scan(&N)

	i := 1
	ans := 0
	for i <= N {
		if length := len(strconv.Itoa(i)); length%2 == 1 {
			ans += 1
		}
		i++
	}
	fmt.Println(ans)
}


Measured memory_bytes: 2292
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long int;

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

    ll ans = 0;
    if (n % 2 != 0){
        cout << 0 << endl;
        return 0;
    }
    ll i = 5;
    ll count = 0;
    while(n / 2 >= i){
        i *= 5;
        count++;
    }
    i /= 5;
    if (count == 0){
        cout << 0 << endl;
        return 0;
    }
    ll total = 0;
    for(int j = count; j > 0; j--){
        ll k = (n/2)/ i;
        k -= total;
        ans += j * k;
        total += k;
        i /= 5;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

N, M = map(int, input().split(' '))
if (N >= 2) & (M >=2):
	print(cmb(N, 2) + cmb(M, 2))
elif (N < 2) & (M >=2):
	print(cmb(M, 2))
elif (M < 2) & (N >= 2):
	print(cmb(N, 2))
else:
    print(0)

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

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            var N = int.Parse(ReadLine());

            var ans = 0;
            for (int i = 1; i < N; i++)
            {
                for (int j = 1; j * i < N; j++)
                {
                    if (N >= i * j) ans++;
                }
            }

            WriteLine(ans);
        }

    }
}


Measured memory_bytes: 27524
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String str = sc.next();
		char s[] = new char[n];
		int cp = 0;
		for(int i=0; i<n; i++) {
			s[i] = str.charAt(i);
		}
		for(int i=1; i<n; i++) {
			if(s[i-1] != s[i]) cp++;
		}
		int ans = n - 1 - cp;
		for(int i=0; i<k; i++) {
			ans+=2;
		}
		if(ans <= n-1) {
			System.out.println(ans);
		} else {
			System.out.println(n-1);
		}
		
		
	}

}


Measured memory_bytes: 27292
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Competitive
{

    internal class Solution
    {
        public int N, Y;

        public void Run()
        {
            var line = Input.ReadIntArray();
            N = line[0];
            Y = line[1];

            int[] M = new int[]{10000, 5000, 1000};
            int L = 2000;
            for (int i = 0; i <= N; i++)
            for (int j = 0; j <= N - i; j++)
            {
                int x = Y - M[0] * i - M[1] * j;
                int k = N - i - j;
                if (x == k * M[2])
                {
                    Console.WriteLine("{0} {1} {2}", i, j, k);
                    return;
                }
            }

            Console.WriteLine("{0} {1} {2}", -1, -1, -1);
        }

    }

    internal static class Input
    {
        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }

    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}

Measured memory_bytes: 13396
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>
using namespace std;
int a[100005],b[100005];
int main(){
	int n,j=0,k = 1;
	scanf("%d",&n);
	for(int i = 1;i <= n;i++){
		scanf("%d",&a[i]);
		if(a[i]==i)
		b[k++]=i;
	}
	for(int i = 1;i < k;i++){
		if(a[b[i]]==b[i]){
			int t=a[b[i]+1];
			a[b[i]+1]=a[b[i]];
			a[b[i]]=t;
			if(i == k-1){
				b[i]=b[i-1];
			}
		j++;
		}
	}
	printf("%d\n",j);
}

Measured memory_bytes: 1024
import java.util.*;

class Main {
	Scanner sc = new Scanner(System.in);


	public void run() {
		while(true){
			int x=sc.nextInt(),h=sc.nextInt();
			if(x==0 && h==0)break;
			ln(x*(x+Math.sqrt(x*x+4*h*h)));
		}

	}

	public static void main(String[] args) {
		new Main().run();
	}

	public static void pr(Object o) {
		System.out.print(o);
	}

	public static void ln(Object o) {
		System.out.println(o);
	}

	public static void ln() {
		System.out.println();
	}
}

Measured memory_bytes: 12000
d, g = gets.chomp.split.map(&:to_i)
p = []
c = []
d.times do |i|
  p[i+1], c[i+1] = gets.chomp.split.map(&:to_i)
end

ans = 10000000000

(0...(2**d)).each do |bits|
  pt = 0
  num = 0
  (1..d).each do |i|
    if bits[i-1] == 1
      pt += i * 100 * p[i] + c[i]
      num += p[i]
    end
  end
  d.downto(1) do |i|
    break if pt >= g
    next if bits[i-1] == 1
    n = [p[i], (g-pt)/(100*i)].min
    pt += n * i * 100
    num += n
  end
  ans = num if ans > num
end
puts ans


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
int main()
{
    // 整数の入力
	int n;
  	double a[1000];
	double sum;

    cin >> n;
  	for(int i=0;i<n;i++){
      cin >> a[i];
    }
  
  	sort(a, a+n);
  	sum = a[0];
  	for(int i=1;i<n;i++){
      sum = (sum+a[i])/2;
    }
	
  	cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Main {

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

		Scanner sc = new Scanner(System.in);
		int n,w,d;
		while(true) {
			List<Cake> ls = new LinkedList<>();
		n = sc.nextInt();
		w = sc.nextInt();
		d = sc.nextInt();
		if(w == 0)
			break;
		ls.add(new Cake(w,d));
		for(int i = 0;i < n;i++)
		{
			int p,s;
			p = sc.nextInt();
			s = sc.nextInt();
			Cake tmp = ls.get(p-1);
			ls.remove(p-1);
			Cake[] cakes = tmp.cut(s);
			if(cakes[0].menseki() > cakes[1].menseki())
			{
				ls.add(cakes[1]);
				ls.add(cakes[0]);
			}
			else
			{
				ls.add(cakes[0]);
				ls.add(cakes[1]);
			}
		}
		ls.sort(Comparator.comparing(e -> e.menseki()));
		String tab= "";
		for(int i = 0;i < ls.size();i++)
		{
			System.out.print(tab + ls.get(i).menseki());
			tab = " ";
		}
		System.out.print("\n");
		}
	}

}
class Cake {
	int w,d;
	Cake(int w,int d)
	{
		this.w = w;
		this.d = d;
	}
	int menseki()
	{
		return w * d;
	}
	Cake[] cut (int s)
	{
		int cutpoint = s % (w + d);
		if(cutpoint > w)
		{
			Cake[] cakes = new Cake[2];
			cakes[0] = new Cake(w,d-(cutpoint-w));
			cakes[1] = new Cake(w,cutpoint-w);
			return cakes;
		}
		else
		{
			Cake[] cakes = new Cake[2];
			cakes[0] = new Cake(w-cutpoint,d);
			cakes[1] = new Cake(cutpoint,d);
			return cakes;
		}

	}

}

Measured memory_bytes: 46728
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,n,m) for(int i=(n);i<(m);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define REPR(i,n) for(int i=(n);i>=0;i--)
#define all(vec) vec.begin(),vec.end()
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using P=pair<ll,ll>;
using PP=pair<ll,P>;
using vp=vector<P>;
using vpp=vector<PP>;
using vs=vector<string>;
#define fi first
#define se second
#define pb push_back
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
template<typename A,typename B>istream&operator>>(istream&is,pair<A,B> &p){is>>p.fi>>p.se;return is;}
template<typename A,typename B>ostream&operator<<(ostream&os,const pair<A,B> &p){os<<"("<<p.fi<<","<<p.se<<")";return os;}
template<typename T>istream&operator>>(istream&is,vector<T> &t){REP(i,t.size())is>>t[i];return is;}
template<typename T>ostream&operator<<(ostream&os,const vector<T>&t){os<<"{";REP(i,t.size()){if(i)os<<",";os<<t[i];}cout<<"}";return os;}
const ll MOD=1000000007LL;
const int INF=1<<30;
const ll LINF=1LL<<60;
int main(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<(a-c)*(b-d)<<endl;
    return 0;
}

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

int main(){
  long long int N, num = 0;
  char conv[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
  cin >> N;
  
  vector<int> alp(0);
  
  while (N > 0){
    num = N % 26;
    if (num == 0){
      num = 26;
    }
    alp.push_back(num);
    
    N -= num;
    N /= 26;
  }
  
  string ans = "";
  
  for (int i = alp.size() - 1; i >= 0; i--){
    ans += conv[alp.at(i) - 1];
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
#define base 31
#define MOD 1e9+7
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define FORs(i, a, b) for(int i = a; i >= b; i--)
#define REP(i, a, b) for(int i = a; i < b; i++)
#define __FOR(i, a, b, k) for(int i = a; i <= b; i+= k)
#define __REP(i, a, b, k) for(int i = a; i < b; i+= k)
#define pb push_back
#define _io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define Read_ freopen("input.inp", "r", stdin)
#define Write_ freopen("output.out", "w", stdout);
using namespace std;
typedef pair <int, int> ii;
typedef vector <ii> vii;
#define fi first
#define se second
#define mp make_pair
#define N  52
double d,t,s;
int main(){
    _io; 
    cin>>d>>t>>s;
    //cout<<d/s;
    if (d/s<=t) cout<<"Yes"; else cout<<"No";
}



Measured memory_bytes: 3736
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> P;
map <int,int> mp;
vector<int> V;
#define INF (1<<29) //536870912
#define INFLL (1ll<<58)
#define EPS (1e-10)
static const int MAX= (int)2e5+2;
static const int MOD= (int)1e9+7;
static const int NMAX=50;
static const int MMAX=50;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};
const int tx[8] = { -1,0,1,-1,1,-1,0,1 }, ty[8] = { -1,-1,-1,0,0,1,1,1 };
int N,K,L,a[MAX],b[MAX];
vector<P> ls;

template <size_t N>
class unionFindTree{
    int par[N],rank[N],united[N];
public:
    unionFindTree(){
        for(int i = 0; i < (int) N; i++){
            par[i] = i; rank[i] = 0; united[i] = 1;
        }
    }
    void init(){
        for(int i = 0; i < (int) N; i++){
            par[i] = i; rank[i] = 0; united[i] = 1;
        }
    }
    int find(int x){
        if(par[x] == x) return x;
        else return par[x] = find(par[x]);
    }
    void unite(int x, int y){
        x = find(x); y = find(y);
        if(x == y) return;
        
        if(rank[x] < rank[y]){
            par[x] = y;
            united[y] += united[x];
        }else{
            par[y] = x;
            united[x] += united[y];
            if(rank[x] == rank[y]) rank[x]++;
        }
    }
    bool same(int x, int y){
        return find(x) == find(y);
    }
    int count(int x){
        return united[find(x)];
    }
};


 void solve(){
     unionFindTree<MAX> un_a,un_b;
     
     for(int i=0;i<K;i++) un_a.unite(a[i],b[i]);
     for(int i=K;i<K+L;i++) un_b.unite(a[i],b[i]);
  
     for(int i=0;i<N;i++) ls.push_back(make_pair(un_a.find(i),un_b.find(i)));
     
     sort(ls.begin(),ls.end());
     
     for(int i=0;i<=N-1;i++){
         cout<<upper_bound(ls.begin(),ls.end(),make_pair(un_a.find(i),un_b.find(i)))
         -lower_bound(ls.begin(),ls.end(),make_pair(un_a.find(i),un_b.find(i)))
         <<(i==N-1?"\n":" ");
    }
     
 }


int main(){
    cin.tie(0);  ios::sync_with_stdio(false);
    cin >> N>>K>>L;
    for(int i=0;i<K;i++) {cin>>a[i]>>b[i]; a[i]--; b[i]--;}
    for(int i=K;i<K+L;i++) {cin>>a[i]>>b[i]; a[i]--; b[i]--;}
    solve();
    
    return 0;
}


Measured memory_bytes: 8692
#include <iostream>
using namespace std;
typedef long long  ll;

#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)
ll MOD = 1000000007;
ll F[100001] = { 0 };

int main()
{
	ll N; cin >> N;
	ll a[100];
	bool b[9] = {};
	ll all = 0;
	rep(i, 0, N) {
		ll A;
		cin >> A;
		if (A < 400) b[0] = true;
		else if (A < 800) b[1] = true;
		else if (A < 1200) b[2] = true;
		else if (A < 1600) b[3] = true;
		else if (A < 2000) b[4] = true;
		else if (A < 2400) b[5] = true;
		else if (A < 2800) b[6] = true;
		else if (A < 3200) b[7] = true;
		else if (A >= 3200) all++;
	}
	ll cnt = 0;
	repe(i, 0, 8) {
		if (b[i])cnt++;
	}
	ll max = cnt + all;
	if (all >= 8) {
		max == 8;
	}
	if (cnt == 0) {
		cnt = 1;
	}

	cout << cnt << " " << max << endl;

	return 0;
}

Measured memory_bytes: 256
X=int(input())
if X>=400 and X<=599:
  print(8)
elif X<=799:
  print(7)
elif X<1000:
  print(6)
elif X<1200:
  print(5)
elif X<1400:
  print(4)
elif X<1600:
  print(3)
elif X<1800:
  print(2)
else:
  print(1)

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

bool beki(int x){
    if(x == 1) return true;
    int n = 1;
    for(int i = 2; i <= sqrt(x); ++i){
        n = 1;
        while(n <= x){
            n *= i;
            if(n == x){
                return true;
            }
        }
    }
    return false;
}

int main(){
    int x;
    cin >> x;
    while(true){
        if(beki(x)){
            cout << x << endl;
            return 0;
        }
        x--;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <random>
#include <cstdio>
#include <cstring>
#include <cmath>

// for i in f..<t { as swift
#define forin(i, f, t) for(auto i = f; i < t; i++)

using namespace std;
using ll = long long;
using XY = pair<int, int>;

int main() {
    int n;
    cin >> n;
    vector<vector<int>> a(2, vector<int>(n));
    for (auto &l : a) {
        for (auto &v : l) {
            cin >> v;
        }
    }
    int dp[2][n];
    dp[0][0] = a[0][0];
    forin(i, 1, n) {
        dp[0][i] = dp[0][i - 1] + a[0][i];
    }
    dp[1][n - 1] = a[1][n - 1];
    for (auto i = n - 1; i > 0; i--) {
        dp[1][i - 1] = dp[1][i] + a[1][i - 1];
    }
    int dp2[n];
    int maxA = 0;
    forin(i, 0, n) {
        dp2[i] = dp[0][i] + dp[1][i];
        maxA = max(maxA, dp2[i]);
    }
    cout << maxA << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int ans1,ans2,a[200001],b[200001],r[200001],MAX;
int sc[200001];
int xc[200001];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d",&a[i],&b[i]);
		sc[a[i]]++;
		xc[b[i]]++;
		r[a[i]]++;
		r[b[i]]--;
		MAX=max(MAX,b[i]);
	}
	for(int i=1;i<=MAX;i++)
	{
		sc[i]+=sc[i-1];
		xc[i]+=xc[i-1];
	}
	for(int i=1;i<=n;i++)
	ans1=max(ans1,sc[b[i]-1]-xc[a[i]]);
	for(int i=1;i<=MAX;i++)
	{
		r[i]+=r[i-1];
		ans2=max(ans2,r[i]);
	}
	printf("%d %d\n",ans1,ans2);
	return 0;
}


Measured memory_bytes: 5972
#include <iostream>
using namespace std;
int ab(int A, int B){


    if (B % A == 0){
        return A + B;
    }else{
        return B - A;
    }
}

int main(){

    int A,B;
    cin >> A >>B;
    cout << ab(A, B);

    return 0;

}	

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <climits>
#include <bitset>
#include <list>
#include <map>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

int main(){
	int n, a;
	cin >> n >> a;
	int x[n+1];
	for(int i=1; i<=n; i++) cin >> x[i];

	ll d[n+1][2501], dd[n+1][2501];
	for(int i=0; i<=n; i++){
		for(int j=0; j<2501; j++){
			if(i==0 && j==0) d[i][j]=1;
			else d[i][j]=0;
		}
	}
	ll ans=0;
	for(int i=1; i<=n; i++){
		for(int j=1; j<=i; j++){
			for(int k=0; k<2501; k++){
				dd[j][k]=d[j][k];
				if(x[i]<=k) dd[j][k]+=d[j-1][k-x[i]];
			}
		}
		for(int j=1; j<=i; j++){
			for(int k=0; k<2501; k++){
				d[j][k]=dd[j][k];
			}
		}
	}
	for(int i=1; i<=n; i++) ans+=d[i][a*i];
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 2176
#include<cstdio>
#include<cmath>
using namespace std;
int n,a,qwq,now,ans;
int main()
{
  scanf("%d",&n);
  for(int i=1;i<=n;i++)
  {
    scanf("%d",&qwq);
    a=log2(qwq);
    if((1<<a)<qwq)
	{
      if(now>a)  now=a;
      else  a++;
    }
    if(a>now)  ans+=a-now,now=a;
    if(a<now)  now=a;
  }
  printf("%d", ans);
  return 0;
}

Measured memory_bytes: 128
def IsCommutable(A,B,d):
    if(abs(A-B)<=d):
        return True
    else:
        return False
    

a,b,c,d = map(int,input().split())
#print(a,b,c,d)

Flag = False

if IsCommutable(a,c,d) or (IsCommutable(a,b,d) and IsCommutable(b,c,d)) == True:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 2940
#include<cstdio>
#include<algorithm>
#define MAX 1000000000
#define MAXN 506
using namespace std;
int n,m,a,b,s[MAXN][MAXN];
int main()
{
	scanf("%d%d%d%d",&n,&m,&a,&b);
	if(n%a==0&&m%b==0)
	{
		printf("No");
		return 0;
	}
	int k=MAX/(a*b);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
			if(i%a!=0||j%b!=0) s[i][j]=k;
			else s[i][j]=-(a*b-1)*k-1;
	printf("Yes");
	for(int i=1;i<=n;i++)
	{
		printf("\n");
		for(int j=1;j<=m;j++)
			printf("%d ",s[i][j]);
	}
}

Measured memory_bytes: 3712
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define mod 1000000007
#define FS fixed<<setprecision(15)
using namespace std;
typedef long long ll;
template<class T> using V=vector<T>;
using Graph = vector<vector<int>>;
using P=pair<ll,ll>;
typedef unsigned long long ull;
typedef long double ldouble;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

const ll INF=1e18;

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    ll n,k;
    cin>>n>>k;
    ll ans=0;
    for(ll i=k;i<=n+1;i++){
        ll x=n*(n+1)/2;
        ll y=(n-i)*(n-i+1)/2;
        ans=(ans+(x-y-i*(i-1)/2+1)%mod)%mod;
    }
    //while(ans<0) ans+=mod;
    cout<<ans<<endl;
}
//ペナルティ出しても焦らない　ACできると信じろ！！！
/*
V,P(大文字)使用不可
乗算などの際にオーバーフローに注意せよ！
(適切にmodをとれ　にぶたんで途中で切り上げろ)
制約をよく読め！
(全探索できるなら全探索しろ)
stringの計算量(扱い)注意
コーナー注意！(特に数値が小さいものについては要検証)
N行出力のときは'\n'
グリッド上では行先が範囲内におさまるかif文で確認(RE注意)
if文ではちゃんと比較演算子==を使え(=でもエラー出ない)
配列(vector)の大きさが0か1以上かで場合分けせよ(RE注意)
(vector<int> a(m)でm==0というものはできない)
modはなるべく最後に取れ！
*/

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

int main(){
  ll N,c;
  cin >> N;
  c = 1;
  vector<int> width(N);
  rep(i, N) {
    cin >> width.at(i);
  }
  sort(width.begin(), width.end());
  rep(i, N - 1) {
    if (width.at(i + 1) > width.at(i)) {
      c++;
    }
  }
  cout << c << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
#include<iostream>
#include <string.h>
using namespace std;
typedef long long ll;
ll t=0,n,m;
ll y,z;
ll i,j,k;
ll a[1000005];
int main()
{
    ll h,x=0,j,ans=0,ma=0;
    scanf("%lld",&n);
    for(i=1; i<=n; i++)
    {
        scanf("%lld",&a[i]);
    }
    sort(a+1,a+1+n);
    for(i=1; i<=n; i++)
    {
        for(j=i+1; j<=n; j++)
        {
            for(k=j+1; k<=n; k++)
            {
                if(a[i]+a[j]>a[k]&&a[i]!=a[j]&&a[i]!=a[k]&&a[j]!=a[k])
                {
                    ans++;
                    //printf("%lld %lld %lld\n",a[i],a[j],a[k]);
                }
            }
        }
    }
    printf("%lld\n",ans);

    return 0;
}


Measured memory_bytes: 3816
#include <bits/stdc++.h>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <limits>
#include <string>
#include <vector>

using namespace std;

const long long INF = 1LL << 60;

//各桁の和を出力
long long Sum(long long n) {
  long long m = 0;
  while (n) {
    m += n % 10;
    n /= 10;
  }
  return m;
}

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

void Comuse() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

#define comuse Comuse()
// nCk(comuseを使え)
long long combi(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// pCk(comuseを使え)
long long perm(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] % MOD) % MOD;
}

//最小公倍数(aとbの)
long long lcm(long long a, long long b) {
  long long n;
  n = a / __gcd(a, b) * b;
  return n;
}

// auto A = div(n)
vector<long long> div(long long n) {
  vector<long long> ret;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) {
        ret.push_back(n / i);
      }
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}

//(aのn乗をmodで割ったあまり)
long long modpow(long long a, long long n, long long mod) {
  long long ans = 1;
  while (n > 0) {
    if (n & 1) {
      ans = ans * a % mod;
    }

    a = a * a % mod;

    n >>= 1;
  }

  return ans;
}

void solve();

const int MAX_N = 131072;
// segment tree
int NN;
int seg[MAX_N * 2 - 1];
void seguse() {
  for (int i = 0; i < 2 * NN - 1; i++) {
    seg[i] = INT_MAX;
  }
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(20) << fixed;
  solve();
}

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

long long N;
vector<long long> ball(2000000);
vector<long long> kosuu(2000000);
long long ans = 0;
void solve() {
  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> ball.at(i);
    ball.at(i)--;
    kosuu.at(ball.at(i))++;
  }
  for(int i = 0; i < N; i++){
    ans += kosuu.at(i) * (kosuu.at(i) - 1) / 2;
  }
  for(int i = 0; i < N; i++){
    cout << ans - (kosuu.at(ball.at(i)) - 1) <<endl;
  }
}

Measured memory_bytes: 33920
#include <iostream>
#include <algorithm>
using namespace std;
static const int MAX = 200000;

int main(int argc, char* argv[]) {
    int R[MAX], n;

    cin >> n;
    for ( int i = 0; i < n; i++ ) cin >> R[i];

    int maxv = -2000000000;
    int minv = R[0];

    for ( int i = 1; i < n; i++ ) {
        maxv = max(maxv, R[i] - minv);
        minv = min(minv, R[i]);
    }

    cout << maxv << endl;

    return 0;
}



Measured memory_bytes: 3860
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>

using namespace std;
typedef long long int ll;

bool debug = false;
#define show(x) if (debug) {cout << "" # x << " = " << x << endl;}
#define rep(x, a, b) for (int x = a; x < b; x++)

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

  vector<ll> a(n), b(n);
  rep (i, 0, n) {
    cin >> a[i];
    b[i] = i;
  }

  sort(b.begin(), b.end(), [&a](auto x, auto y){return a[x] < a[y];});
  if (debug) {
    rep(i, 0, n)
      cout << b[i] << " ";
    cout << endl;
  }

  ll sum = 0;
  set<ll> pohe;
  pohe.insert(-1);
  pohe.insert(n);
  
  rep (i, 0, n) {
    auto p = pohe.upper_bound(b[i]);
    ll r = *p;
    ll l = *--p;

    show(l);
    show(r);

    show((b[i] - l) * (r - b[i]));
    sum += (i + 1) * (b[i] - l) * (r - b[i]);

    pohe.insert(b[i]);
  }
  
  cout << sum << endl;
  
  return 0;
}


Measured memory_bytes: 12800
#include <stdio.h>
 
#define PutChar(c) ; *p = (char)(c); ++p;
 
#define MAX_N (2000001)
#define MAX_Ai (10001)
#define STR_SIZE (10000010)
 
int getNum(void);
void putNum(int n);
void CountingSort(int A[], int B[], int k, int len);
 
int A[MAX_N];
int B[MAX_N];
char str[STR_SIZE];
char *p = str;
 
int main(void) {
    register int i;
    int n;
 
    fread(str, 1, STR_SIZE, stdin);
     
    n = getNum();
    for (i = 1; i <= n; ++i) {
        A[i] = getNum();
    }
     
    CountingSort(A, B, MAX_Ai, n);
     
    p = str;
    --n;
    for (i = 1; i <= n; ++i) {
        putNum(B[i]);
        PutChar(' ');
    }
    putNum(B[i]);
    PutChar('\0');
     
    puts(str);
     
    return 0;
}
 
int getNum(void) {
    int n = 0;
    while ((*p >= '0') && (*p <= '9')) {
        n = n * 10 + (int)(*p - '0');
        ++p;
    }
    ++p;
    return n;
}
 
void putNum(int n) {
    int d;
    if (n < 10) {
        PutChar('0' + n);
        return;
    }
    d = n / 10;
    if (d) putNum(d);
    PutChar('0' + (n - (d * 10)));
}
 
void CountingSort(int A[], int B[], int k, int len) {
    int C[MAX_Ai] = { 0 };
    int i, j;
    for (j = 1; j <= len; ++j) {
        ++C[A[j]];
    }
    for (i = 1; i <= k; ++i) {
        C[i] += C[i - 1];
    }
    for (j = len; j > 0; --j) {
        B[C[A[j]]] = A[j];
        --C[A[j]];
    }
}

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

int main() {
    int N; cin >> N;
    vector<int> X(N), Y(N);
    for (int i = 0; i < N; i++) {
        int x, y; cin >> x >> y;
        X[i] = x + y;
        Y[i] = x - y;
    }
    sort(X.begin(), X.end());
    sort(Y.begin(), Y.end());
    long long ans = max(X[N-1] - X[0], Y[N-1] - Y[0]);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4816
import java.util.*;
import java.util.Collections;
import java.util.ArrayList;

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

        String S = sc.next();
        String T = sc.next();
        int l = S.length();

        loop:for(int i=0; i<l; i++){
            for(int j=0; j<l; j++){
                if(S.charAt((j+i)%l)!=T.charAt(j)){
                    break;
                }
                else{
                    if(j==l-1){
                        System.out.println("Yes");
                        break loop;
                    }
                }
            }
            if(i==l-1){
                System.out.println("No");
            }
        }

    }
}

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

class Task {
public:
  void setParam(int A, int B)
  {
    mA = A;
    mB = B;
  }
  bool operator<(const Task& rhs) const
  {
    return mB < rhs.mB;
  }
  int mA;
  int mB;
};

int main() {
  int N;
  cin >> N;
  vector<Task> task(N);
  for (int i=0; i<N; i++) {
    int A,B;
    cin >> A >> B;
    task[i].setParam(A,B);
  }
  sort(task.begin(),task.end());
  int time = 0;
  bool bOk = true;
  for (int i=0; i<N; i++) {
    time += task[i].mA;
    if (time > task[i].mB) {
      bOk = false;
      break;
    }
  }
  if (bOk) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 1792
count = 0
while count < 4:
    count += 1
    a,b=map(int,input().split())
    if(a==1):
        print(b*6000)
    elif(a==2):
        print(b*4000)
    elif(a==3):
        print(b*3000)
    elif(a==4):
        print(b*2000)



Measured memory_bytes: 5596
fun main(args:Array<String>){
  var n = readLine()!!.toInt()
  var p = readLine()!!.split(" ").map{it.toInt()}
  var cnt = 0
  for(i in 1..n-2){
    if(p[i-1] < p[i] && p[i] < p[i+1])cnt++
  	else if(p[i-1] > p[i] && p[i] > p[i+1])cnt++
  }
  println(cnt)
}

Measured memory_bytes: 37748
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  ll n, a, b;
  cin >> n >> a >> b;
  ll d = b - a;
  ll ans;
  if(d % 2 == 0){
    ans = d/2;
  }else{
    ll a1 = (a-1) + 1;
    a1 += (d-1)/2;
    ll a2 = (n-b) + 1;
    a2 += (d-1)/2;
    ans = min(a1, a2);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3544
n = int(input())
ln = list(map(int, input().split()))

ln.sort(reverse=True)

bcs = []
for i in range(1, n-1):
  row = []
  for j in range(i+1, n):
    row.append(ln[i] + ln[j])
  bcs.append(row)

cnt = 0
ix = [0 for _ in range(n-2)]
# a > b,c
for i in range(n-2):
  a = ln[i]
  for j in range(i, n-2):
    try:
      while ix[j] < (n - 2 - j) and bcs[j][ ix[j] ] > a:
        ix[j] += 1
    except:
      print(j, ix[j])
      exit()
  cnt += sum(ix[i:])
print(cnt)

Measured memory_bytes: 60892
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jaynil
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        long ans;
        int a;
        int b;
        int c;
        ArrayList<Integer> l;
        long n;

        public void calc(int i, int as, int bs, int cs, int al, int bl, int cl) {
            if (i == n) {
                if (al == 0 || bl == 0 || cl == 0) return;
                long temp = Math.abs(a - as) + Math.abs(c - cs) + Math.abs(b - bs) + (al - 1) * 10 + (bl - 1) * 10 + (cl - 1) * 10;
                ans = Math.min(ans, temp);
                return;
            }
            calc(i + 1, as + l.get(i), bs, cs, al + 1, bl, cl);
            calc(i + 1, as, bs + l.get(i), cs, al, bl + 1, cl);
            calc(i + 1, as, bs, cs + l.get(i), al, bl, cl + 1);
            calc(i + 1, as, bs, cs, al, bl, cl);
            return;
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            n = in.nextInt();
            a = in.nextInt();
            b = in.nextInt();
            c = in.nextInt();
            ans = Integer.MAX_VALUE;
            l = new ArrayList<Integer>();
            for (int i = 0; i < n; i++) l.add(in.nextInt());
            calc(0, 0, 0, 0, 0, 0, 0);
            out.println(ans);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 24404
#include <stdio.h>

int power(int,int);

int power(int a, int b){
    int i, w=1;
    for(i=0; i<b; i++) w *= a;
    return w;
}

int main(void){
    int D, N;
    scanf("%d %d", &D, &N);
    if(N==100) N++;
    printf("%d\n", power(100, D) * N);
    return 0;
}


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

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define INF2 (1e18)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int op(int a, int b) { return max(a, b); }
int e() { return 0; }

const int LIM = 3e5;

int main(){
    int n, k;
    cin >> n >> k;
    vi a(n);
    rep(i, n) cin >> a[i];
    segtree<int, op, e> seg(LIM+1);
    rep(i, n) {
        int l = max(0, a[i]-k), r = min(LIM, a[i]+k)+1;
        int val = seg.prod(l, r);
        seg.set(a[i], val+1);
    }
    cout << seg.all_prod() << endl;
    return 0;
}


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

int Rank[1000005];
int Tmp[1000005];
int kc,len;

bool compare_sa(int i,int j){
  return
    Rank[i]!=Rank[j]?
    Rank[i]<Rank[j]:
    (i+kc<=len?Rank[i+kc]:-1)<(j+kc<=len?Rank[j+kc]:-1);
}

void construct_sa(char* S,int *sa){
  len=strlen(S);
  for(int i=0;i<=len;i++){
    sa[i]=i;
    Rank[i]=i<len?S[i]:-1;
  }
  for(kc=1;kc<=len;kc*=2){
    sort(sa,sa+len+1,compare_sa);
    Tmp[sa[0]]=0;
    for(int i=1;i<=len;i++){
      Tmp[sa[i]]=Tmp[sa[i-1]]+compare_sa(sa[i-1],sa[i]);
    }
    for(int i=0;i<=len;i++)Rank[i]=Tmp[i];
  }
}


int n,m;
char str[1000005];
char t[1000005];
int sa[1000005];

int main(){
  scanf("%s",str);
  n=strlen(str);
  construct_sa(str,sa);
  scanf("%d",&m);
  while(m--){
    scanf("%s",t);
    int k=strlen(t);
    int l=0,r=n+1,m;
    while(l+1<r){
      m=(l+r)/2;
      if(strncmp(str+sa[m],t,k)<=0)l=m;
      else r=m;
    }
    printf("%d\n",(strncmp(str+sa[l],t,k)==0));
  }
  return 0;
}

Measured memory_bytes: 14904
import sys
sys.setrecursionlimit(1000000)

n, m = map(int, input().split())
edge = {i: [] for i in range(1, n+1)}
graph = {i: -1 for i in range(1, n+1)}

for _ in range(m):
  x, y, z = list(map(int, input().split()))
  edge[x].append(y)
  edge[y].append(x)

def color_graph(i, v):
  if graph[i] == -1:
    graph[i] = v
    for j in edge[i]:
      color_graph(j, v)

ans = 0
for i in range(1, n+1):
  if graph[i] == -1:
    ans += 1
    color_graph(i, i)


print(ans)

Measured memory_bytes: 129568
#include<cstdio>

using namespace std;

int main(){
	int sq[18];
	for(int i=1;i<18;i++)	sq[i]=i*i;

	int memo[301][18];	// [price][j] (the most valuable used coin <= j^2)
	for(int i=0;i<18;i++)	memo[0][i]=1;
	for(int i=1;i<=300;i++){
		for(int j=1;j<18;j++){
			memo[i][j]=(j>0?memo[i][j-1]:0);	// case: use no j^2-credit coins
			for(int k=1;k*sq[j]<=i;k++){		// case: use k j^2-credit coins
				int rem=i-k*sq[j];
				memo[i][j]+=memo[rem][j-1];
			}
		}
	}

	for(int p;scanf("%d",&p),p;){
		int cnt=0;
		printf("%d\n",memo[p][17]);
	}

	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
using namespace std;
#define MAXSIZE 200
#define MAXL 100
typedef long long int lli;

int get_abs(int x);

int main(){
    int w, h, n;
    cin >> w >> h >> n;
    int grid[h][w] = {};

    for(int i = 0; i < n; i++){
        int x, y, a;
        cin >> x >> y >> a;

        if(a == 1){
            for(int h_loop = 0; h_loop < h; h_loop++){
                for(int w_loop = 0; w_loop < x; w_loop++){
                    grid[h_loop][w_loop] = 1;
                }
            }
        }else if(a == 2){
            for(int h_loop = 0; h_loop < h; h_loop++){
                for(int w_loop = w - 1; w_loop >= x; w_loop--){
                    grid[h_loop][w_loop] = 1;
                }
            }
        }else if(a == 3){
            for(int h_loop = 0; h_loop < y; h_loop++){
                for(int w_loop = 0; w_loop < w; w_loop++){
                    grid[h_loop][w_loop] = 1;
                }
            }
        }else{
            for(int h_loop = h - 1; h_loop >= y; h_loop--){
                for(int w_loop = 0; w_loop < w; w_loop++){
                    grid[h_loop][w_loop] = 1;
                }
            }
        }
    }

    int ans = 0;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            //char c = (j == w - 1)? '\n' : ' ';
            //cout << grid[i][j] << c;
            ans += (grid[i][j] == 0);
        }
    }
    cout << ans << endl;
    return 0;
}

int get_abs(int x){
    return (x > 0)? x : -x;
}

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

namespace _151c
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] read = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            string[] readPS = new string[2];
            int[] seikai = new int[read[0]];
            int[] penalty = new int[read[0]];
            bool[] firstAC = new bool[read[0]];
            for(int i = 0; i<read[1];i++){
                readPS = Console.ReadLine().Split();
                //問題の結果がACだったら、正解配列にtrueを加える
                if(readPS[1]=="AC"){
                    seikai[int.Parse(readPS[0])-1] = 1;
                    firstAC[int.Parse(readPS[0])-1] = true;
                }else{//問題の結果がWAだったら、ペナルティ配列に1加える
                    if(firstAC[int.Parse(readPS[0])-1] != true){
                        penalty[int.Parse(readPS[0])-1]++;              
                    }
                }
            }
            int total_seikai = seikai.Count(x=>x==1);
            int total_penalty = 0;
            for(int i = 0; i< read[0]; i++){
                total_penalty += seikai[i] * penalty[i];
            }
            Console.WriteLine("{0} {1}",total_seikai,total_penalty);
        }
    }
}


Measured memory_bytes: 18000
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<int> a(n), b(n);
	rep(i,n){
		cin >> a[i];
		b[i] = a[i];
	}
	sort(b.begin(), b.end());
	rep(i,n){
		if(a[i] <= b[(n-1)/2]) cout << b[n/2] << endl;
		else cout << b[(n-1)/2] << endl;
	}
	return 0;
}

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

string trans(string s,int t){
  return s.substr(t,s.length()-t) + s.substr(0,t);
}

int main(){

  while(1){
    string s; cin >>s;
    if(s == "-") break;
    int n; cin >> n;
    for(int i=0; i<n; i++){
      int t; cin >> t;
      s = trans(s,t);
    }
    cout << s <<endl;
    
  }
}

Measured memory_bytes: 1216
N,_=gets.chomp.split(' ').map{|n| n.to_i}
h = {}
tmp = gets.chomp
h[tmp] = true
lc = tmp[-1]
1.upto(N-1){|d|
	tmp=gets.chomp
	if(tmp[0]!=lc || !h[tmp].nil?)
		puts "No"
		exit(0)
	end
	h[tmp] = true
	lc = tmp[-1]
}
puts "Yes"


Measured memory_bytes: 1788
#include <stdio.h>

int main()
{
	int no_a, no_b;
	scanf("%d %d", &no_a, &no_b);
	if (no_a < no_b)
		printf("a < b\n");
	else if (no_a>no_b)
		printf("a > b\n");
	else
		printf("a == b\n");
	return 0;
}

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

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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

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

  string S;
  int cnt = 0;
  cin >> S;
  rep(i, S.size()-1) {
    if (S[i]!=S[i+1])
      cnt++;
  }
  cout << cnt << endl;
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(obj) (obj).begin(), (obj).end()
#define bit(n) (1LL << (n))

typedef long long ll;

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

const long long INF = 1LL << 60;

bool solve(int x, int y, int z) {
  return (x+y>z and y+z>x and z+x>y);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  double n,x,t; cin>>n>>x>>t;
  
  int res = ceil(n/x) * t;
  
  cout<<res;
  return 0;
}

Measured memory_bytes: 3732
#include <iostream>
#include <queue>
#include <vector>
#include <cstring>
using namespace std;

vector<int> g[100010];
int v[100010];

int main()
{
    int n, m; cin>>n>>m;
    for(int i=0; i<m; ++i) {
        int a, b; cin>>a>>b;
        --a, --b;
        g[a].push_back(b);
        g[b].push_back(a);
    }

    memset(v, -1, sizeof(v));

    queue<int> q;
    q.push(0);
    v[0]=0;
    while (!q.empty()) {
        int p=q.front(); q.pop();
        for(int w: g[p]) if (v[w]==-1) {
            v[w]=p+1;
            q.push(w);
        }
    }
    cout<<"Yes"<<endl;
    for(int i=1; i<n; ++i) cout<<v[i]<<'\n';
}
    


Measured memory_bytes: 10404
#include <bits/stdc++.h>
using namespace std;
#define int long long int
char grid[55][55];
int32_t main(){
	int h,w;cin>>h>>w;
	for(int i=1;i<=h;i++){
		cin>>grid[i]+1;
	}
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			if(grid[i][j]=='#'){
				//cout<<i<<" "<<j<<"\n";
				int cnt=0;
				cnt+=(grid[i+1][j]=='#');
				cnt+=(grid[i-1][j]=='#');
				cnt+=(grid[i][j+1]=='#');
				cnt+=(grid[i][j-1]=='#');
				if(!cnt){
					cout<<"No";//<<i<<" "<<j<<"\n";
					return 0;
				}
			}
		}
	}
	cout<<"Yes";
}


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

class UnionFind
{
    private:
        std::vector<int> parent;  // parent[x]: x の根の番号
                                  //            x が根の場合はその連結成分の大きさ
        std::vector<int> rank;    // rank[x]  : x が属する木の高さ
        std::size_t sz;           // 連結成分の数

    public:
        // x が親の場合、parent[x] = -(その連結成分の大きさ)
        UnionFind( std::size_t n ): parent(n, -1), rank(n, 0), sz(n) {}

        // x が属する集合の親を返し、x を親に直接繋ぎ直す(経路圧縮)
        int find( int x )
        {
            if( parent[x] < 0 ) return x;
            else return parent[x] = find( parent[x] );
        }

        // x が属する集合と y が属する集合を統合する
        bool unite( int x, int y )
        {
            x = find( x );
            y = find( y );
            if( x == y ) return false;

            // 大きい方(x)に小さい方(y)を繋げる
            if( rank[x] < rank[y] ) std::swap( x, y );

            parent[x] += parent[y];  // x に連結している成分の大きさを更新する
            parent[y] = x;           // y を x に繋ぐ
            if( rank[x] == rank[y] ) rank[x]++;
            sz--;

            return true;
        }

        bool same( int x, int y ) { return find(x) == find(y); }
        std::size_t size()        { return sz; }
        std::size_t size( int x ) { return - parent[find(x)]; }
};


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


    UnionFind uf(N);
    for( int i = 0; i < M; ++i ){
        int X, Y, Z;
        cin >> X >> Y >> Z;
        --X, --Y;
        uf.unite(X, Y);
    }
    cout << uf.size() << endl;

    return 0;
}

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

const int N = 300000;
int for_erat[N];
vector<int> prime;

void erat(){
    for(int i = 0; i < N; i++){
        for_erat[i] = 1;
    }
    for(int i = 2; i < sqrt(N); i++){
        if(for_erat[i]){
            for(int j = 0; i * (j + 2) < N; j++){
                for_erat[i *(j + 2)] = 0;
            }
        }
    }

    for(int i = 2; i < N; i++){
        if(for_erat[i]){
            prime.push_back(i);
        }
    }
}

void solve(int n){
    int cnt = 0;
    for(int i=0; i<prime.size(); i++){
        if(n < prime[i] && prime[i] <= 2*n) cnt++;
    }
    cout << cnt << endl;
    return;
}


int main(){
    erat();
    while(true){
        int n;
        cin >> n;
        if(n == 0) break;
        solve(n);
    }
    return 0;
}


Measured memory_bytes: 4436
#include<iostream>
#include<algorithm>
using namespace std;
int main (void)
{ 
  int n,a,b,c,i;
  cin>>n;
  int ans=0;
  n--;
  for(i=1;i<=n;i++)
  {
    ans+=n/i;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3632
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"

using namespace std;

const long long int MOD = 1000000007;

int N, M, K, H, W, L, R;


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

	cin >> N >> M;
	while (N) {
		vector<int>v(N + 1);
		for (int i = 1; i <= N; i++)cin >> v[i];
		int cnt = 1;
		for (int i = 0; i < M; i++) {
			cin >> K;
			cnt += K;
			if (cnt < N) {
				cnt += v[cnt];
			}
			if (cnt >= N) {
				cout << i + 1 << endl;
				for (int j = i + 1; j  < M; j++)cin >> K;
				break;
			}
		}
		cin >> N >> M;
	}
	return 0;
}


Measured memory_bytes: 3124
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int cnt[210];
int main() {
    int n,x;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &x);
        while (!(x & 1)) {
            x >>= 1;
            ++cnt[i];
        }
    }
    int ans = 100;
    for (int i = 0; i < n; ++i) ans = min(ans, cnt[i]);
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 256